diff options
author | Steven Toth <stoth@hauppauge.com> | 2007-12-17 23:57:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:04:12 -0500 |
commit | d1987d55a1eda774dfbab240a432607c17241d07 (patch) | |
tree | 7b45520cfd2496d15c47b1bac641c42c1964c9aa /drivers/media/video/cx23885/cx23885-dvb.c | |
parent | aacb9d31ee65c0685745ca4dfc7cdd24f8b7d92b (diff) |
V4L/DVB (6885): Add support for the Hauppauge HVR1500Q
The express card ATSC/QAM tuner.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx23885/cx23885-dvb.c')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-dvb.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index 96d732098a0d..5fa65ef08bfd 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "s5h1409.h" | 33 | #include "s5h1409.h" |
34 | #include "mt2131.h" | 34 | #include "mt2131.h" |
35 | #include "lgdt330x.h" | 35 | #include "lgdt330x.h" |
36 | #include "xc5000.h" | ||
36 | #include "dvb-pll.h" | 37 | #include "dvb-pll.h" |
37 | 38 | ||
38 | static unsigned int debug = 0; | 39 | static unsigned int debug = 0; |
@@ -74,6 +75,32 @@ static void dvb_buf_release(struct videobuf_queue *q, | |||
74 | cx23885_free_buffer(q, (struct cx23885_buffer*)vb); | 75 | cx23885_free_buffer(q, (struct cx23885_buffer*)vb); |
75 | } | 76 | } |
76 | 77 | ||
78 | static int cx23885_request_firmware(struct dvb_frontend *fe, | ||
79 | const struct firmware **fw, char *name) | ||
80 | { | ||
81 | struct cx23885_tsport *port = fe->dvb->priv; | ||
82 | struct cx23885_dev *dev = port->dev; | ||
83 | |||
84 | dprintk(1, "%s(?,?,%s)\n", __FUNCTION__, name); | ||
85 | |||
86 | return request_firmware(fw, name, &dev->pci->dev); | ||
87 | } | ||
88 | |||
89 | static int hauppauge_hvr1500q_tuner_reset(struct dvb_frontend *fe) | ||
90 | { | ||
91 | struct cx23885_tsport *port = fe->dvb->priv; | ||
92 | struct cx23885_dev *dev = port->dev; | ||
93 | |||
94 | dprintk(1, "%s()\n", __FUNCTION__); | ||
95 | |||
96 | /* Drive the tuner into reset back back */ | ||
97 | cx_clear(GP0_IO, 0x00000004); | ||
98 | mdelay(200); | ||
99 | cx_set(GP0_IO, 0x00000004); | ||
100 | |||
101 | return 0; | ||
102 | } | ||
103 | |||
77 | static struct videobuf_queue_ops dvb_qops = { | 104 | static struct videobuf_queue_ops dvb_qops = { |
78 | .buf_setup = dvb_buf_setup, | 105 | .buf_setup = dvb_buf_setup, |
79 | .buf_prepare = dvb_buf_prepare, | 106 | .buf_prepare = dvb_buf_prepare, |
@@ -109,6 +136,22 @@ static struct lgdt330x_config fusionhdtv_5_express = { | |||
109 | .serial_mpeg = 0x40, | 136 | .serial_mpeg = 0x40, |
110 | }; | 137 | }; |
111 | 138 | ||
139 | static struct s5h1409_config hauppauge_hvr1500q_config = { | ||
140 | .demod_address = 0x32 >> 1, | ||
141 | .output_mode = S5H1409_SERIAL_OUTPUT, | ||
142 | .gpio = S5H1409_GPIO_ON, | ||
143 | .qam_if = 44000, | ||
144 | .inversion = S5H1409_INVERSION_OFF, | ||
145 | .status_mode = S5H1409_DEMODLOCKING | ||
146 | }; | ||
147 | |||
148 | static struct xc5000_config hauppauge_hvr1500q_tunerconfig = { | ||
149 | .i2c_address = 0x61, | ||
150 | .if_frequency = 4570000, | ||
151 | .request_firmware = cx23885_request_firmware, | ||
152 | .tuner_reset = hauppauge_hvr1500q_tuner_reset | ||
153 | }; | ||
154 | |||
112 | static int dvb_register(struct cx23885_tsport *port) | 155 | static int dvb_register(struct cx23885_tsport *port) |
113 | { | 156 | { |
114 | struct cx23885_dev *dev = port->dev; | 157 | struct cx23885_dev *dev = port->dev; |
@@ -152,6 +195,17 @@ static int dvb_register(struct cx23885_tsport *port) | |||
152 | &i2c_bus->i2c_adap, DVB_PLL_LG_TDVS_H06XF); | 195 | &i2c_bus->i2c_adap, DVB_PLL_LG_TDVS_H06XF); |
153 | } | 196 | } |
154 | break; | 197 | break; |
198 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: | ||
199 | i2c_bus = &dev->i2c_bus[1]; | ||
200 | port->dvb.frontend = dvb_attach(s5h1409_attach, | ||
201 | &hauppauge_hvr1500q_config, | ||
202 | &dev->i2c_bus[0].i2c_adap); | ||
203 | if (port->dvb.frontend != NULL) { | ||
204 | dvb_attach(xc5000_attach, port->dvb.frontend, | ||
205 | &i2c_bus->i2c_adap, | ||
206 | &hauppauge_hvr1500q_tunerconfig); | ||
207 | } | ||
208 | break; | ||
155 | default: | 209 | default: |
156 | printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", | 210 | printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", |
157 | dev->name); | 211 | dev->name); |