diff options
Diffstat (limited to 'linux/drivers/media/video/tvaudio.c')
-rw-r--r-- | linux/drivers/media/video/tvaudio.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/linux/drivers/media/video/tvaudio.c b/linux/drivers/media/video/tvaudio.c index 7b7cfa3b6..84e2c43b7 100644 --- a/linux/drivers/media/video/tvaudio.c +++ b/linux/drivers/media/video/tvaudio.c @@ -31,10 +31,6 @@ #endif #include "compat.h" -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) -#include "i2c-compat.h" -#else -#endif #include <media/tvaudio.h> #include <media/v4l2-common.h> #include <media/v4l2-chip-ident.h> @@ -151,9 +147,6 @@ static unsigned short normal_i2c[] = { I2C_ADDR_TDA9874 >> 1, I2C_ADDR_PIC16C54 >> 1, I2C_CLIENT_END }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13) -static unsigned short normal_i2c_range[] = { I2C_CLIENT_END }; -#endif I2C_CLIENT_INSMOD; /* ---------------------------------------------------------------------- */ @@ -283,9 +276,7 @@ static int chip_thread(void *data) if (!kthread_should_stop()) schedule(); set_current_state(TASK_RUNNING); -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) try_to_freeze(); -#endif if (kthread_should_stop()) break; v4l_dbg(1, debug, chip->c, "%s: thread wakeup\n", chip->c->name); @@ -1522,7 +1513,12 @@ static int chip_probe(struct i2c_client *client, const struct i2c_device_id *id) } /* fill required data structures */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) strcpy(client->name, desc->name); +#else + if (!id) + strlcpy(client->name, desc->name, I2C_NAME_SIZE); +#endif chip->type = desc-chiplist; chip->shadow.count = desc->registers+1; chip->prevmode = -1; @@ -1842,22 +1838,22 @@ static int chip_legacy_probe(struct i2c_adapter *adap) because dedicated drivers are used */ if ((adap->id == I2C_HW_SAA7146)) return 0; -#ifdef I2C_CLASS_TV_ANALOG if (adap->class & I2C_CLASS_TV_ANALOG) return 1; -#else - switch (adap->id) { - case I2C_HW_B_BT848: - case I2C_HW_B_RIVA: -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) - case I2C_HW_SAA7134: -#endif - return 1; - } -#endif return 0; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) +/* This driver supports many devices and the idea is to let the driver + detect which device is present. So rather than listing all supported + devices here, we pretend to support a single, fake device type. */ +static const struct i2c_device_id chip_id[] = { + { "tvaudio", 0 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, chip_id); +#endif + static struct v4l2_i2c_driver_data v4l2_i2c_data = { .name = "tvaudio", .driverid = I2C_DRIVERID_TVAUDIO, @@ -1865,6 +1861,9 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = { .probe = chip_probe, .remove = chip_remove, .legacy_probe = chip_legacy_probe, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) + .id_table = chip_id, +#endif }; /* |