Commit a1e09b62 authored by Francisco Jerez's avatar Francisco Jerez Committed by Dave Airlie

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: default avatarFrancisco Jerez <currojerez@riseup.net>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent fca3ec01
...@@ -41,6 +41,9 @@ ...@@ -41,6 +41,9 @@
* &drm_encoder_slave. The @slave_funcs field will be initialized with * &drm_encoder_slave. The @slave_funcs field will be initialized with
* the hooks provided by the slave driver. * 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, * Returns 0 on success or a negative errno on failure, in particular,
* -ENODEV is returned when no matching driver is found. * -ENODEV is returned when no matching driver is found.
*/ */
...@@ -85,6 +88,10 @@ int drm_i2c_encoder_init(struct drm_device *dev, ...@@ -85,6 +88,10 @@ int drm_i2c_encoder_init(struct drm_device *dev,
if (err) if (err)
goto fail_unregister; goto fail_unregister;
if (info->platform_data)
encoder->slave_funcs->set_config(&encoder->base,
info->platform_data);
return 0; return 0;
fail_unregister: fail_unregister:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment