diff options
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-i2c.c')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-i2c.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-i2c.c b/linux/drivers/media/video/cx88/cx88-i2c.c index 1705c060d..41cb1012f 100644 --- a/linux/drivers/media/video/cx88/cx88-i2c.c +++ b/linux/drivers/media/video/cx88/cx88-i2c.c @@ -1,5 +1,5 @@ /* - $Id: cx88-i2c.c,v 1.31 2005/09/13 20:11:39 mkrufky Exp $ + $Id: cx88-i2c.c,v 1.32 2005/10/09 18:07:06 mchehab Exp $ cx88-i2c.c -- all the i2c code is here @@ -32,6 +32,9 @@ #include "compat.h" #include "cx88.h" +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#include <media/i2c-compat.h> +#endif static unsigned int i2c_debug = 0; module_param(i2c_debug, int, 0644); @@ -154,7 +157,9 @@ static struct i2c_algo_bit_data cx8800_i2c_algo_template = { static struct i2c_adapter cx8800_i2c_adap_template = { .name = "cx2388x", +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) .owner = THIS_MODULE, +#endif .id = I2C_HW_B_CX2388x, .client_register = attach_inform, .client_unregister = detach_inform, @@ -197,12 +202,18 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) memcpy(&core->i2c_client, &cx8800_i2c_client_template, sizeof(core->i2c_client)); +#ifdef I2C_CLASS_TV_ANALOG if (core->tuner_type != TUNER_ABSENT) core->i2c_adap.class |= I2C_CLASS_TV_ANALOG; +#endif +#ifdef I2C_CLASS_TV_DIGITAL if (cx88_boards[core->board].dvb) core->i2c_adap.class |= I2C_CLASS_TV_DIGITAL; +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,66) 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); |