Skip to content

Commit

Permalink
drm/kms: Simplify setup of the initial I2C encoder config.
Browse files Browse the repository at this point in the history
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 <currojerez@riseup.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Francisco Jerez authored and Dave Airlie committed Aug 4, 2010
1 parent fca3ec0 commit a1e09b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/gpu/drm/drm_encoder_slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
* &drm_encoder_slave. The @slave_funcs field will be initialized with
* the hooks provided by the slave driver.
*
* If @info->platform_data is non-NULL it will be used as the initial
* slave config.
*
* Returns 0 on success or a negative errno on failure, in particular,
* -ENODEV is returned when no matching driver is found.
*/
Expand Down Expand Up @@ -85,6 +88,10 @@ int drm_i2c_encoder_init(struct drm_device *dev,
if (err)
goto fail_unregister;

if (info->platform_data)
encoder->slave_funcs->set_config(&encoder->base,
info->platform_data);

return 0;

fail_unregister:
Expand Down

0 comments on commit a1e09b6

Please sign in to comment.