summaryrefslogtreecommitdiff
path: root/drivers/media/usb/em28xx/em28xx-input.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-03-05 06:55:26 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-18 18:14:15 -0300
commitc7a45e5b4f8c2f96cd242ae1b1c06e7fb19a08d0 (patch)
treec96a6a20bfd01b1fd39b40d583508aaed543c04f /drivers/media/usb/em28xx/em28xx-input.c
parentda508f5799659241a359e2d07abb8af905f6291c (diff)
downloadlinux-c7a45e5b4f8c2f96cd242ae1b1c06e7fb19a08d0.tar.gz
linux-c7a45e5b4f8c2f96cd242ae1b1c06e7fb19a08d0.tar.xz
[media] em28xx: Prepare to support 2 different I2C buses
Newer em28xx devices have 2 buses. Change the logic to allow using both buses. This patch was generated by this small script: for i in drivers/media/usb/em28xx/*.c; do sed 's,->i2c_adap,->i2c_adap[dev->def_i2c_bus],g;s,->i2c_client,->i2c_client[dev->def_i2c_bus],' done Of course, em28xx.h needed manual edit. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-input.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-input.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c
index 1bef990b3f18..466b19d0d767 100644
--- a/drivers/media/usb/em28xx/em28xx-input.c
+++ b/drivers/media/usb/em28xx/em28xx-input.c
@@ -280,11 +280,12 @@ static int em2874_polling_getkey(struct em28xx_IR *ir,
static int em28xx_i2c_ir_handle_key(struct em28xx_IR *ir)
{
+ struct em28xx *dev = ir->dev;
static u32 ir_key;
int rc;
struct i2c_client client;
- client.adapter = &ir->dev->i2c_adap;
+ client.adapter = &ir->dev->i2c_adap[dev->def_i2c_bus];
client.addr = ir->i2c_dev_addr;
rc = ir->get_key_i2c(&client, &ir_key);
@@ -461,7 +462,7 @@ static int em28xx_probe_i2c_ir(struct em28xx *dev)
};
while (addr_list[i] != I2C_CLIENT_END) {
- if (i2c_probe_func_quick_read(&dev->i2c_adap, addr_list[i]) == 1)
+ if (i2c_probe_func_quick_read(&dev->i2c_adap[dev->def_i2c_bus], addr_list[i]) == 1)
return addr_list[i];
i++;
}