From: Liviu Dudau Date: Wed, 13 Aug 2014 13:28:45 +0000 (+0100) Subject: Set the CEC I2C address based on the slave I2C address. X-Git-Tag: submit/tizen/20141203.153721~68 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d657945d356fa68392f427f9ed01f6ecf4b0cbfe;p=platform%2Fkernel%2Flinux-arm64.git 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 --- 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;