aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/cx231xx
diff options
context:
space:
mode:
authorMatthias Schwarzott <zzam@gentoo.org>2014-10-02 01:21:01 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-10-30 15:38:36 -0400
commit8a0253481c4db5e0790de16748435dbc06b63e65 (patch)
treee6199ee405f1ed99ed6440941c9b392f8a8f415f /drivers/media/usb/cx231xx
parenta1f267651f1f653c82f46bf1d7d108ad31926a10 (diff)
[media] cx231xx: let is_tuner check the real i2c port and not the i2c master number
Get used i2c port from bus_nr and status of port_3 switch. Signed-off-by: Matthias Schwarzott <zzam@gentoo.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/cx231xx')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-i2c.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index af9180f3bf30..9ade3acbc877 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -54,10 +54,19 @@ do { \
54 } \ 54 } \
55} while (0) 55} while (0)
56 56
57static inline int get_real_i2c_port(struct cx231xx *dev, int bus_nr)
58{
59 if (bus_nr == 1)
60 return dev->port_3_switch_enabled ? I2C_1_MUX_3 : I2C_1_MUX_1;
61 return bus_nr;
62}
63
57static inline bool is_tuner(struct cx231xx *dev, struct cx231xx_i2c *bus, 64static inline bool is_tuner(struct cx231xx *dev, struct cx231xx_i2c *bus,
58 const struct i2c_msg *msg, int tuner_type) 65 const struct i2c_msg *msg, int tuner_type)
59{ 66{
60 if (bus->nr != dev->board.tuner_i2c_master) 67 int i2c_port = get_real_i2c_port(dev, bus->nr);
68
69 if (i2c_port != dev->board.tuner_i2c_master)
61 return false; 70 return false;
62 71
63 if (msg->addr != dev->board.tuner_addr) 72 if (msg->addr != dev->board.tuner_addr)