summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx88/cx88-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-i2c.c')
-rw-r--r--linux/drivers/media/video/cx88/cx88-i2c.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-i2c.c b/linux/drivers/media/video/cx88/cx88-i2c.c
index ef04a431d..1292a1644 100644
--- a/linux/drivers/media/video/cx88/cx88-i2c.c
+++ b/linux/drivers/media/video/cx88/cx88-i2c.c
@@ -88,18 +88,6 @@ static int cx8800_bit_getsda(void *data)
/* ----------------------------------------------------------------------- */
-#ifndef I2C_PEC
-static void cx8800_inc_use(struct i2c_adapter *adap)
-{
- MOD_INC_USE_COUNT;
-}
-
-static void cx8800_dec_use(struct i2c_adapter *adap)
-{
- MOD_DEC_USE_COUNT;
-}
-#endif
-
static int attach_inform(struct i2c_client *client)
{
struct cx88_core *core = i2c_get_adapdata(client->adapter);
@@ -161,16 +149,8 @@ static struct i2c_algo_bit_data cx8800_i2c_algo_template = {
/* ----------------------------------------------------------------------- */
static struct i2c_adapter cx8800_i2c_adap_template = {
-#ifdef I2C_PEC
- .owner = THIS_MODULE,
-#else
- .inc_use = cx8800_inc_use,
- .dec_use = cx8800_dec_use,
-#endif
-#ifdef I2C_CLASS_TV_ANALOG
- .class = I2C_CLASS_TV_ANALOG,
-#endif
I2C_DEVNAME("cx2388x"),
+ .owner = THIS_MODULE,
.id = I2C_HW_B_BT848,
.client_register = attach_inform,
.client_unregister = detach_inform,
@@ -191,9 +171,12 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci)
memcpy(&core->i2c_client, &cx8800_i2c_client_template,
sizeof(core->i2c_client));
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54)
+ if (core->tuner_type != UNSET)
+ core->i2c_adap.class |= I2C_CLASS_TV_ANALOG;
+ if (cx88_boards[core->board].dvb)
+ core->i2c_adap.class |= I2C_CLASS_TV_DIGITAL;
+
core->i2c_adap.dev.parent = &pci->dev;
-#endif
strlcpy(core->i2c_adap.name,core->name,sizeof(core->i2c_adap.name));
core->i2c_algo.data = core;
i2c_set_adapdata(&core->i2c_adap,core);