From d657945d356fa68392f427f9ed01f6ecf4b0cbfe Mon Sep 17 00:00:00 2001 From: Liviu Dudau Date: Wed, 13 Aug 2014 14:28:45 +0100 Subject: [PATCH] Set the CEC I2C address based on the slave I2C address. The two LSBs of the TDA998x's I2C address are set by pins on the chip. The associated CEC peripheral's I2C address is set in the same way, so base the CEC address on that of the slave's address. Signed-off-by: Andrew Jackson Signed-off-by: Liviu Dudau --- drivers/gpu/drm/i2c/tda998x_drv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 514e5096ecb..db5440dc9e2 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -1234,6 +1234,7 @@ tda998x_encoder_init(struct i2c_client *client, struct device_node *np = client->dev.of_node; u32 video; int rev_lo, rev_hi, ret; + unsigned short cec_addr; priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) @@ -1245,9 +1246,9 @@ tda998x_encoder_init(struct i2c_client *client, priv->current_page = 0xff; priv->hdmi = client; - priv->cec = i2c_new_dummy(client->adapter, 0x34); - if (!priv->cec) - priv->cec = i2c_new_dummy(client->adapter, 0x35); + /* CEC I2C address is bound to TDA998x I2C address by configuration pins */ + cec_addr = 0x34 + (client->addr & 3); + priv->cec = i2c_new_dummy(client->adapter, cec_addr); if (!priv->cec) { kfree(priv); return -ENODEV; -- 2.34.1