From bca4a97d09ff711e1a2c29263821215c9c285a08 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 1 Jul 2007 17:22:00 -0400 Subject: TUNER_TEA5761 kconfig fixes From: Adrian Bunk The following doesn't make much sense: drivers/media/video/Kconfig: ... config TUNER_TEA5761 tristate "TEA 5761 radio tuner (EXPERIMENTAL)" ... drivers/media/video/Makefile: ... ifneq ($(CONFIG_TUNER_TEA5761),) tuner-objs += tea5761.o endif ... With this setup, TUNER_TEA5761=m is equivalent to TUNER_TEA5761=y. This patch therefore changes TUNER_TEA5761 to a bool. The missing dependency on EXPERIMENTAL the prompt text indicates also gets added by this patch. Additionally, the Makefile entry can now be written in a more compact way. Signed-off-by: Adrian Bunk Signed-off-by: Michael Krufky --- linux/drivers/media/video/Kconfig | 3 ++- linux/drivers/media/video/Makefile | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/linux/drivers/media/video/Kconfig b/linux/drivers/media/video/Kconfig index e88d5d7de..bec790faf 100644 --- a/linux/drivers/media/video/Kconfig +++ b/linux/drivers/media/video/Kconfig @@ -490,7 +490,8 @@ config TUNER_3036 If in doubt, say N. config TUNER_TEA5761 - tristate "TEA 5761 radio tuner (EXPERIMENTAL)" + bool "TEA 5761 radio tuner (EXPERIMENTAL)" + depends on EXPERIMENTAL depends on I2C select VIDEO_TUNER help diff --git a/linux/drivers/media/video/Makefile b/linux/drivers/media/video/Makefile index 4cddc8cbd..10b4d4469 100644 --- a/linux/drivers/media/video/Makefile +++ b/linux/drivers/media/video/Makefile @@ -7,9 +7,7 @@ zr36067-objs := zoran_procfs.o zoran_device.o \ tuner-objs := tuner-core.o tuner-types.o tuner-simple.o \ mt20xx.o tda8290.o tea5767.o tda9887.o -ifneq ($(CONFIG_TUNER_TEA5761),) - tuner-objs += tea5761.o -endif +tuner-$(CONFIG_TUNER_TEA5761) += tea5761.o msp3400-objs := msp3400-driver.o msp3400-kthreads.o -- cgit v1.2.3 From c7ed5e9914aab6d2bc87533da499d493721e6b9e Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 1 Jul 2007 17:24:33 -0400 Subject: unexport dvb_pll_configure From: Adrian Bunk Now that it's static, it should no longer be exported to modules... Signed-off-by: Adrian Bunk Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/frontends/dvb-pll.c | 1 - 1 file changed, 1 deletion(-) diff --git a/linux/drivers/media/dvb/frontends/dvb-pll.c b/linux/drivers/media/dvb/frontends/dvb-pll.c index f3d500eb5..0c0b94767 100644 --- a/linux/drivers/media/dvb/frontends/dvb-pll.c +++ b/linux/drivers/media/dvb/frontends/dvb-pll.c @@ -606,7 +606,6 @@ static int dvb_pll_configure(struct dvb_pll_desc *desc, u8 *buf, // calculate the frequency we set it to return (div * desc->entries[i].stepsize) - desc->iffreq; } -EXPORT_SYMBOL(dvb_pll_configure); static int dvb_pll_release(struct dvb_frontend *fe) { -- cgit v1.2.3 From f388b214feedc1a8e2013852cc707f17e89fe966 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 1 Jul 2007 17:37:51 -0400 Subject: cx88: i2c structure templates clean-up From: Jean Delvare Clean up the use of structure templates in cx88-i2c and cx88-vp3054-i2c. For one thing, a real template is supposed to be read-only. And in some cases it's more efficient to initialize the few fields we need individually. This clean-up shrinks cx88-i2c.o by 33% and cx88-vp3054-i2c.o by 49% (x86_64). Signed-off-by: Jean Delvare Signed-off-by: Michael Krufky --- linux/drivers/media/video/cx88/cx88-i2c.c | 29 ++++++++---------------- linux/drivers/media/video/cx88/cx88-vp3054-i2c.c | 16 ++++--------- 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/linux/drivers/media/video/cx88/cx88-i2c.c b/linux/drivers/media/video/cx88/cx88-i2c.c index 30fd0776a..fedb4c9dd 100644 --- a/linux/drivers/media/video/cx88/cx88-i2c.c +++ b/linux/drivers/media/video/cx88/cx88-i2c.c @@ -169,7 +169,7 @@ void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg) i2c_clients_command(&core->i2c_adap, cmd, arg); } -static struct i2c_algo_bit_data cx8800_i2c_algo_template = { +static const struct i2c_algo_bit_data cx8800_i2c_algo_template = { .setsda = cx8800_bit_setsda, .setscl = cx8800_bit_setscl, .getsda = cx8800_bit_getsda, @@ -180,20 +180,6 @@ 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, -}; - -static struct i2c_client cx8800_i2c_client_template = { - .name = "cx88xx internal", -}; - static char *i2c_devs[128] = { [ 0x1c >> 1 ] = "lgdt330x", [ 0x86 >> 1 ] = "tda9887/cx22702", @@ -223,14 +209,9 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) /* Prevents usage of invalid delay values */ if (i2c_udelay<5) i2c_udelay=5; - cx8800_i2c_algo_template.udelay=i2c_udelay; - memcpy(&core->i2c_adap, &cx8800_i2c_adap_template, - sizeof(core->i2c_adap)); memcpy(&core->i2c_algo, &cx8800_i2c_algo_template, sizeof(core->i2c_algo)); - memcpy(&core->i2c_client, &cx8800_i2c_client_template, - sizeof(core->i2c_client)); #ifdef I2C_CLASS_TV_ANALOG if (core->tuner_type != TUNER_ABSENT) @@ -245,10 +226,18 @@ int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) core->i2c_adap.dev.parent = &pci->dev; #endif strlcpy(core->i2c_adap.name,core->name,sizeof(core->i2c_adap.name)); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + core->i2c_adap.owner = THIS_MODULE; +#endif + core->i2c_adap.id = I2C_HW_B_CX2388x; + core->i2c_adap.client_register = attach_inform; + core->i2c_adap.client_unregister = detach_inform; + core->i2c_algo.udelay = i2c_udelay; core->i2c_algo.data = core; i2c_set_adapdata(&core->i2c_adap,core); core->i2c_adap.algo_data = &core->i2c_algo; core->i2c_client.adapter = &core->i2c_adap; + strlcpy(core->i2c_client.name, "cx88xx internal", I2C_NAME_SIZE); cx8800_bit_setscl(core,1); cx8800_bit_setsda(core,1); diff --git a/linux/drivers/media/video/cx88/cx88-vp3054-i2c.c b/linux/drivers/media/video/cx88/cx88-vp3054-i2c.c index dc97f4686..47b3b3d28 100644 --- a/linux/drivers/media/video/cx88/cx88-vp3054-i2c.c +++ b/linux/drivers/media/video/cx88/cx88-vp3054-i2c.c @@ -98,7 +98,7 @@ static int vp3054_bit_getsda(void *data) /* ----------------------------------------------------------------------- */ -static struct i2c_algo_bit_data vp3054_i2c_algo_template = { +static const struct i2c_algo_bit_data vp3054_i2c_algo_template = { .setsda = vp3054_bit_setsda, .setscl = vp3054_bit_setscl, .getsda = vp3054_bit_getsda, @@ -109,14 +109,6 @@ static struct i2c_algo_bit_data vp3054_i2c_algo_template = { /* ----------------------------------------------------------------------- */ -static struct i2c_adapter vp3054_i2c_adap_template = { - .name = "cx2388x", -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - .owner = THIS_MODULE, -#endif - .id = I2C_HW_B_CX2388x, -}; - int vp3054_i2c_probe(struct cx8802_dev *dev) { struct cx88_core *core = dev->core; @@ -131,8 +123,6 @@ int vp3054_i2c_probe(struct cx8802_dev *dev) return -ENOMEM; vp3054_i2c = dev->card_priv; - memcpy(&vp3054_i2c->adap, &vp3054_i2c_adap_template, - sizeof(vp3054_i2c->adap)); memcpy(&vp3054_i2c->algo, &vp3054_i2c_algo_template, sizeof(vp3054_i2c->algo)); @@ -145,6 +135,10 @@ int vp3054_i2c_probe(struct cx8802_dev *dev) #endif strlcpy(vp3054_i2c->adap.name, core->name, sizeof(vp3054_i2c->adap.name)); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + vp3054_i2c->adap.owner = THIS_MODULE; +#endif + vp3054_i2c->adap.id = I2C_HW_B_CX2388x; vp3054_i2c->algo.data = dev; i2c_set_adapdata(&vp3054_i2c->adap, dev); vp3054_i2c->adap.algo_data = &vp3054_i2c->algo; -- cgit v1.2.3 From 8a50e9a266bb50a040473fe27c579175b8251b5f Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Mon, 21 May 2007 13:56:17 -0400 Subject: cx88-blackbird: fix vidioc_g_tuner never ending list of tuners From: Jelle Foks v4l-info and other programs would loop indefinitely while querying the tuners for cx88-blackbird cards. The cause was that vidioc_g_tuner didn't return an error value for qctrl->id != 0, making the application think there is a never ending list of tuners... This patch adds the same index check as done in vidioc_g_tuner() in cx88-video. Signed-off-by: Jelle Foks Signed-off-by: Michael Krufky --- linux/drivers/media/video/cx88/cx88-blackbird.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c index 9103d9567..97e207d56 100644 --- a/linux/drivers/media/video/cx88/cx88-blackbird.c +++ b/linux/drivers/media/video/cx88/cx88-blackbird.c @@ -1057,6 +1057,8 @@ static int vidioc_g_tuner (struct file *file, void *priv, if (unlikely(UNSET == core->tuner_type)) return -EINVAL; + if (0 != t->index) + return -EINVAL; strcpy(t->name, "Television"); t->type = V4L2_TUNER_ANALOG_TV; -- cgit v1.2.3