summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMatthias Schwarzott <zzam@gentoo.org>2014-10-02 02:21:05 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-10-30 17:42:17 -0200
commite4de03f26384452c47fe8b97838aeba3bec4122f (patch)
tree2a4e48f0daa4190d0ed070b90983c8d4bd5b19be /drivers/media
parent660acd54d1656f6361819d8d6b377a2aa2438748 (diff)
downloadblackbird-obmc-linux-e4de03f26384452c47fe8b97838aeba3bec4122f.tar.gz
blackbird-obmc-linux-e4de03f26384452c47fe8b97838aeba3bec4122f.zip
[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: Matthias Schwarzott <zzam@gentoo.org> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-core.c6
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-i2c.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c
index c49022f4525a..9b5cd9e9b169 100644
--- a/drivers/media/usb/cx231xx/cx231xx-core.c
+++ b/drivers/media/usb/cx231xx/cx231xx-core.c
@@ -1303,6 +1303,12 @@ int cx231xx_dev_init(struct cx231xx *dev)
cx231xx_i2c_mux_register(dev, 0);
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 */
/* Note : with out calling set power mode function,
afe can not be set up correctly */
diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 3e9dfd808518..d1003c703fb5 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -492,6 +492,9 @@ void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port)
int i, rc;
struct i2c_client client;
+ if (!i2c_scan)
+ return;
+
memset(&client, 0, sizeof(client));
client.adapter = cx231xx_get_i2c_adap(dev, i2c_port);
@@ -528,10 +531,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
i2c_set_adapdata(&bus->i2c_adap, &dev->v4l2_dev);
i2c_add_adapter(&bus->i2c_adap);
- if (0 == bus->i2c_rc) {
- if (i2c_scan)
- cx231xx_do_i2c_scan(dev, bus->nr);
- } else
+ if (0 != bus->i2c_rc)
cx231xx_warn("%s: i2c bus %d register FAILED\n",
dev->name, bus->nr);
OpenPOWER on IntegriCloud