Skip to contentSkip to conversation

drm/i2c: tda998x: Set the CEC I2C address based on the slave I2C address.

PATCH In review Andrew Jackson 3 participants 4 messages Nov 7, 2014 – Jan 21, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/i2c: tda998x: Set the CEC I2C address based on the slave I2C address.

The I2C address for the TDA9989 and TDA19989 is fixed at 0x34 but the two LSBs of the TDA19988's address are set by two configuration pins on the chip. Irrespective of the chip, the associated CEC peripheral's I2C address is based upon the main I2C address.

This patch avoids any special handling required to support systems that contain multiple TDA19988 devices on the same I2C bus.

---
 drivers/gpu/drm/i2c/tda998x_drv.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/gpu/drm/i2c/tda998x_drv.c +4 -1
index d476279..eeab17a 100644
@@ -1255,6 +1255,7 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv)
 	struct device_node *np = client->dev.of_node;
 	u32 video;
 	int rev_lo, rev_hi, ret;
+	unsigned short cec_addr;
 
 	priv->vip_cntrl_0 = VIP_CNTRL_0_SWAP_A(2) | VIP_CNTRL_0_SWAP_B(3);
 	priv->vip_cntrl_1 = VIP_CNTRL_1_SWAP_C(0) | VIP_CNTRL_1_SWAP_D(1);
@@ -1262,7 +1263,9 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv)
 
 	priv->current_page = 0xff;
 	priv->hdmi = client;
-	priv->cec = i2c_new_dummy(client->adapter, 0x34);
+	/* CEC I2C address bound to TDA998x I2C addr by configuration pins */
+	cec_addr = 0x34 + (client->addr & 0x03);
+	priv->cec = i2c_new_dummy(client->adapter, cec_addr);
 	if (!priv->cec)
 		return -ENODEV;
 
Signature · 1 line
1.7.1
#1 lore raw
Quoted 11 lines · Andrew Jackson

The I2C address for the TDA9989 and TDA19989 is fixed at 0x34 but the two LSBs of the TDA19988's address are set by two configuration pins on the chip. Irrespective of the chip, the associated CEC peripheral's I2C address is based upon the main I2C address.

This patch avoids any special handling required to support systems that contain multiple TDA19988 devices on the same I2C bus.

Hi Andrew,

What is the status of this patch? Is it going to be pulled by anyone?

Best regards,
Liviu

Quoted 30 lines
---
 drivers/gpu/drm/i2c/tda998x_drv.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/gpu/drm/i2c/tda998x_drv.c +4 -1
index d476279..eeab17a 100644
@@ -1255,6 +1255,7 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv)
 	struct device_node *np = client->dev.of_node;
 	u32 video;
 	int rev_lo, rev_hi, ret;
+	unsigned short cec_addr;
 
 	priv->vip_cntrl_0 = VIP_CNTRL_0_SWAP_A(2) | VIP_CNTRL_0_SWAP_B(3);
 	priv->vip_cntrl_1 = VIP_CNTRL_1_SWAP_C(0) | VIP_CNTRL_1_SWAP_D(1);
@@ -1262,7 +1263,9 @@ static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv)
 
 	priv->current_page = 0xff;
 	priv->hdmi = client;
-	priv->cec = i2c_new_dummy(client->adapter, 0x34);
+	/* CEC I2C address bound to TDA998x I2C addr by configuration pins */
+	cec_addr = 0x34 + (client->addr & 0x03);
+	priv->cec = i2c_new_dummy(client->adapter, cec_addr);
 	if (!priv->cec)
 		return -ENODEV;
 
Signature · 1 line
1.7.1
Signature · 8 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯
#2 lore raw
Quoted 10 lines · Liviu Dudau
Quoted 9 lines · Andrew Jackson

The I2C address for the TDA9989 and TDA19989 is fixed at 0x34 but the two LSBs of the TDA19988's address are set by two configuration pins on the chip. Irrespective of the chip, the associated CEC peripheral's I2C address is based upon the main I2C address.

This patch avoids any special handling required to support systems that contain multiple TDA19988 devices on the same I2C bus.

Quoted 6 lines
Quoted 2 lines

Hi Andrew,

What is the status of this patch? Is it going to be pulled by anyone?

It's been sent to David.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
#3 lore raw
Quoted 11 lines · Russell King - ARM Linux
Quoted 10 lines · Liviu Dudau
Quoted 9 lines · Andrew Jackson

The I2C address for the TDA9989 and TDA19989 is fixed at 0x34 but the two LSBs of the TDA19988's address are set by two configuration pins on the chip. Irrespective of the chip, the associated CEC peripheral's I2C address is based upon the main I2C address.

This patch avoids any special handling required to support systems that contain multiple TDA19988 devices on the same I2C bus.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Hi Andrew,

What is the status of this patch? Is it going to be pulled by anyone?

It's been sent to David.

Thanks, Russell!

Liviu

Quoted 5 lines
Signature · 3 lines
-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
Signature · 8 lines
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ?\_(?)_/?