diff options
author | Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | 2013-06-10 23:23:42 +0200 |
---|---|---|
committer | David Brown <david.brown@arm.com> | 2016-02-17 10:02:31 +0000 |
commit | 5a09526e148a46cac38b8c4837247a7bccf09bf7 (patch) | |
tree | 3318f3fa1d7cabba247532ad8647bd2ae218b252 | |
parent | a1245fc4206599ddbdb3ca41843ffbfc4a315159 (diff) |
drm: encoder_slave: respect of_node on i2c encoder init
Current DRM slave encoder API conflicts with auto-registration of i2c client
when using DT probed clients. To allow DRM slave encoders passed by DT, this
patch adds a check to drm_i2c_encoder_init for a non-NULL .of_node on
i2c_board_info and calls an of_i2c helper to get the i2c client device
instead of registering a new device.
Liviu: Updated the name of the header file containing
of_find_i2c_device_by_node()
Change-Id: I4ab81e34836cc138773da0a66f04588d7f4af1f7
Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
-rw-r--r-- | drivers/gpu/drm/drm_encoder_slave.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c index d18b88b755c..26b0744ebfc 100644 --- a/drivers/gpu/drm/drm_encoder_slave.c +++ b/drivers/gpu/drm/drm_encoder_slave.c @@ -25,6 +25,7 @@ */ #include <linux/module.h> +#include <linux/i2c.h> #include <drm/drm_encoder_slave.h> @@ -61,7 +62,10 @@ int drm_i2c_encoder_init(struct drm_device *dev, request_module("%s%s", I2C_MODULE_PREFIX, info->type); - client = i2c_new_device(adap, info); + if (info->of_node) + client = of_find_i2c_device_by_node(info->of_node); + else + client = i2c_new_device(adap, info); if (!client) { err = -ENOMEM; goto fail; |