summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-11-04 14:34:05 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-11-04 14:34:05 -0200
commit9cf5ea39af8b2066fc3d85fdae32ef96c513cfc9 (patch)
treefe5e5862edd3f6eb5ff5fda0c6cb86167a0d138f /linux/drivers/media
parent87a688a17ae8f82d48dd8833ed0eb29ecba1183c (diff)
parent74bd6ae05b7e17bfc384b7658e4a4980f6f6c3fb (diff)
downloadmediapointer-dvb-s2-9cf5ea39af8b2066fc3d85fdae32ef96c513cfc9.tar.gz
mediapointer-dvb-s2-9cf5ea39af8b2066fc3d85fdae32ef96c513cfc9.tar.bz2
merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/mt20xx.c2
-rw-r--r--linux/drivers/media/video/tda8290.c2
-rw-r--r--linux/drivers/media/video/tea5761.c2
-rw-r--r--linux/drivers/media/video/tea5767.c3
-rw-r--r--linux/drivers/media/video/tuner-core.c495
-rw-r--r--linux/drivers/media/video/tuner-driver.h7
-rw-r--r--linux/drivers/media/video/tuner-i2c.h6
-rw-r--r--linux/drivers/media/video/tuner-simple.c2
-rw-r--r--linux/drivers/media/video/tuner-xc2028.c2
9 files changed, 242 insertions, 279 deletions
diff --git a/linux/drivers/media/video/mt20xx.c b/linux/drivers/media/video/mt20xx.c
index 5c6d05b07..d1789d109 100644
--- a/linux/drivers/media/video/mt20xx.c
+++ b/linux/drivers/media/video/mt20xx.c
@@ -18,7 +18,7 @@ static int debug = 0;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable verbose debug messages");
-#define PREFIX "mt20xx "
+#define PREFIX "mt20xx"
/* ---------------------------------------------------------------------- */
diff --git a/linux/drivers/media/video/tda8290.c b/linux/drivers/media/video/tda8290.c
index 1754f572c..8fed39d31 100644
--- a/linux/drivers/media/video/tda8290.c
+++ b/linux/drivers/media/video/tda8290.c
@@ -40,7 +40,7 @@ module_param_named(debug, tuner_debug, int, 0644);
#endif
MODULE_PARM_DESC(debug, "enable verbose debug messages");
-#define PREFIX "tda8290 "
+#define PREFIX "tda8290"
/* ---------------------------------------------------------------------- */
diff --git a/linux/drivers/media/video/tea5761.c b/linux/drivers/media/video/tea5761.c
index d5f83818d..fd534d9b3 100644
--- a/linux/drivers/media/video/tea5761.c
+++ b/linux/drivers/media/video/tea5761.c
@@ -19,7 +19,7 @@ static int debug = 0;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable verbose debug messages");
-#define PREFIX "tea5761 "
+#define PREFIX "tea5761"
struct tea5761_priv {
struct tuner_i2c_props i2c_props;
diff --git a/linux/drivers/media/video/tea5767.c b/linux/drivers/media/video/tea5767.c
index e2e67247e..d830b1a71 100644
--- a/linux/drivers/media/video/tea5767.c
+++ b/linux/drivers/media/video/tea5767.c
@@ -24,7 +24,7 @@ static int debug = 0;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable verbose debug messages");
-#define PREFIX "tea5767 "
+#define PREFIX "tea5767"
/*****************************************************************************/
@@ -436,7 +436,6 @@ int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr)
return EINVAL;
}
#endif
- printk(KERN_WARNING "TEA5767 detected.\n");
return 0;
}
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index 1285c44ab..b1cf04f33 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -20,6 +20,7 @@
#include <media/tuner.h>
#include <media/tuner-types.h>
#include <media/v4l2-common.h>
+#include <media/v4l2-i2c-drv-legacy.h>
#include "tuner-driver.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include "i2c-compat.h"
@@ -34,7 +35,11 @@
#define UNSET (-1U)
-#define PREFIX "tuner "
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 15)
+#define PREFIX t->i2c->driver->name
+#else
+#define PREFIX t->i2c->driver->driver.name
+#endif
/* standard i2c insmod options */
static unsigned short normal_i2c[] = {
@@ -100,9 +105,6 @@ MODULE_DESCRIPTION("device driver for various TV and TV+FM radio tuners");
MODULE_AUTHOR("Ralph Metzler, Gerd Knorr, Gunther Mayer");
MODULE_LICENSE("GPL");
-static struct i2c_driver driver;
-static struct i2c_client client_template;
-
/* ---------------------------------------------------------------------- */
static void fe_set_freq(struct dvb_frontend *fe, unsigned int freq)
@@ -619,194 +621,6 @@ static void tuner_status(struct dvb_frontend *fe)
/* ---------------------------------------------------------------------- */
-/* static vars: used only in tuner_attach and tuner_probe */
-static unsigned default_mode_mask;
-
-/* During client attach, set_type is called by adapter's attach_inform callback.
- set_type must then be completed by tuner_attach.
- */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
-#else
-static int tuner_attach(struct i2c_adapter *adap, int addr,
- unsigned short flags, int kind)
-#endif
-{
- struct i2c_client *client;
- struct tuner *t;
-
- client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
- if (NULL == client)
- return -ENOMEM;
-
- t = kzalloc(sizeof(struct tuner), GFP_KERNEL);
- if (NULL == t) {
- kfree(client);
- return -ENOMEM;
- }
- t->i2c = client;
- client_template.adapter = adap;
- client_template.addr = addr;
- memcpy(client, &client_template, sizeof(struct i2c_client));
- i2c_set_clientdata(client, t);
- t->type = UNSET;
- t->audmode = V4L2_TUNER_MODE_STEREO;
- t->mode_mask = T_UNINITIALIZED;
-
- if (show_i2c) {
- unsigned char buffer[16];
- int i,rc;
-
- memset(buffer, 0, sizeof(buffer));
- rc = i2c_master_recv(client, buffer, sizeof(buffer));
- tuner_info("I2C RECV = ");
- for (i=0;i<rc;i++)
- printk("%02x ",buffer[i]);
- printk("\n");
- }
- /* HACK: This test were added to avoid tuner to probe tda9840 and tea6415c on the MXB card */
- if (adap->id == I2C_HW_SAA7146 && addr < 0x4a)
- return -ENODEV;
-
- /* autodetection code based on the i2c addr */
- if (!no_autodetect) {
- switch (addr) {
- case 0x10:
- if (tea5761_autodetection(t->i2c->adapter, t->i2c->addr) != EINVAL) {
- t->type = TUNER_TEA5761;
- t->mode_mask = T_RADIO;
- t->mode = T_STANDBY;
- t->radio_freq = 87.5 * 16000; /* Sets freq to FM range */
- default_mode_mask &= ~T_RADIO;
-
- goto register_client;
- }
- break;
- case 0x42:
- case 0x43:
- case 0x4a:
- case 0x4b:
- /* If chip is not tda8290, don't register.
- since it can be tda9887*/
- if (tda829x_probe(t) == 0) {
- tuner_dbg("tda829x detected\n");
- } else {
- /* Default is being tda9887 */
- t->type = TUNER_TDA9887;
- t->mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
- t->mode = T_STANDBY;
- goto register_client;
- }
- break;
- case 0x60:
- if (tea5767_autodetection(t->i2c->adapter, t->i2c->addr) != EINVAL) {
- t->type = TUNER_TEA5767;
- t->mode_mask = T_RADIO;
- t->mode = T_STANDBY;
- t->radio_freq = 87.5 * 16000; /* Sets freq to FM range */
- default_mode_mask &= ~T_RADIO;
-
- goto register_client;
- }
- break;
- }
- }
-
- /* Initializes only the first adapter found */
- if (default_mode_mask != T_UNINITIALIZED) {
- tuner_dbg ("Setting mode_mask to 0x%02x\n", default_mode_mask);
- t->mode_mask = default_mode_mask;
- t->tv_freq = 400 * 16; /* Sets freq to VHF High */
- t->radio_freq = 87.5 * 16000; /* Sets freq to FM range */
- default_mode_mask = T_UNINITIALIZED;
- }
-
- /* Should be just before return */
-register_client:
- tuner_info("chip found @ 0x%x (%s)\n", addr << 1, adap->name);
-
- /* Sets a default mode */
- if (t->mode_mask & T_ANALOG_TV) {
- t->mode = T_ANALOG_TV;
- } else if (t->mode_mask & T_RADIO) {
- t->mode = T_RADIO;
- } else {
- t->mode = T_DIGITAL_TV;
- }
-
- i2c_attach_client (client);
- set_type (client,t->type, t->mode_mask, t->config, t->tuner_callback);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-MOD_INC_USE_COUNT;
-#endif
- return 0;
-}
-
-static int tuner_probe(struct i2c_adapter *adap)
-{
- if (0 != addr) {
- normal_i2c[0] = addr;
- normal_i2c[1] = I2C_CLIENT_END;
- }
-
- /* HACK: Ignore 0x6b and 0x6f on cx88 boards.
- * FusionHDTV5 RT Gold has an ir receiver at 0x6b
- * and an RTC at 0x6f which can get corrupted if probed.
- */
- if ((adap->id == I2C_HW_B_CX2388x) ||
- (adap->id == I2C_HW_B_CX23885)) {
- unsigned int i = 0;
-
- while (i < I2C_CLIENT_MAX_OPTS && ignore[i] != I2C_CLIENT_END)
- i += 2;
- if (i + 4 < I2C_CLIENT_MAX_OPTS) {
- ignore[i+0] = adap->nr;
- ignore[i+1] = 0x6b;
- ignore[i+2] = adap->nr;
- ignore[i+3] = 0x6f;
- ignore[i+4] = I2C_CLIENT_END;
- } else
- printk(KERN_WARNING "tuner: "
- "too many options specified "
- "in i2c probe ignore list!\n");
- }
-
- default_mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
-
-#ifdef I2C_CLASS_TV_ANALOG
- if (adap->class & I2C_CLASS_TV_ANALOG)
- return i2c_probe(adap, &addr_data, tuner_attach);
-#else
- if (adap->id == I2C_HW_B_BT848)
- return i2c_probe(adap, &addr_data, tuner_attach);
-#endif
- return 0;
-}
-
-static int tuner_detach(struct i2c_client *client)
-{
- struct tuner *t = i2c_get_clientdata(client);
- struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops;
- int err;
-
- err = i2c_detach_client(t->i2c);
- if (err) {
- tuner_warn
- ("Client deregistration failed, client not detached.\n");
- return err;
- }
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-MOD_DEC_USE_COUNT;
-#endif
- if (ops && ops->release)
- ops->release(&t->fe);
-
- kfree(t);
- kfree(client);
- return 0;
-}
-
/*
* Switch tuner to other mode. If tuner support both tv and radio,
* set another frequency to some value (This is needed for some pal
@@ -1145,47 +959,20 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
return 0;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14)
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
static int tuner_suspend(struct i2c_client *c, pm_message_t state)
-#else
-static int tuner_suspend(struct device *dev, pm_message_t state)
-#endif
-#else
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
-static int tuner_suspend(struct device *dev, pm_message_t state, u32 level)
-#else
-static int tuner_suspend(struct device *dev, u32 state, u32 level)
-#endif
-#endif
{
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
- struct i2c_client *c = container_of (dev, struct i2c_client, dev);
-#endif
- struct tuner *t = i2c_get_clientdata (c);
+ struct tuner *t = i2c_get_clientdata(c);
- tuner_dbg ("suspend\n");
+ tuner_dbg("suspend\n");
/* FIXME: power down ??? */
return 0;
}
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,14)
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
static int tuner_resume(struct i2c_client *c)
-#else
-static int tuner_resume(struct device *dev)
-#endif
-#else
-static int tuner_resume(struct device *dev, u32 level)
-#endif
{
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
- struct i2c_client *c = container_of (dev, struct i2c_client, dev);
-#endif
- struct tuner *t = i2c_get_clientdata (c);
+ struct tuner *t = i2c_get_clientdata(c);
- tuner_dbg ("resume\n");
+ tuner_dbg("resume\n");
if (V4L2_TUNER_RADIO == t->mode) {
if (t->radio_freq)
set_freq(c, t->radio_freq);
@@ -1195,58 +982,234 @@ static int tuner_resume(struct device *dev, u32 level)
}
return 0;
}
-#endif
-/* ----------------------------------------------------------------------- */
+/* ---------------------------------------------------------------------- */
-static struct i2c_driver driver = {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))&&(LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15))
- .owner = THIS_MODULE,
-#endif
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
- .name = "tuner",
- .flags = I2C_DF_NOTIFY,
-#endif
- .id = I2C_DRIVERID_TUNER,
- .attach_adapter = tuner_probe,
- .detach_client = tuner_detach,
- .command = tuner_command,
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)
- .suspend = tuner_suspend,
- .resume = tuner_resume,
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
- .driver = {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15)
- .name = "tuner",
-#endif
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,20)
- .suspend = tuner_suspend,
- .resume = tuner_resume,
-#endif
- },
-#endif
-};
-static struct i2c_client client_template = {
- .name = "(tuner unset)",
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,15)
- .flags = I2C_CLIENT_ALLOW_USE,
-#endif
- .driver = &driver,
-};
+LIST_HEAD(tuner_list);
-static int __init tuner_init_module(void)
+/* Search for existing radio and/or TV tuners on the given I2C adapter.
+ Note that when this function is called from tuner_probe you can be
+ certain no other devices will be added/deleted at the same time, I2C
+ core protects against that. */
+static void tuner_lookup(struct i2c_adapter *adap,
+ struct tuner **radio, struct tuner **tv)
{
- return i2c_add_driver(&driver);
+ struct tuner *pos;
+
+ *radio = NULL;
+ *tv = NULL;
+
+ list_for_each_entry(pos, &tuner_list, list) {
+ int mode_mask;
+
+ if (pos->i2c->adapter != adap ||
+ pos->i2c->driver->id != I2C_DRIVERID_TUNER)
+ continue;
+
+ mode_mask = pos->mode_mask & ~T_STANDBY;
+ if (*radio == NULL && mode_mask == T_RADIO)
+ *radio = pos;
+ /* Note: currently TDA9887 is the only demod-only
+ device. If other devices appear then we need to
+ make this test more general. */
+ else if (*tv == NULL && pos->type != TUNER_TDA9887 &&
+ (pos->mode_mask & (T_ANALOG_TV | T_DIGITAL_TV)))
+ *tv = pos;
+ }
}
-static void __exit tuner_cleanup_module(void)
+/* During client attach, set_type is called by adapter's attach_inform callback.
+ set_type must then be completed by tuner_probe.
+ */
+static int tuner_probe(struct i2c_client *client)
{
- i2c_del_driver(&driver);
+ struct tuner *t;
+ struct tuner *radio;
+ struct tuner *tv;
+
+ t = kzalloc(sizeof(struct tuner), GFP_KERNEL);
+ if (NULL == t)
+ return -ENOMEM;
+ t->i2c = client;
+ strlcpy(client->name, "(tuner unset)", sizeof(client->name));
+ i2c_set_clientdata(client, t);
+ t->type = UNSET;
+ t->audmode = V4L2_TUNER_MODE_STEREO;
+ t->mode_mask = T_UNINITIALIZED;
+
+ if (show_i2c) {
+ unsigned char buffer[16];
+ int i, rc;
+
+ memset(buffer, 0, sizeof(buffer));
+ rc = i2c_master_recv(client, buffer, sizeof(buffer));
+ tuner_info("I2C RECV = ");
+ for (i = 0; i < rc; i++)
+ printk(KERN_CONT "%02x ", buffer[i]);
+ printk("\n");
+ }
+ /* HACK: This test was added to avoid tuner to probe tda9840 and
+ tea6415c on the MXB card */
+ if (client->adapter->id == I2C_HW_SAA7146 && client->addr < 0x4a) {
+ kfree(t);
+ return -ENODEV;
+ }
+
+ /* autodetection code based on the i2c addr */
+ if (!no_autodetect) {
+ switch (client->addr) {
+ case 0x10:
+ if (tea5761_autodetection(t->i2c->adapter, t->i2c->addr)
+ != EINVAL) {
+ t->type = TUNER_TEA5761;
+ t->mode_mask = T_RADIO;
+ t->mode = T_STANDBY;
+ /* Sets freq to FM range */
+ t->radio_freq = 87.5 * 16000;
+ tuner_lookup(t->i2c->adapter, &radio, &tv);
+ if (tv)
+ tv->mode_mask &= ~T_RADIO;
+
+ goto register_client;
+ }
+ break;
+ case 0x42:
+ case 0x43:
+ case 0x4a:
+ case 0x4b:
+ /* If chip is not tda8290, don't register.
+ since it can be tda9887*/
+ if (tda829x_probe(t) == 0) {
+ tuner_dbg("tda829x detected\n");
+ } else {
+ /* Default is being tda9887 */
+ t->type = TUNER_TDA9887;
+ t->mode_mask = T_RADIO | T_ANALOG_TV |
+ T_DIGITAL_TV;
+ t->mode = T_STANDBY;
+ goto register_client;
+ }
+ break;
+ case 0x60:
+ if (tea5767_autodetection(t->i2c->adapter, t->i2c->addr)
+ != EINVAL) {
+ t->type = TUNER_TEA5767;
+ t->mode_mask = T_RADIO;
+ t->mode = T_STANDBY;
+ /* Sets freq to FM range */
+ t->radio_freq = 87.5 * 16000;
+ tuner_lookup(t->i2c->adapter, &radio, &tv);
+ if (tv)
+ tv->mode_mask &= ~T_RADIO;
+
+ goto register_client;
+ }
+ break;
+ }
+ }
+
+ /* Initializes only the first TV tuner on this adapter. Why only the
+ first? Because there are some devices (notably the ones with TI
+ tuners) that have more than one i2c address for the *same* device.
+ Experience shows that, except for just one case, the first
+ address is the right one. The exception is a Russian tuner
+ (ACORP_Y878F). So, the desired behavior is just to enable the
+ first found TV tuner. */
+ tuner_lookup(t->i2c->adapter, &radio, &tv);
+ if (tv == NULL) {
+ t->mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
+ if (radio == NULL)
+ t->mode_mask |= T_RADIO;
+ tuner_dbg("Setting mode_mask to 0x%02x\n", t->mode_mask);
+ t->tv_freq = 400 * 16; /* Sets freq to VHF High */
+ t->radio_freq = 87.5 * 16000; /* Sets freq to FM range */
+ }
+
+ /* Should be just before return */
+register_client:
+ tuner_info("chip found @ 0x%x (%s)\n", client->addr << 1,
+ client->adapter->name);
+
+ /* Sets a default mode */
+ if (t->mode_mask & T_ANALOG_TV) {
+ t->mode = T_ANALOG_TV;
+ } else if (t->mode_mask & T_RADIO) {
+ t->mode = T_RADIO;
+ } else {
+ t->mode = T_DIGITAL_TV;
+ }
+ set_type(client, t->type, t->mode_mask, t->config, t->tuner_callback);
+ list_add_tail(&t->list, &tuner_list);
+ return 0;
+}
+
+static int tuner_legacy_probe(struct i2c_adapter *adap)
+{
+ if (0 != addr) {
+ normal_i2c[0] = addr;
+ normal_i2c[1] = I2C_CLIENT_END;
+ }
+
+#ifdef I2C_CLASS_TV_ANALOG
+ if ((adap->class & I2C_CLASS_TV_ANALOG) == 0)
+#else
+ if (adap->id != I2C_HW_B_BT848)
+#endif
+ return 0;
+
+ /* HACK: Ignore 0x6b and 0x6f on cx88 boards.
+ * FusionHDTV5 RT Gold has an ir receiver at 0x6b
+ * and an RTC at 0x6f which can get corrupted if probed.
+ */
+ if ((adap->id == I2C_HW_B_CX2388x) ||
+ (adap->id == I2C_HW_B_CX23885)) {
+ unsigned int i = 0;
+
+ while (i < I2C_CLIENT_MAX_OPTS && ignore[i] != I2C_CLIENT_END)
+ i += 2;
+ if (i + 4 < I2C_CLIENT_MAX_OPTS) {
+ ignore[i+0] = adap->nr;
+ ignore[i+1] = 0x6b;
+ ignore[i+2] = adap->nr;
+ ignore[i+3] = 0x6f;
+ ignore[i+4] = I2C_CLIENT_END;
+ } else
+ printk(KERN_WARNING "tuner: "
+ "too many options specified "
+ "in i2c probe ignore list!\n");
+ }
+ return 1;
}
-module_init(tuner_init_module);
-module_exit(tuner_cleanup_module);
+static int tuner_remove(struct i2c_client *client)
+{
+ struct tuner *t = i2c_get_clientdata(client);
+ struct analog_tuner_ops *ops = t->fe.ops.analog_demod_ops;
+
+ if (ops && ops->release)
+ ops->release(&t->fe);
+
+ list_del(&t->list);
+ kfree(t);
+ return 0;
+}
+
+/* ----------------------------------------------------------------------- */
+
+static struct v4l2_i2c_driver_data v4l2_i2c_data = {
+ .name = "tuner",
+ .driverid = I2C_DRIVERID_TUNER,
+ .command = tuner_command,
+ .probe = tuner_probe,
+ .remove = tuner_remove,
+ .suspend = tuner_suspend,
+ .resume = tuner_resume,
+ .legacy_probe = tuner_legacy_probe,
+};
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
+EXPORT_NO_SYMBOLS;
+#endif
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
diff --git a/linux/drivers/media/video/tuner-driver.h b/linux/drivers/media/video/tuner-driver.h
index 1c60229dc..d6e5afdaa 100644
--- a/linux/drivers/media/video/tuner-driver.h
+++ b/linux/drivers/media/video/tuner-driver.h
@@ -46,6 +46,7 @@ struct analog_tuner_ops {
struct tuner {
/* device */
struct i2c_client *i2c;
+ struct list_head list; /* list of tuners */
unsigned int type; /* chip type */
@@ -71,15 +72,15 @@ struct tuner {
/* ------------------------------------------------------------------------ */
#define tuner_warn(fmt, arg...) do {\
- printk(KERN_WARNING PREFIX "%d-%04x: " fmt, \
+ printk(KERN_WARNING "%s %d-%04x: " fmt, PREFIX, \
i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); } while (0)
#define tuner_info(fmt, arg...) do {\
- printk(KERN_INFO PREFIX "%d-%04x: " fmt, \
+ printk(KERN_INFO "%s %d-%04x: " fmt, PREFIX, \
i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); } while (0)
#define tuner_dbg(fmt, arg...) do {\
extern int tuner_debug; \
if (tuner_debug) \
- printk(KERN_DEBUG PREFIX "%d-%04x: " fmt, \
+ printk(KERN_DEBUG "%s %d-%04x: " fmt, PREFIX, \
i2c_adapter_id(t->i2c->adapter), t->i2c->addr , ##arg); } while (0)
#endif /* __TUNER_DRIVER_H__ */
diff --git a/linux/drivers/media/video/tuner-i2c.h b/linux/drivers/media/video/tuner-i2c.h
index 159019ec3..cfba3d109 100644
--- a/linux/drivers/media/video/tuner-i2c.h
+++ b/linux/drivers/media/video/tuner-i2c.h
@@ -48,14 +48,14 @@ static inline int tuner_i2c_xfer_recv(struct tuner_i2c_props *props, char *buf,
#ifndef __TUNER_DRIVER_H__
#define tuner_warn(fmt, arg...) do {\
- printk(KERN_WARNING PREFIX "%d-%04x: " fmt, \
+ printk(KERN_WARNING "%s %d-%04x: " fmt, PREFIX, \
i2c_adapter_id(priv->i2c_props.adap), priv->i2c_props.addr , ##arg); } while (0)
#define tuner_info(fmt, arg...) do {\
- printk(KERN_INFO PREFIX "%d-%04x: " fmt, \
+ printk(KERN_INFO "%s %d-%04x: " fmt, PREFIX, \
i2c_adapter_id(priv->i2c_props.adap), priv->i2c_props.addr , ##arg); } while (0)
#define tuner_dbg(fmt, arg...) do {\
if ((debug)) \
- printk(KERN_DEBUG PREFIX "%d-%04x: " fmt, \
+ printk(KERN_DEBUG "%s %d-%04x: " fmt, PREFIX, \
i2c_adapter_id(priv->i2c_props.adap), priv->i2c_props.addr , ##arg); } while (0)
#endif /* __TUNER_DRIVER_H__ */
diff --git a/linux/drivers/media/video/tuner-simple.c b/linux/drivers/media/video/tuner-simple.c
index 98e71c0bf..78e9bcace 100644
--- a/linux/drivers/media/video/tuner-simple.c
+++ b/linux/drivers/media/video/tuner-simple.c
@@ -21,7 +21,7 @@ static int debug = 0;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable verbose debug messages");
-#define PREFIX "tuner-simple "
+#define PREFIX "tuner-simple"
static int offset = 0;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
diff --git a/linux/drivers/media/video/tuner-xc2028.c b/linux/drivers/media/video/tuner-xc2028.c
index f5a2cfa15..87ed88b38 100644
--- a/linux/drivers/media/video/tuner-xc2028.c
+++ b/linux/drivers/media/video/tuner-xc2028.c
@@ -30,7 +30,7 @@
#include <linux/dvb/frontend.h>
#include "dvb_frontend.h"
-#define PREFIX "xc2028 "
+#define PREFIX "xc2028"
static LIST_HEAD(xc2028_list);
/* struct for storing firmware table */