From 1d719209c8c32289d4c7d19837aa30743aac8a83 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Thu, 6 Dec 2007 23:40:36 -0500 Subject: cx23885: enable EZ-QAM mode for Hauppauge WinTV HVR-1800 From: Michael Krufky Add module option 'alt_tuner' disabled by default. When set to one, the dvb_frontend of HVR1800 will consist of: s5h1409 demod + tda18271 tuner When set zero (default), the dvb_frontend of HVR1800 will consist of: s5h1409 demod + mt2131 tuner note: The tda18271 is usually used for analog tuning on this board. If the tda18271 is used in digital mode, you will not be able to tune an analog channel at the same time. Signed-off-by: Michael Krufky --- linux/drivers/media/video/cx23885/cx23885-cards.c | 3 +- linux/drivers/media/video/cx23885/cx23885-dvb.c | 47 ++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/video/cx23885/cx23885-cards.c b/linux/drivers/media/video/cx23885/cx23885-cards.c index 2e117df9e..6b3f4e095 100644 --- a/linux/drivers/media/video/cx23885/cx23885-cards.c +++ b/linux/drivers/media/video/cx23885/cx23885-cards.c @@ -228,7 +228,8 @@ void cx23885_gpio_setup(struct cx23885_dev *dev) /* GPIO-11-14 cx23417 addr0-3 */ /* GPIO-15-18 cx23417 READY, CS, RD, WR */ /* GPIO-19 IR_RX */ - // FIXME: Analog requires the tuner is brought out of reset + + cx_set(GP0_IO, 0x00040004); /* Bring the tuner out of reset */ break; } } diff --git a/linux/drivers/media/video/cx23885/cx23885-dvb.c b/linux/drivers/media/video/cx23885/cx23885-dvb.c index b374ba4d2..2a7e31520 100644 --- a/linux/drivers/media/video/cx23885/cx23885-dvb.c +++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c @@ -33,6 +33,7 @@ #include "s5h1409.h" #include "mt2131.h" +#include "tda8290.h" #include "lgdt330x.h" #include "xc5000.h" #include "dvb-pll.h" @@ -44,6 +45,12 @@ static unsigned int debug = 0; /* ------------------------------------------------------------------ */ +static unsigned int alt_tuner; +module_param(alt_tuner, int, 0644); +MODULE_PARM_DESC(alt_tuner, "Enable alternate tuner configuration"); + +/* ------------------------------------------------------------------ */ + static int dvb_buf_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size) { @@ -118,6 +125,15 @@ static struct s5h1409_config hauppauge_generic_config = { .status_mode = S5H1409_DEMODLOCKING }; +static struct s5h1409_config hauppauge_ezqam_config = { + .demod_address = 0x32 >> 1, + .output_mode = S5H1409_SERIAL_OUTPUT, + .gpio = S5H1409_GPIO_OFF, + .qam_if = 4000, + .inversion = S5H1409_INVERSION_ON, + .status_mode = S5H1409_DEMODLOCKING +}; + static struct s5h1409_config hauppauge_hvr1800lp_config = { .demod_address = 0x32 >> 1, .output_mode = S5H1409_SERIAL_OUTPUT, @@ -164,7 +180,6 @@ static int dvb_register(struct cx23885_tsport *port) /* init frontend */ switch (dev->board) { case CX23885_BOARD_HAUPPAUGE_HVR1250: - case CX23885_BOARD_HAUPPAUGE_HVR1800: i2c_bus = &dev->i2c_bus[0]; port->dvb.frontend = dvb_attach(s5h1409_attach, &hauppauge_generic_config, @@ -175,6 +190,33 @@ static int dvb_register(struct cx23885_tsport *port) &hauppauge_generic_tunerconfig, 0); } break; + case CX23885_BOARD_HAUPPAUGE_HVR1800: + i2c_bus = &dev->i2c_bus[0]; + switch (alt_tuner) { + case 1: + port->dvb.frontend = + dvb_attach(s5h1409_attach, + &hauppauge_ezqam_config, + &i2c_bus->i2c_adap); + if (port->dvb.frontend != NULL) { + dvb_attach(tda829x_attach, port->dvb.frontend, + &dev->i2c_bus[1].i2c_adap, 0x42, + NULL); + } + break; + case 0: + default: + port->dvb.frontend = + dvb_attach(s5h1409_attach, + &hauppauge_generic_config, + &i2c_bus->i2c_adap); + if (port->dvb.frontend != NULL) + dvb_attach(mt2131_attach, port->dvb.frontend, + &i2c_bus->i2c_adap, + &hauppauge_generic_tunerconfig, 0); + break; + } + break; case CX23885_BOARD_HAUPPAUGE_HVR1800lp: i2c_bus = &dev->i2c_bus[0]; port->dvb.frontend = dvb_attach(s5h1409_attach, @@ -220,6 +262,9 @@ static int dvb_register(struct cx23885_tsport *port) /* Put the analog decoder in standby to keep it quiet */ cx23885_call_i2c_clients(i2c_bus, TUNER_SET_STANDBY, NULL); + if (port->dvb.frontend->ops.analog_ops.standby) + port->dvb.frontend->ops.analog_ops.standby(port->dvb.frontend); + /* register everything */ return videobuf_dvb_register(&port->dvb, THIS_MODULE, port, &dev->pci->dev); -- cgit v1.2.3 From 38eff7b03f978bc47395c3418faf0692e8278fb5 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sat, 22 Dec 2007 15:56:25 -0500 Subject: Kconfig: VIDEO_CX23885 selects TUNER_TDA8290 and DVB_TDA18271 From: Michael Krufky Signed-off-by: Michael Krufky --- linux/drivers/media/video/cx23885/Kconfig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux') diff --git a/linux/drivers/media/video/cx23885/Kconfig b/linux/drivers/media/video/cx23885/Kconfig index 081ee6e15..3ce1cdde5 100644 --- a/linux/drivers/media/video/cx23885/Kconfig +++ b/linux/drivers/media/video/cx23885/Kconfig @@ -12,6 +12,8 @@ config VIDEO_CX23885 select DVB_S5H1409 if !DVB_FE_CUSTOMISE select DVB_LGDT330X if !DVB_FE_CUSTOMISE select DVB_PLL if !DVB_FE_CUSTOMISE + select TUNER_TDA8290 if !DVB_FE_CUSTOMIZE + select DVB_TDA18271 if !DVB_FE_CUSTOMIZE ---help--- This is a video4linux driver for Conexant 23885 based TV cards. -- cgit v1.2.3