summaryrefslogtreecommitdiff
path: root/drivers/media/usb/em28xx/em28xx.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-03-05 09:55:26 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-18 21:14:15 (GMT)
commitc7a45e5b4f8c2f96cd242ae1b1c06e7fb19a08d0 (patch)
treec96a6a20bfd01b1fd39b40d583508aaed543c04f /drivers/media/usb/em28xx/em28xx.h
parentda508f5799659241a359e2d07abb8af905f6291c (diff)
downloadlinux-fsl-qoriq-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.h')
-rw-r--r--drivers/media/usb/em28xx/em28xx.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h
index 2d6d31a..5de7b6c 100644
--- a/drivers/media/usb/em28xx/em28xx.h
+++ b/drivers/media/usb/em28xx/em28xx.h
@@ -157,6 +157,9 @@
#define EM28XX_NUM_BUFS 5
#define EM28XX_DVB_NUM_BUFS 5
+/* max number of I2C buses on em28xx devices */
+#define NUM_I2C_BUSES 2
+
/* isoc transfers: number of packets for each buffer
windows requests only 64 packets .. so we better do the same
this is what I found out for all alternate numbers there!
@@ -507,10 +510,13 @@ struct em28xx {
int tuner_type; /* type of the tuner */
int tuner_addr; /* tuner address */
int tda9887_conf;
+
/* i2c i/o */
- struct i2c_adapter i2c_adap;
- struct i2c_client i2c_client;
+ struct i2c_adapter i2c_adap[NUM_I2C_BUSES];
+ struct i2c_client i2c_client[NUM_I2C_BUSES];
unsigned char eeprom_addrwidth_16bit:1;
+ int def_i2c_bus; /* Default I2C bus */
+
/* video for linux */
int users; /* user count for exclusive use */
int streaming_users; /* Number of actively streaming users */