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 <Andrew.Jackson@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
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)
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;