Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display/dm: add support for OEM i2c bus

Expose the OEM i2c bus on boards that support it.
This bus is used for OEM specific features like RGB, etc.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+42
+35
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 179 179 static void amdgpu_dm_fini(struct amdgpu_device *adev); 180 180 static bool is_freesync_video_mode(const struct drm_display_mode *mode, struct amdgpu_dm_connector *aconnector); 181 181 static void reset_freesync_config_for_crtc(struct dm_crtc_state *new_crtc_state); 182 + static struct amdgpu_i2c_adapter * 183 + create_i2c(struct ddc_service *ddc_service, bool oem); 182 184 183 185 static enum drm_mode_subconnector get_subconnector_type(struct dc_link *link) 184 186 { ··· 2895 2893 return 0; 2896 2894 } 2897 2895 2896 + static int dm_oem_i2c_hw_init(struct amdgpu_device *adev) 2897 + { 2898 + struct amdgpu_display_manager *dm = &adev->dm; 2899 + struct amdgpu_i2c_adapter *oem_i2c; 2900 + struct ddc_service *oem_ddc_service; 2901 + int r; 2902 + 2903 + oem_ddc_service = dc_get_oem_i2c_device(adev->dm.dc); 2904 + if (oem_ddc_service) { 2905 + oem_i2c = create_i2c(oem_ddc_service, true); 2906 + if (!oem_i2c) { 2907 + dev_info(adev->dev, "Failed to create oem i2c adapter data\n"); 2908 + return -ENOMEM; 2909 + } 2910 + 2911 + r = i2c_add_adapter(&oem_i2c->base); 2912 + if (r) { 2913 + dev_info(adev->dev, "Failed to register oem i2c\n"); 2914 + kfree(oem_i2c); 2915 + return r; 2916 + } 2917 + dm->oem_i2c = oem_i2c; 2918 + } 2919 + 2920 + return 0; 2921 + } 2922 + 2898 2923 /** 2899 2924 * dm_hw_init() - Initialize DC device 2900 2925 * @ip_block: Pointer to the amdgpu_ip_block for this hw instance. ··· 2953 2924 return r; 2954 2925 amdgpu_dm_hpd_init(adev); 2955 2926 2927 + r = dm_oem_i2c_hw_init(adev); 2928 + if (r) 2929 + dev_info(adev->dev, "Failed to add OEM i2c bus\n"); 2930 + 2956 2931 return 0; 2957 2932 } 2958 2933 ··· 2971 2938 static int dm_hw_fini(struct amdgpu_ip_block *ip_block) 2972 2939 { 2973 2940 struct amdgpu_device *adev = ip_block->adev; 2941 + 2942 + kfree(adev->dm.oem_i2c); 2974 2943 2975 2944 amdgpu_dm_hpd_fini(adev); 2976 2945
+7
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
··· 606 606 * Bounding box data read from dmub during early initialization for DCN4+ 607 607 */ 608 608 struct dml2_soc_bb *bb_from_dmub; 609 + 610 + /** 611 + * @oem_i2c: 612 + * 613 + * OEM i2c bus 614 + */ 615 + struct amdgpu_i2c_adapter *oem_i2c; 609 616 }; 610 617 611 618 enum dsc_clock_force_state {