summaryrefslogtreecommitdiff
path: root/drivers/media/usb/cx231xx/cx231xx-cards.c
diff options
context:
space:
mode:
authorMatthias Schwarzott <zzam@gentoo.org>2014-10-02 02:20:59 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-10-30 17:18:22 -0200
commitc3c3f1ae8bab74c99fa211c76b035a41523e83dd (patch)
tree3acfa168d161401c8004de2767fa52711380c1f9 /drivers/media/usb/cx231xx/cx231xx-cards.c
parentd032ca1283b68446df0adbec4561463b3f0aa147 (diff)
[media] cx231xx: add wrapper to get the i2c_adapter pointer
This is a preparation for mapping I2C_1_MUX_1 and I2C_1_MUX_3 later to the seperate muxed i2c adapters. Map mux adapters to I2C_1 for now. Add local variables for i2c_adapters in dvb_init to get line lengths shorter. 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/usb/cx231xx/cx231xx-cards.c')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-cards.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c
index 2f027c70f786..f5fb93a79a9f 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -1033,7 +1033,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
/* request some modules */
if (dev->board.decoder == CX231XX_AVDECODER) {
dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
- &dev->i2c_bus[I2C_0].i2c_adap,
+ cx231xx_get_i2c_adap(dev, I2C_0),
"cx25840", 0x88 >> 1, NULL);
if (dev->sd_cx25840 == NULL)
cx231xx_info("cx25840 subdev registration failure\n");
@@ -1043,8 +1043,10 @@ void cx231xx_card_setup(struct cx231xx *dev)
/* Initialize the tuner */
if (dev->board.tuner_type != TUNER_ABSENT) {
+ struct i2c_adapter *tuner_i2c = cx231xx_get_i2c_adap(dev,
+ dev->board.tuner_i2c_master);
dev->sd_tuner = v4l2_i2c_new_subdev(&dev->v4l2_dev,
- &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap,
+ tuner_i2c,
"tuner",
dev->tuner_addr, NULL);
if (dev->sd_tuner == NULL)
@@ -1062,7 +1064,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
struct i2c_client client;
memset(&client, 0, sizeof(client));
- client.adapter = &dev->i2c_bus[I2C_1].i2c_adap;
+ client.adapter = cx231xx_get_i2c_adap(dev, I2C_1);
client.addr = 0xa0 >> 1;
read_eeprom(dev, &client, eeprom, sizeof(eeprom));