Commit e4de03f2 authored by Matthias Schwarzott's avatar Matthias Schwarzott Committed by Mauro Carvalho Chehab

[media] cx231xx: scan all four existing i2c busses instead of the 3 masters

The scanning itself just fails (as before this series) but now
the correct busses are scanned.
Signed-off-by: default avatarMatthias Schwarzott <zzam@gentoo.org>
Reviewed-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 660acd54
...@@ -1303,6 +1303,12 @@ int cx231xx_dev_init(struct cx231xx *dev) ...@@ -1303,6 +1303,12 @@ int cx231xx_dev_init(struct cx231xx *dev)
cx231xx_i2c_mux_register(dev, 0); cx231xx_i2c_mux_register(dev, 0);
cx231xx_i2c_mux_register(dev, 1); cx231xx_i2c_mux_register(dev, 1);
/* scan the real bus segments in the order of physical port numbers */
cx231xx_do_i2c_scan(dev, I2C_0);
cx231xx_do_i2c_scan(dev, I2C_1_MUX_1);
cx231xx_do_i2c_scan(dev, I2C_2);
cx231xx_do_i2c_scan(dev, I2C_1_MUX_3);
/* init hardware */ /* init hardware */
/* Note : with out calling set power mode function, /* Note : with out calling set power mode function,
afe can not be set up correctly */ afe can not be set up correctly */
......
...@@ -492,6 +492,9 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port) ...@@ -492,6 +492,9 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port)
int i, rc; int i, rc;
struct i2c_client client; struct i2c_client client;
if (!i2c_scan)
return;
memset(&client, 0, sizeof(client)); memset(&client, 0, sizeof(client));
client.adapter = cx231xx_get_i2c_adap(dev, i2c_port); client.adapter = cx231xx_get_i2c_adap(dev, i2c_port);
...@@ -528,10 +531,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus) ...@@ -528,10 +531,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
i2c_set_adapdata(&bus->i2c_adap, &dev->v4l2_dev); i2c_set_adapdata(&bus->i2c_adap, &dev->v4l2_dev);
i2c_add_adapter(&bus->i2c_adap); i2c_add_adapter(&bus->i2c_adap);
if (0 == bus->i2c_rc) { if (0 != bus->i2c_rc)
if (i2c_scan)
cx231xx_do_i2c_scan(dev, bus->nr);
} else
cx231xx_warn("%s: i2c bus %d register FAILED\n", cx231xx_warn("%s: i2c bus %d register FAILED\n",
dev->name, bus->nr); dev->name, bus->nr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment