Skip to content

Commit a1e09b6

Browse files
curroairlied
authored andcommitted
drm/kms: Simplify setup of the initial I2C encoder config.
In most use cases the driver will be using the same static config all the time: interpreting i2c_board_info::platform_data as the default config we can can save the GPU driver a redundant set_config() call. Signed-off-by: Francisco Jerez <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent fca3ec0 commit a1e09b6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/gpu/drm/drm_encoder_slave.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
* &drm_encoder_slave. The @slave_funcs field will be initialized with
4242
* the hooks provided by the slave driver.
4343
*
44+
* If @info->platform_data is non-NULL it will be used as the initial
45+
* slave config.
46+
*
4447
* Returns 0 on success or a negative errno on failure, in particular,
4548
* -ENODEV is returned when no matching driver is found.
4649
*/
@@ -85,6 +88,10 @@ int drm_i2c_encoder_init(struct drm_device *dev,
8588
if (err)
8689
goto fail_unregister;
8790

91+
if (info->platform_data)
92+
encoder->slave_funcs->set_config(&encoder->base,
93+
info->platform_data);
94+
8895
return 0;
8996

9097
fail_unregister:

0 commit comments

Comments
 (0)