From f6b3131538de3f25e60a25d85d05d99a4fda680a Mon Sep 17 00:00:00 2001
From: Liu Ying <victor.liu@nxp.com>
Date: Mon, 10 Sep 2018 13:54:37 +0800
Subject: [PATCH] MLK-19485 drm/bridge: it6263: Change LVDS I2C device to be
 dummy

The it6263 bridge contains two I2C devices on the same I2C bus
to control HDMI and LVDS modules respectively.  However, they
have different I2C addresses.  Thus, one of the two devices should
be registered as dummy device and bound with dummy driver.  This
is what the helper i2c_new_dummy() is designed for.  The HDMI I2C
device is normally registered as a real I2C device and bound with
a real driver, so the LVDS I2C device should be dummy.

This patch fixes the issue to access the LVDS I2C device's sys nodes,
like /sys/kernel/debug/regmap/2-0033/name.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
---
 drivers/gpu/drm/bridge/it6263.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/bridge/it6263.c b/drivers/gpu/drm/bridge/it6263.c
index 2bed01900a269d..8123dc34df54b1 100644
--- a/drivers/gpu/drm/bridge/it6263.c
+++ b/drivers/gpu/drm/bridge/it6263.c
@@ -820,10 +820,6 @@ static const struct regmap_config it6263_lvds_regmap_config = {
 	.cache_type = REGCACHE_NONE,
 };
 
-static const struct i2c_board_info it6263_lvds_i2c = {
-	I2C_BOARD_INFO("it6263_LVDS_i2c", LVDS_INPUT_CTRL_I2C_ADDR),
-};
-
 static int it6263_probe(struct i2c_client *client,
 			const struct i2c_device_id *id)
 {
@@ -844,7 +840,8 @@ static int it6263_probe(struct i2c_client *client,
 	it6263->split_mode = of_property_read_bool(np, "split-mode");
 
 	it6263->hdmi_i2c = client;
-	it6263->lvds_i2c = i2c_new_device(client->adapter, &it6263_lvds_i2c);
+	it6263->lvds_i2c = i2c_new_dummy(client->adapter,
+						LVDS_INPUT_CTRL_I2C_ADDR);
 	if (!it6263->lvds_i2c) {
 		ret = -ENODEV;
 		goto of_reconfig;
-- 
GitLab