From 1dde7a4fa2b197d298c3f1b97a7f78fd1c3a1bda Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 21 Oct 2007 13:40:56 -0300 Subject: V4L/DVB (6436): tuner: move analog_tuner_ops into dvb_frontend_ops Signed-off-by: Michael Krufky Reviewed-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index be5387f11af..d9bfa812ffe 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -610,7 +610,7 @@ static void tda9887_release(struct tuner *t) t->priv = NULL; } -static struct tuner_operations tda9887_tuner_ops = { +static struct analog_tuner_ops tda9887_tuner_ops = { .set_tv_freq = tda9887_set_freq, .set_radio_freq = tda9887_set_freq, .standby = tda9887_standby, @@ -636,7 +636,7 @@ int tda9887_tuner_init(struct tuner *t) tda9887_info("tda988[5/6/7] found @ 0x%x (%s)\n", t->i2c.addr, t->i2c.driver->driver.name); - memcpy(&t->ops, &tda9887_tuner_ops, sizeof(struct tuner_operations)); + t->fe.ops.analog_demod_ops = &tda9887_tuner_ops; return 0; } -- cgit v1.2.3 From 16f291684c50497cc92e83f01d354fae187d1f18 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 21 Oct 2007 15:22:25 -0300 Subject: V4L/DVB (6438): tuner: move analog_demod_priv into struct dvb_frontend Signed-off-by: Michael Krufky Reviewed-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index d9bfa812ffe..68b22da7e25 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -512,7 +512,7 @@ static int tda9887_set_config(struct tuner *t, char *buf) static int tda9887_status(struct tuner *t) { - struct tda9887_priv *priv = t->priv; + struct tda9887_priv *priv = t->fe.analog_demod_priv; unsigned char buf[1]; int rc; @@ -525,7 +525,7 @@ static int tda9887_status(struct tuner *t) static void tda9887_configure(struct tuner *t) { - struct tda9887_priv *priv = t->priv; + struct tda9887_priv *priv = t->fe.analog_demod_priv; int rc; memset(priv->data,0,sizeof(priv->data)); @@ -572,13 +572,13 @@ static void tda9887_configure(struct tuner *t) static void tda9887_tuner_status(struct tuner *t) { - struct tda9887_priv *priv = t->priv; + struct tda9887_priv *priv = t->fe.analog_demod_priv; tda9887_info("Data bytes: b=0x%02x c=0x%02x e=0x%02x\n", priv->data[1], priv->data[2], priv->data[3]); } static int tda9887_get_afc(struct tuner *t) { - struct tda9887_priv *priv = t->priv; + struct tda9887_priv *priv = t->fe.analog_demod_priv; static int AFC_BITS_2_kHz[] = { -12500, -37500, -62500, -97500, -112500, -137500, -162500, -187500, @@ -606,8 +606,8 @@ static void tda9887_set_freq(struct tuner *t, unsigned int freq) static void tda9887_release(struct tuner *t) { - kfree(t->priv); - t->priv = NULL; + kfree(t->fe.analog_demod_priv); + t->fe.analog_demod_priv = NULL; } static struct analog_tuner_ops tda9887_tuner_ops = { @@ -626,7 +626,7 @@ int tda9887_tuner_init(struct tuner *t) priv = kzalloc(sizeof(struct tda9887_priv), GFP_KERNEL); if (priv == NULL) return -ENOMEM; - t->priv = priv; + t->fe.analog_demod_priv = priv; priv->i2c_props.addr = t->i2c.addr; priv->i2c_props.adap = t->i2c.adapter; -- cgit v1.2.3 From 4e9154b8a77d0f0f8f06857162823905612a50d7 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 21 Oct 2007 19:39:50 -0300 Subject: V4L/DVB (6440): tuner: convert analog tuner demod sub-modules to dvb_frontend interface Convert tda9887 and tda8290/5 to dvb_frontend interface Signed-off-by: Michael Krufky Reviewed-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 78 ++++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 30 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 68b22da7e25..7663a557975 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -21,17 +21,19 @@ */ #define tda9887_info(fmt, arg...) do {\ - printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.name, \ - i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) + printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c.name, \ + i2c_adapter_id(priv->t->i2c.adapter), priv->t->i2c.addr , ##arg); } while (0) #define tda9887_dbg(fmt, arg...) do {\ if (tuner_debug) \ - printk(KERN_INFO "%s %d-%04x: " fmt, t->i2c.name, \ - i2c_adapter_id(t->i2c.adapter), t->i2c.addr , ##arg); } while (0) + printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c.name, \ + i2c_adapter_id(priv->t->i2c.adapter), priv->t->i2c.addr , ##arg); } while (0) struct tda9887_priv { struct tuner_i2c_props i2c_props; unsigned char data[4]; + + struct tuner *t; }; /* ---------------------------------------------------------------------- */ @@ -262,8 +264,10 @@ static struct tvnorm radio_mono = { /* ---------------------------------------------------------------------- */ -static void dump_read_message(struct tuner *t, unsigned char *buf) +static void dump_read_message(struct dvb_frontend *fe, unsigned char *buf) { + struct tda9887_priv *priv = fe->analog_demod_priv; + static char *afc[16] = { "- 12.5 kHz", "- 37.5 kHz", @@ -290,8 +294,10 @@ static void dump_read_message(struct tuner *t, unsigned char *buf) tda9887_info(" vfi level : %s\n", (buf[0] & 0x80) ? "high" : "low"); } -static void dump_write_message(struct tuner *t, unsigned char *buf) +static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) { + struct tda9887_priv *priv = fe->analog_demod_priv; + static char *sound[4] = { "AM/TV", "FM/radio", @@ -386,9 +392,12 @@ static void dump_write_message(struct tuner *t, unsigned char *buf) /* ---------------------------------------------------------------------- */ -static int tda9887_set_tvnorm(struct tuner *t, char *buf) +static int tda9887_set_tvnorm(struct dvb_frontend *fe) { + struct tda9887_priv *priv = fe->analog_demod_priv; + struct tuner *t = priv->t; struct tvnorm *norm = NULL; + char *buf = priv->data; int i; if (t->mode == V4L2_TUNER_RADIO) { @@ -426,8 +435,11 @@ module_param(port2, int, 0644); module_param(qss, int, 0644); module_param(adjust, int, 0644); -static int tda9887_set_insmod(struct tuner *t, char *buf) +static int tda9887_set_insmod(struct dvb_frontend *fe) { + struct tda9887_priv *priv = fe->analog_demod_priv; + char *buf = priv->data; + if (UNSET != port1) { if (port1) buf[1] |= cOutputPort1Inactive; @@ -455,8 +467,12 @@ static int tda9887_set_insmod(struct tuner *t, char *buf) return 0; } -static int tda9887_set_config(struct tuner *t, char *buf) +static int tda9887_set_config(struct dvb_frontend *fe) { + struct tda9887_priv *priv = fe->analog_demod_priv; + struct tuner *t = priv->t; + char *buf = priv->data; + if (t->tda9887_config & TDA9887_PORT1_ACTIVE) buf[1] &= ~cOutputPort1Inactive; if (t->tda9887_config & TDA9887_PORT1_INACTIVE) @@ -510,26 +526,27 @@ static int tda9887_set_config(struct tuner *t, char *buf) /* ---------------------------------------------------------------------- */ -static int tda9887_status(struct tuner *t) +static int tda9887_status(struct dvb_frontend *fe) { - struct tda9887_priv *priv = t->fe.analog_demod_priv; + struct tda9887_priv *priv = fe->analog_demod_priv; unsigned char buf[1]; int rc; memset(buf,0,sizeof(buf)); if (1 != (rc = tuner_i2c_xfer_recv(&priv->i2c_props,buf,1))) tda9887_info("i2c i/o error: rc == %d (should be 1)\n",rc); - dump_read_message(t, buf); + dump_read_message(fe, buf); return 0; } -static void tda9887_configure(struct tuner *t) +static void tda9887_configure(struct dvb_frontend *fe) { - struct tda9887_priv *priv = t->fe.analog_demod_priv; + struct tda9887_priv *priv = fe->analog_demod_priv; + struct tuner *t = priv->t; int rc; memset(priv->data,0,sizeof(priv->data)); - tda9887_set_tvnorm(t,priv->data); + tda9887_set_tvnorm(fe); /* A note on the port settings: These settings tend to depend on the specifics of the board. @@ -547,8 +564,8 @@ static void tda9887_configure(struct tuner *t) priv->data[1] |= cOutputPort1Inactive; priv->data[1] |= cOutputPort2Inactive; - tda9887_set_config(t,priv->data); - tda9887_set_insmod(t,priv->data); + tda9887_set_config(fe); + tda9887_set_insmod(fe); if (t->mode == T_STANDBY) { priv->data[1] |= cForcedMuteAudioON; @@ -557,28 +574,28 @@ static void tda9887_configure(struct tuner *t) tda9887_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n", priv->data[1],priv->data[2],priv->data[3]); if (tuner_debug > 1) - dump_write_message(t, priv->data); + dump_write_message(fe, priv->data); if (4 != (rc = tuner_i2c_xfer_send(&priv->i2c_props,priv->data,4))) tda9887_info("i2c i/o error: rc == %d (should be 4)\n",rc); if (tuner_debug > 2) { msleep_interruptible(1000); - tda9887_status(t); + tda9887_status(fe); } } /* ---------------------------------------------------------------------- */ -static void tda9887_tuner_status(struct tuner *t) +static void tda9887_tuner_status(struct dvb_frontend *fe) { - struct tda9887_priv *priv = t->fe.analog_demod_priv; + struct tda9887_priv *priv = fe->analog_demod_priv; tda9887_info("Data bytes: b=0x%02x c=0x%02x e=0x%02x\n", priv->data[1], priv->data[2], priv->data[3]); } -static int tda9887_get_afc(struct tuner *t) +static int tda9887_get_afc(struct dvb_frontend *fe) { - struct tda9887_priv *priv = t->fe.analog_demod_priv; + struct tda9887_priv *priv = fe->analog_demod_priv; static int AFC_BITS_2_kHz[] = { -12500, -37500, -62500, -97500, -112500, -137500, -162500, -187500, @@ -594,20 +611,20 @@ static int tda9887_get_afc(struct tuner *t) return afc; } -static void tda9887_standby(struct tuner *t) +static void tda9887_standby(struct dvb_frontend *fe) { - tda9887_configure(t); + tda9887_configure(fe); } -static void tda9887_set_freq(struct tuner *t, unsigned int freq) +static void tda9887_set_freq(struct dvb_frontend *fe, unsigned int freq) { - tda9887_configure(t); + tda9887_configure(fe); } -static void tda9887_release(struct tuner *t) +static void tda9887_release(struct dvb_frontend *fe) { - kfree(t->fe.analog_demod_priv); - t->fe.analog_demod_priv = NULL; + kfree(fe->analog_demod_priv); + fe->analog_demod_priv = NULL; } static struct analog_tuner_ops tda9887_tuner_ops = { @@ -630,6 +647,7 @@ int tda9887_tuner_init(struct tuner *t) priv->i2c_props.addr = t->i2c.addr; priv->i2c_props.adap = t->i2c.adapter; + priv->t = t; strlcpy(t->i2c.name, "tda9887", sizeof(t->i2c.name)); -- cgit v1.2.3 From 31c9584c0b071dfa7a75db6e21cc727f728f97b0 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 21 Oct 2007 20:48:48 -0300 Subject: V4L/DVB (6443): make tda9887 build selectable via Kconfig Signed-off-by: Michael Krufky Reviewed-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 7663a557975..4f5d76ff0b4 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -9,7 +9,7 @@ #include #include #include -#include "tuner-driver.h" +#include "tda9887.h" /* Chips: @@ -20,13 +20,18 @@ Used as part of several tuners */ +static int tda9887_debug; +module_param_named(debug, tda9887_debug, int, 0644); + #define tda9887_info(fmt, arg...) do {\ printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c.name, \ - i2c_adapter_id(priv->t->i2c.adapter), priv->t->i2c.addr , ##arg); } while (0) + i2c_adapter_id(priv->t->i2c.adapter), \ + priv->t->i2c.addr, ##arg); } while (0) #define tda9887_dbg(fmt, arg...) do {\ - if (tuner_debug) \ + if (tda9887_debug) \ printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c.name, \ - i2c_adapter_id(priv->t->i2c.adapter), priv->t->i2c.addr , ##arg); } while (0) + i2c_adapter_id(priv->t->i2c.adapter), \ + priv->t->i2c.addr, ##arg); } while (0) struct tda9887_priv { struct tuner_i2c_props i2c_props; @@ -573,13 +578,13 @@ static void tda9887_configure(struct dvb_frontend *fe) tda9887_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n", priv->data[1],priv->data[2],priv->data[3]); - if (tuner_debug > 1) + if (tda9887_debug > 1) dump_write_message(fe, priv->data); if (4 != (rc = tuner_i2c_xfer_send(&priv->i2c_props,priv->data,4))) tda9887_info("i2c i/o error: rc == %d (should be 4)\n",rc); - if (tuner_debug > 2) { + if (tda9887_debug > 2) { msleep_interruptible(1000); tda9887_status(fe); } @@ -590,7 +595,8 @@ static void tda9887_configure(struct dvb_frontend *fe) static void tda9887_tuner_status(struct dvb_frontend *fe) { struct tda9887_priv *priv = fe->analog_demod_priv; - tda9887_info("Data bytes: b=0x%02x c=0x%02x e=0x%02x\n", priv->data[1], priv->data[2], priv->data[3]); + tda9887_info("Data bytes: b=0x%02x c=0x%02x e=0x%02x\n", + priv->data[1], priv->data[2], priv->data[3]); } static int tda9887_get_afc(struct dvb_frontend *fe) @@ -636,7 +642,7 @@ static struct analog_tuner_ops tda9887_tuner_ops = { .release = tda9887_release, }; -int tda9887_tuner_init(struct tuner *t) +int tda9887_attach(struct tuner *t) { struct tda9887_priv *priv = NULL; @@ -658,6 +664,7 @@ int tda9887_tuner_init(struct tuner *t) return 0; } +EXPORT_SYMBOL_GPL(tda9887_attach); /* * Overrides for Emacs so that we follow Linus's tabbing style. -- cgit v1.2.3 From 5ef4730d1bfe5be71ce54d927c510ad5da968854 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sat, 27 Oct 2007 02:17:19 -0300 Subject: V4L/DVB (6450): tda9887: add missing module license This module was always GPL, and will remain GPL Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 4f5d76ff0b4..080bd308073 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -666,6 +666,8 @@ int tda9887_attach(struct tuner *t) } EXPORT_SYMBOL_GPL(tda9887_attach); +MODULE_LICENSE("GPL"); + /* * Overrides for Emacs so that we follow Linus's tabbing style. * --------------------------------------------------------------------------- -- cgit v1.2.3 From 1cba97d71dca1a3c22b4d7f97893249817036215 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Fri, 14 Sep 2007 05:13:54 -0300 Subject: V4L/DVB (6471): tuner: i2c_client cannot be part of the tuner struct The bus-based I2C subsystem allocates the i2c_client struct. So if in order to be able to convert the tuner to the bus-based I2C API the embedded i2c_client struct must be removed from the tuner struct and replaced with a pointer. Signed-off-by: Hans Verkuil Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 080bd308073..dfa2964d7ef 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -24,14 +24,14 @@ static int tda9887_debug; module_param_named(debug, tda9887_debug, int, 0644); #define tda9887_info(fmt, arg...) do {\ - printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c.name, \ - i2c_adapter_id(priv->t->i2c.adapter), \ - priv->t->i2c.addr, ##arg); } while (0) + printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c->name, \ + i2c_adapter_id(priv->t->i2c->adapter), \ + priv->t->i2c->addr, ##arg); } while (0) #define tda9887_dbg(fmt, arg...) do {\ if (tda9887_debug) \ - printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c.name, \ - i2c_adapter_id(priv->t->i2c.adapter), \ - priv->t->i2c.addr, ##arg); } while (0) + printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c->name, \ + i2c_adapter_id(priv->t->i2c->adapter), \ + priv->t->i2c->addr, ##arg); } while (0) struct tda9887_priv { struct tuner_i2c_props i2c_props; @@ -651,14 +651,14 @@ int tda9887_attach(struct tuner *t) return -ENOMEM; t->fe.analog_demod_priv = priv; - priv->i2c_props.addr = t->i2c.addr; - priv->i2c_props.adap = t->i2c.adapter; + priv->i2c_props.addr = t->i2c->addr; + priv->i2c_props.adap = t->i2c->adapter; priv->t = t; - strlcpy(t->i2c.name, "tda9887", sizeof(t->i2c.name)); + strlcpy(t->i2c->name, "tda9887", sizeof(t->i2c->name)); - tda9887_info("tda988[5/6/7] found @ 0x%x (%s)\n", t->i2c.addr, - t->i2c.driver->driver.name); + tda9887_info("tda988[5/6/7] found @ 0x%x (%s)\n", t->i2c->addr, + t->i2c->driver->driver.name); t->fe.ops.analog_demod_ops = &tda9887_tuner_ops; -- cgit v1.2.3 From c7919d520f4c9a064ae14bc4dd170c4c12ead2af Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sat, 8 Dec 2007 17:06:30 -0300 Subject: V4L/DVB (6783): tuner: combine set_tv_freq and set_radio_freq into a single set_params method We can tell whether we are tuning television or radio by testing for struct analog_parameters *params->mode == V4L2_TUNER_RADIO There is no longer any need for separate set_tv_freq and set_radio_freq functions in the analog tuner demodulator modules. Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index dfa2964d7ef..d506d4bf825 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -622,7 +622,8 @@ static void tda9887_standby(struct dvb_frontend *fe) tda9887_configure(fe); } -static void tda9887_set_freq(struct dvb_frontend *fe, unsigned int freq) +static void tda9887_set_params(struct dvb_frontend *fe, + struct analog_parameters *params) { tda9887_configure(fe); } @@ -634,8 +635,7 @@ static void tda9887_release(struct dvb_frontend *fe) } static struct analog_tuner_ops tda9887_tuner_ops = { - .set_tv_freq = tda9887_set_freq, - .set_radio_freq = tda9887_set_freq, + .set_params = tda9887_set_params, .standby = tda9887_standby, .tuner_status = tda9887_tuner_status, .get_afc = tda9887_get_afc, -- cgit v1.2.3 From ab1660503ac3af7febfcf987648509b484d4feda Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 9 Dec 2007 02:26:48 -0300 Subject: V4L/DVB (6785): tda8290: remove dependency on struct tuner - remove dependency of tda8290 module on struct tuner - move tuner_foo printk macros from tuner-driver.h into tuner-core.c - clean up #includes of tuner-i2c.h / tuner-driver.h Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index d506d4bf825..98d45c4912b 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -9,6 +9,7 @@ #include #include #include +#include "tuner-i2c.h" #include "tda9887.h" -- cgit v1.2.3 From a55db8cd7f8a107f3abcb4c803b1873b2be63663 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 9 Dec 2007 13:52:51 -0300 Subject: V4L/DVB (6786): tuner: add struct analog_demod_info to struct analog_tuner_ops Store the analog demodulator name in fe.ops.analog_demod_ops.info.name Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 98d45c4912b..8a95f097ba2 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -636,6 +636,9 @@ static void tda9887_release(struct dvb_frontend *fe) } static struct analog_tuner_ops tda9887_tuner_ops = { + .info = { + .name = "TDA9887", + }, .set_params = tda9887_set_params, .standby = tda9887_standby, .tuner_status = tda9887_tuner_status, -- cgit v1.2.3 From daae58956bebeab6631ba078669970a27bdfbdbe Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 16 Dec 2007 19:14:31 -0300 Subject: V4L/DVB (6838): tda9887: remove references to struct tuner from printk macros Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 8a95f097ba2..f265c702cde 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -25,14 +25,14 @@ static int tda9887_debug; module_param_named(debug, tda9887_debug, int, 0644); #define tda9887_info(fmt, arg...) do {\ - printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c->name, \ - i2c_adapter_id(priv->t->i2c->adapter), \ - priv->t->i2c->addr, ##arg); } while (0) + printk(KERN_INFO "tda9887 %d-%04x: " fmt, \ + i2c_adapter_id(priv->i2c_props.adap), \ + priv->i2c_props.addr, ##arg); } while (0) #define tda9887_dbg(fmt, arg...) do {\ if (tda9887_debug) \ - printk(KERN_INFO "%s %d-%04x: " fmt, priv->t->i2c->name, \ - i2c_adapter_id(priv->t->i2c->adapter), \ - priv->t->i2c->addr, ##arg); } while (0) + printk(KERN_INFO "tda9887 %d-%04x: " fmt, \ + i2c_adapter_id(priv->i2c_props.adap), \ + priv->i2c_props.addr, ##arg); } while (0) struct tda9887_priv { struct tuner_i2c_props i2c_props; -- cgit v1.2.3 From 710401b837f8849dc9c28385eb5298746b811305 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 16 Dec 2007 19:53:32 -0300 Subject: V4L/DVB (6840): tuner: convert tda9887 to use TUNER_SET_CONFIG Use TUNER_SET_CONFIG to set configuration in tda9887's private state structure, rather than storing tda9887-specific configuration within struct tuner. Update handling of TUNER_SET_CONFIG by tuner-core, to call &t->fe.ops.analog_demod_ops rather than &t->fe.ops.tuner_ops analog_demod_ops.set_config passes the request to tuner_ops.set_config, so this does not break other drivers. Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 47 +++++++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 17 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index f265c702cde..7686f52cfcf 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -38,6 +38,7 @@ struct tda9887_priv { struct tuner_i2c_props i2c_props; unsigned char data[4]; + unsigned int config; struct tuner *t; }; @@ -473,31 +474,31 @@ static int tda9887_set_insmod(struct dvb_frontend *fe) return 0; } -static int tda9887_set_config(struct dvb_frontend *fe) +static int tda9887_do_config(struct dvb_frontend *fe) { struct tda9887_priv *priv = fe->analog_demod_priv; struct tuner *t = priv->t; char *buf = priv->data; - if (t->tda9887_config & TDA9887_PORT1_ACTIVE) + if (priv->config & TDA9887_PORT1_ACTIVE) buf[1] &= ~cOutputPort1Inactive; - if (t->tda9887_config & TDA9887_PORT1_INACTIVE) + if (priv->config & TDA9887_PORT1_INACTIVE) buf[1] |= cOutputPort1Inactive; - if (t->tda9887_config & TDA9887_PORT2_ACTIVE) + if (priv->config & TDA9887_PORT2_ACTIVE) buf[1] &= ~cOutputPort2Inactive; - if (t->tda9887_config & TDA9887_PORT2_INACTIVE) + if (priv->config & TDA9887_PORT2_INACTIVE) buf[1] |= cOutputPort2Inactive; - if (t->tda9887_config & TDA9887_QSS) + if (priv->config & TDA9887_QSS) buf[1] |= cQSS; - if (t->tda9887_config & TDA9887_INTERCARRIER) + if (priv->config & TDA9887_INTERCARRIER) buf[1] &= ~cQSS; - if (t->tda9887_config & TDA9887_AUTOMUTE) + if (priv->config & TDA9887_AUTOMUTE) buf[1] |= cAutoMuteFmActive; - if (t->tda9887_config & TDA9887_DEEMPHASIS_MASK) { + if (priv->config & TDA9887_DEEMPHASIS_MASK) { buf[2] &= ~0x60; - switch (t->tda9887_config & TDA9887_DEEMPHASIS_MASK) { + switch (priv->config & TDA9887_DEEMPHASIS_MASK) { case TDA9887_DEEMPHASIS_NONE: buf[2] |= cDeemphasisOFF; break; @@ -509,21 +510,22 @@ static int tda9887_set_config(struct dvb_frontend *fe) break; } } - if (t->tda9887_config & TDA9887_TOP_SET) { + if (priv->config & TDA9887_TOP_SET) { buf[2] &= ~cTopMask; - buf[2] |= (t->tda9887_config >> 8) & cTopMask; + buf[2] |= (priv->config >> 8) & cTopMask; } - if ((t->tda9887_config & TDA9887_INTERCARRIER_NTSC) && (t->std & V4L2_STD_NTSC)) + if ((priv->config & TDA9887_INTERCARRIER_NTSC) && + (t->std & V4L2_STD_NTSC)) buf[1] &= ~cQSS; - if (t->tda9887_config & TDA9887_GATING_18) + if (priv->config & TDA9887_GATING_18) buf[3] &= ~cGating_36; if (t->mode == V4L2_TUNER_RADIO) { - if (t->tda9887_config & TDA9887_RIF_41_3) { + if (priv->config & TDA9887_RIF_41_3) { buf[3] &= ~cVideoIFMask; buf[3] |= cRadioIF_41_30; } - if (t->tda9887_config & TDA9887_GAIN_NORMAL) + if (priv->config & TDA9887_GAIN_NORMAL) buf[3] &= ~cTunerGainLow; } @@ -570,7 +572,7 @@ static void tda9887_configure(struct dvb_frontend *fe) priv->data[1] |= cOutputPort1Inactive; priv->data[1] |= cOutputPort2Inactive; - tda9887_set_config(fe); + tda9887_do_config(fe); tda9887_set_insmod(fe); if (t->mode == T_STANDBY) { @@ -629,6 +631,16 @@ static void tda9887_set_params(struct dvb_frontend *fe, tda9887_configure(fe); } +static int tda9887_set_config(struct dvb_frontend *fe, void *priv_cfg) +{ + struct tda9887_priv *priv = fe->analog_demod_priv; + + priv->config = *(unsigned int *)priv_cfg; + tda9887_configure(fe); + + return 0; +} + static void tda9887_release(struct dvb_frontend *fe) { kfree(fe->analog_demod_priv); @@ -644,6 +656,7 @@ static struct analog_tuner_ops tda9887_tuner_ops = { .tuner_status = tda9887_tuner_status, .get_afc = tda9887_get_afc, .release = tda9887_release, + .set_config = tda9887_set_config, }; int tda9887_attach(struct tuner *t) -- cgit v1.2.3 From 91c9d4a16710b047781248a38e7000ce9de324af Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 16 Dec 2007 20:05:00 -0300 Subject: V4L/DVB (6841): tda9887: maintain private state independent of struct tuner Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 7686f52cfcf..95d974298fe 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -39,8 +39,9 @@ struct tda9887_priv { unsigned char data[4]; unsigned int config; - - struct tuner *t; + unsigned int mode; + unsigned int audmode; + v4l2_std_id std; }; /* ---------------------------------------------------------------------- */ @@ -402,19 +403,18 @@ static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) static int tda9887_set_tvnorm(struct dvb_frontend *fe) { struct tda9887_priv *priv = fe->analog_demod_priv; - struct tuner *t = priv->t; struct tvnorm *norm = NULL; char *buf = priv->data; int i; - if (t->mode == V4L2_TUNER_RADIO) { - if (t->audmode == V4L2_TUNER_MODE_MONO) + if (priv->mode == V4L2_TUNER_RADIO) { + if (priv->audmode == V4L2_TUNER_MODE_MONO) norm = &radio_mono; else norm = &radio_stereo; } else { for (i = 0; i < ARRAY_SIZE(tvnorms); i++) { - if (tvnorms[i].std & t->std) { + if (tvnorms[i].std & priv->std) { norm = tvnorms+i; break; } @@ -477,7 +477,6 @@ static int tda9887_set_insmod(struct dvb_frontend *fe) static int tda9887_do_config(struct dvb_frontend *fe) { struct tda9887_priv *priv = fe->analog_demod_priv; - struct tuner *t = priv->t; char *buf = priv->data; if (priv->config & TDA9887_PORT1_ACTIVE) @@ -515,12 +514,12 @@ static int tda9887_do_config(struct dvb_frontend *fe) buf[2] |= (priv->config >> 8) & cTopMask; } if ((priv->config & TDA9887_INTERCARRIER_NTSC) && - (t->std & V4L2_STD_NTSC)) + (priv->std & V4L2_STD_NTSC)) buf[1] &= ~cQSS; if (priv->config & TDA9887_GATING_18) buf[3] &= ~cGating_36; - if (t->mode == V4L2_TUNER_RADIO) { + if (priv->mode == V4L2_TUNER_RADIO) { if (priv->config & TDA9887_RIF_41_3) { buf[3] &= ~cVideoIFMask; buf[3] |= cRadioIF_41_30; @@ -550,7 +549,6 @@ static int tda9887_status(struct dvb_frontend *fe) static void tda9887_configure(struct dvb_frontend *fe) { struct tda9887_priv *priv = fe->analog_demod_priv; - struct tuner *t = priv->t; int rc; memset(priv->data,0,sizeof(priv->data)); @@ -575,9 +573,8 @@ static void tda9887_configure(struct dvb_frontend *fe) tda9887_do_config(fe); tda9887_set_insmod(fe); - if (t->mode == T_STANDBY) { + if (priv->mode == T_STANDBY) priv->data[1] |= cForcedMuteAudioON; - } tda9887_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n", priv->data[1],priv->data[2],priv->data[3]); @@ -622,12 +619,21 @@ static int tda9887_get_afc(struct dvb_frontend *fe) static void tda9887_standby(struct dvb_frontend *fe) { + struct tda9887_priv *priv = fe->analog_demod_priv; + + priv->mode = T_STANDBY; + tda9887_configure(fe); } static void tda9887_set_params(struct dvb_frontend *fe, struct analog_parameters *params) { + struct tda9887_priv *priv = fe->analog_demod_priv; + + priv->mode = params->mode; + priv->audmode = params->audmode; + priv->std = params->std; tda9887_configure(fe); } @@ -670,7 +676,6 @@ int tda9887_attach(struct tuner *t) priv->i2c_props.addr = t->i2c->addr; priv->i2c_props.adap = t->i2c->adapter; - priv->t = t; strlcpy(t->i2c->name, "tda9887", sizeof(t->i2c->name)); -- cgit v1.2.3 From 8ca4083b50752d588f8b8b1e5e5776fb17d00304 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 16 Dec 2007 20:11:46 -0300 Subject: V4L/DVB (6842): tda9887: remove dependency on struct tuner Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 95d974298fe..0b5dc37fea5 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -9,6 +9,7 @@ #include #include #include +#include "tuner-driver.h" #include "tuner-i2c.h" #include "tda9887.h" @@ -665,26 +666,25 @@ static struct analog_tuner_ops tda9887_tuner_ops = { .set_config = tda9887_set_config, }; -int tda9887_attach(struct tuner *t) +struct dvb_frontend *tda9887_attach(struct dvb_frontend *fe, + struct i2c_adapter *i2c_adap, + u8 i2c_addr) { struct tda9887_priv *priv = NULL; priv = kzalloc(sizeof(struct tda9887_priv), GFP_KERNEL); if (priv == NULL) - return -ENOMEM; - t->fe.analog_demod_priv = priv; + return NULL; + fe->analog_demod_priv = priv; - priv->i2c_props.addr = t->i2c->addr; - priv->i2c_props.adap = t->i2c->adapter; + priv->i2c_props.addr = i2c_addr; + priv->i2c_props.adap = i2c_adap; - strlcpy(t->i2c->name, "tda9887", sizeof(t->i2c->name)); + tda9887_info("tda988[5/6/7] found\n"); - tda9887_info("tda988[5/6/7] found @ 0x%x (%s)\n", t->i2c->addr, - t->i2c->driver->driver.name); + fe->ops.analog_demod_ops = &tda9887_tuner_ops; - t->fe.ops.analog_demod_ops = &tda9887_tuner_ops; - - return 0; + return fe; } EXPORT_SYMBOL_GPL(tda9887_attach); -- cgit v1.2.3 From 790ba18ec7a5f15c854f52835b0e6f39de2369dd Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 16 Dec 2007 21:20:21 -0300 Subject: V4L/DVB (6843): tda9887: use printk macros from tuner-i2c.h replace tda9887_info and tda9887_dbg printk macros with tuner_info and tuner_dbg, defined in tuner-i2c.h Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 145 ++++++++++++++++++++---------------------- 1 file changed, 70 insertions(+), 75 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 0b5dc37fea5..5085cb90212 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -22,18 +22,11 @@ Used as part of several tuners */ -static int tda9887_debug; -module_param_named(debug, tda9887_debug, int, 0644); - -#define tda9887_info(fmt, arg...) do {\ - printk(KERN_INFO "tda9887 %d-%04x: " fmt, \ - i2c_adapter_id(priv->i2c_props.adap), \ - priv->i2c_props.addr, ##arg); } while (0) -#define tda9887_dbg(fmt, arg...) do {\ - if (tda9887_debug) \ - printk(KERN_INFO "tda9887 %d-%04x: " fmt, \ - i2c_adapter_id(priv->i2c_props.adap), \ - priv->i2c_props.addr, ##arg); } while (0) +static int debug; +module_param(debug, int, 0644); +MODULE_PARM_DESC(debug, "enable verbose debug messages"); + +#define PREFIX "tda9887" struct tda9887_priv { struct tuner_i2c_props i2c_props; @@ -295,12 +288,12 @@ static void dump_read_message(struct dvb_frontend *fe, unsigned char *buf) "+ 37.5 kHz", "+ 12.5 kHz", }; - tda9887_info("read: 0x%2x\n", buf[0]); - tda9887_info(" after power on : %s\n", (buf[0] & 0x01) ? "yes" : "no"); - tda9887_info(" afc : %s\n", afc[(buf[0] >> 1) & 0x0f]); - tda9887_info(" fmif level : %s\n", (buf[0] & 0x20) ? "high" : "low"); - tda9887_info(" afc window : %s\n", (buf[0] & 0x40) ? "in" : "out"); - tda9887_info(" vfi level : %s\n", (buf[0] & 0x80) ? "high" : "low"); + tuner_info("read: 0x%2x\n", buf[0]); + tuner_info(" after power on : %s\n", (buf[0] & 0x01) ? "yes" : "no"); + tuner_info(" afc : %s\n", afc[(buf[0] >> 1) & 0x0f]); + tuner_info(" fmif level : %s\n", (buf[0] & 0x20) ? "high" : "low"); + tuner_info(" afc window : %s\n", (buf[0] & 0x40) ? "in" : "out"); + tuner_info(" vfi level : %s\n", (buf[0] & 0x80) ? "high" : "low"); } static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) @@ -345,58 +338,60 @@ static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) "44 MHz", }; - tda9887_info("write: byte B 0x%02x\n",buf[1]); - tda9887_info(" B0 video mode : %s\n", - (buf[1] & 0x01) ? "video trap" : "sound trap"); - tda9887_info(" B1 auto mute fm : %s\n", - (buf[1] & 0x02) ? "yes" : "no"); - tda9887_info(" B2 carrier mode : %s\n", - (buf[1] & 0x04) ? "QSS" : "Intercarrier"); - tda9887_info(" B3-4 tv sound/radio : %s\n", - sound[(buf[1] & 0x18) >> 3]); - tda9887_info(" B5 force mute audio: %s\n", - (buf[1] & 0x20) ? "yes" : "no"); - tda9887_info(" B6 output port 1 : %s\n", - (buf[1] & 0x40) ? "high (inactive)" : "low (active)"); - tda9887_info(" B7 output port 2 : %s\n", - (buf[1] & 0x80) ? "high (inactive)" : "low (active)"); - - tda9887_info("write: byte C 0x%02x\n",buf[2]); - tda9887_info(" C0-4 top adjustment : %s dB\n", adjust[buf[2] & 0x1f]); - tda9887_info(" C5-6 de-emphasis : %s\n", deemph[(buf[2] & 0x60) >> 5]); - tda9887_info(" C7 audio gain : %s\n", - (buf[2] & 0x80) ? "-6" : "0"); - - tda9887_info("write: byte E 0x%02x\n",buf[3]); - tda9887_info(" E0-1 sound carrier : %s\n", - carrier[(buf[3] & 0x03)]); - tda9887_info(" E6 l pll gating : %s\n", - (buf[3] & 0x40) ? "36" : "13"); + tuner_info("write: byte B 0x%02x\n", buf[1]); + tuner_info(" B0 video mode : %s\n", + (buf[1] & 0x01) ? "video trap" : "sound trap"); + tuner_info(" B1 auto mute fm : %s\n", + (buf[1] & 0x02) ? "yes" : "no"); + tuner_info(" B2 carrier mode : %s\n", + (buf[1] & 0x04) ? "QSS" : "Intercarrier"); + tuner_info(" B3-4 tv sound/radio : %s\n", + sound[(buf[1] & 0x18) >> 3]); + tuner_info(" B5 force mute audio: %s\n", + (buf[1] & 0x20) ? "yes" : "no"); + tuner_info(" B6 output port 1 : %s\n", + (buf[1] & 0x40) ? "high (inactive)" : "low (active)"); + tuner_info(" B7 output port 2 : %s\n", + (buf[1] & 0x80) ? "high (inactive)" : "low (active)"); + + tuner_info("write: byte C 0x%02x\n", buf[2]); + tuner_info(" C0-4 top adjustment : %s dB\n", + adjust[buf[2] & 0x1f]); + tuner_info(" C5-6 de-emphasis : %s\n", + deemph[(buf[2] & 0x60) >> 5]); + tuner_info(" C7 audio gain : %s\n", + (buf[2] & 0x80) ? "-6" : "0"); + + tuner_info("write: byte E 0x%02x\n", buf[3]); + tuner_info(" E0-1 sound carrier : %s\n", + carrier[(buf[3] & 0x03)]); + tuner_info(" E6 l pll gating : %s\n", + (buf[3] & 0x40) ? "36" : "13"); if (buf[1] & 0x08) { /* radio */ - tda9887_info(" E2-4 video if : %s\n", - rif[(buf[3] & 0x0c) >> 2]); - tda9887_info(" E7 vif agc output : %s\n", - (buf[3] & 0x80) - ? ((buf[3] & 0x10) ? "fm-agc radio" : "sif-agc radio") - : "fm radio carrier afc"); + tuner_info(" E2-4 video if : %s\n", + rif[(buf[3] & 0x0c) >> 2]); + tuner_info(" E7 vif agc output : %s\n", + (buf[3] & 0x80) + ? ((buf[3] & 0x10) ? "fm-agc radio" : + "sif-agc radio") + : "fm radio carrier afc"); } else { /* video */ - tda9887_info(" E2-4 video if : %s\n", - vif[(buf[3] & 0x1c) >> 2]); - tda9887_info(" E5 tuner gain : %s\n", - (buf[3] & 0x80) - ? ((buf[3] & 0x20) ? "external" : "normal") - : ((buf[3] & 0x20) ? "minimum" : "normal")); - tda9887_info(" E7 vif agc output : %s\n", - (buf[3] & 0x80) - ? ((buf[3] & 0x20) - ? "pin3 port, pin22 vif agc out" - : "pin22 port, pin3 vif acg ext in") - : "pin3+pin22 port"); + tuner_info(" E2-4 video if : %s\n", + vif[(buf[3] & 0x1c) >> 2]); + tuner_info(" E5 tuner gain : %s\n", + (buf[3] & 0x80) + ? ((buf[3] & 0x20) ? "external" : "normal") + : ((buf[3] & 0x20) ? "minimum" : "normal")); + tuner_info(" E7 vif agc output : %s\n", + (buf[3] & 0x80) ? ((buf[3] & 0x20) + ? "pin3 port, pin22 vif agc out" + : "pin22 port, pin3 vif acg ext in") + : "pin3+pin22 port"); } - tda9887_info("--\n"); + tuner_info("--\n"); } /* ---------------------------------------------------------------------- */ @@ -422,11 +417,11 @@ static int tda9887_set_tvnorm(struct dvb_frontend *fe) } } if (NULL == norm) { - tda9887_dbg("Unsupported tvnorm entry - audio muted\n"); + tuner_dbg("Unsupported tvnorm entry - audio muted\n"); return -1; } - tda9887_dbg("configure for: %s\n",norm->name); + tuner_dbg("configure for: %s\n", norm->name); buf[1] = norm->b; buf[2] = norm->c; buf[3] = norm->e; @@ -542,7 +537,7 @@ static int tda9887_status(struct dvb_frontend *fe) memset(buf,0,sizeof(buf)); if (1 != (rc = tuner_i2c_xfer_recv(&priv->i2c_props,buf,1))) - tda9887_info("i2c i/o error: rc == %d (should be 1)\n",rc); + tuner_info("i2c i/o error: rc == %d (should be 1)\n", rc); dump_read_message(fe, buf); return 0; } @@ -577,15 +572,15 @@ static void tda9887_configure(struct dvb_frontend *fe) if (priv->mode == T_STANDBY) priv->data[1] |= cForcedMuteAudioON; - tda9887_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n", - priv->data[1],priv->data[2],priv->data[3]); - if (tda9887_debug > 1) + tuner_dbg("writing: b=0x%02x c=0x%02x e=0x%02x\n", + priv->data[1], priv->data[2], priv->data[3]); + if (debug > 1) dump_write_message(fe, priv->data); if (4 != (rc = tuner_i2c_xfer_send(&priv->i2c_props,priv->data,4))) - tda9887_info("i2c i/o error: rc == %d (should be 4)\n",rc); + tuner_info("i2c i/o error: rc == %d (should be 4)\n", rc); - if (tda9887_debug > 2) { + if (debug > 2) { msleep_interruptible(1000); tda9887_status(fe); } @@ -596,8 +591,8 @@ static void tda9887_configure(struct dvb_frontend *fe) static void tda9887_tuner_status(struct dvb_frontend *fe) { struct tda9887_priv *priv = fe->analog_demod_priv; - tda9887_info("Data bytes: b=0x%02x c=0x%02x e=0x%02x\n", - priv->data[1], priv->data[2], priv->data[3]); + tuner_info("Data bytes: b=0x%02x c=0x%02x e=0x%02x\n", + priv->data[1], priv->data[2], priv->data[3]); } static int tda9887_get_afc(struct dvb_frontend *fe) @@ -680,7 +675,7 @@ struct dvb_frontend *tda9887_attach(struct dvb_frontend *fe, priv->i2c_props.addr = i2c_addr; priv->i2c_props.adap = i2c_adap; - tda9887_info("tda988[5/6/7] found\n"); + tuner_info("tda988[5/6/7] found\n"); fe->ops.analog_demod_ops = &tda9887_tuner_ops; -- cgit v1.2.3 From 71021d2601c54eee6df3afaf79aed430b17e1366 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Mon, 17 Dec 2007 09:49:33 -0300 Subject: V4L/DVB (6846): tda9887: initialize mode to T_STANDBY at startup Ensure that the audio is muted at attach-time Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 5085cb90212..2abb76fba9a 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -674,6 +674,7 @@ struct dvb_frontend *tda9887_attach(struct dvb_frontend *fe, priv->i2c_props.addr = i2c_addr; priv->i2c_props.adap = i2c_adap; + priv->mode = T_STANDBY; tuner_info("tda988[5/6/7] found\n"); -- cgit v1.2.3 From 9ad89f0104314786138d580ab2c1119e7e470f56 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Fri, 21 Dec 2007 03:00:59 -0300 Subject: V4L/DVB (6880): kill tuner-driver.h Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 2abb76fba9a..1b017d52bfb 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -9,7 +9,6 @@ #include #include #include -#include "tuner-driver.h" #include "tuner-i2c.h" #include "tda9887.h" -- cgit v1.2.3 From bc3e5c7fc20d3c09667067878fb7a55dd9fc041d Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Fri, 21 Dec 2007 11:18:32 -0300 Subject: V4L/DVB (6881): include struct analog_demod_ops directly inside struct dvb_frontend Rather than using a pointer, include struct analog_demod_ops directly inside struct dvb_frontend. This will allow us to use dvb_attach in the future, along with removing the need to check the ops structure before having to check the pointer to the method being called. Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 1b017d52bfb..d3aabe2d146 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -648,7 +648,7 @@ static void tda9887_release(struct dvb_frontend *fe) fe->analog_demod_priv = NULL; } -static struct analog_tuner_ops tda9887_tuner_ops = { +static struct analog_demod_ops tda9887_ops = { .info = { .name = "TDA9887", }, @@ -677,7 +677,8 @@ struct dvb_frontend *tda9887_attach(struct dvb_frontend *fe, tuner_info("tda988[5/6/7] found\n"); - fe->ops.analog_demod_ops = &tda9887_tuner_ops; + memcpy(&fe->ops.analog_ops, &tda9887_ops, + sizeof(struct analog_demod_ops)); return fe; } -- cgit v1.2.3 From 0f2ce9834246519e483e89dbc7225fe1fcbd30a8 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Mon, 21 Jan 2008 10:55:37 -0300 Subject: V4L/DVB (7055): make tuner names consistent with standard cases Change TDA9887 to tda9887. TDA8290 shall reflect the actual hardware present in its name, ie: tda8295+18271 tda8290+8275a Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tda9887.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/video/tda9887.c') diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index d3aabe2d146..106c93b8203 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c @@ -650,7 +650,7 @@ static void tda9887_release(struct dvb_frontend *fe) static struct analog_demod_ops tda9887_ops = { .info = { - .name = "TDA9887", + .name = "tda9887", }, .set_params = tda9887_set_params, .standby = tda9887_standby, -- cgit v1.2.3