diff options
author | Steven Toth <stoth@hauppauge.com> | 2008-01-05 14:55:45 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:05:06 -0500 |
commit | 8c70017f5793e68ea48085a65008d713c9a85dde (patch) | |
tree | c8092f3425d9dbe1be78a19389ebd5e3fac6d6ac /drivers/media | |
parent | 60464da8b1ed8d7c19563f58cadb0ca990448a36 (diff) |
V4L/DVB (7044): XC5000: Fix support for HVR1500Q broken by patch 1
From Zhang: This patch fixes support for the HVR1500Q which was broken
when the xc5000 analog patch was added.
Patch committed as-is, cleanups to follows .... Steve
Signed-off-by: Chaogui Zhang <czhang1974@gmail.com>
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-cards.c | 28 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-dvb.c | 35 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885.h | 1 |
3 files changed, 36 insertions, 28 deletions
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index c2d5a4d7228..ee3f1b09914 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
@@ -244,6 +244,34 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) | |||
244 | dev->name, tv.model); | 244 | dev->name, tv.model); |
245 | } | 245 | } |
246 | 246 | ||
247 | /* Tuner callback function for cx23885 boards. Currently only needed | ||
248 | * for HVR1500Q, which has an xc5000 tuner. | ||
249 | */ | ||
250 | int cx23885_tuner_callback(void *i2c_bus, int command, int arg) | ||
251 | { | ||
252 | struct cx23885_i2c *bus = i2c_bus; | ||
253 | struct cx23885_dev *dev = bus->dev; | ||
254 | |||
255 | switch(dev->board) { | ||
256 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: | ||
257 | if(command == 0) { /* Tuner Reset Command from xc5000 */ | ||
258 | /* Drive the tuner into reset and out */ | ||
259 | cx_clear(GP0_IO, 0x00000004); | ||
260 | mdelay(200); | ||
261 | cx_set(GP0_IO, 0x00000004); | ||
262 | return 0; | ||
263 | } | ||
264 | else { | ||
265 | printk(KERN_ERR | ||
266 | "%s(): Unknow command.\n", __FUNCTION__); | ||
267 | return -EINVAL; | ||
268 | } | ||
269 | break; | ||
270 | } | ||
271 | |||
272 | return 0; /* Should never be here */ | ||
273 | } | ||
274 | EXPORT_SYMBOL(cx23885_tuner_callback); | ||
247 | void cx23885_gpio_setup(struct cx23885_dev *dev) | 275 | void cx23885_gpio_setup(struct cx23885_dev *dev) |
248 | { | 276 | { |
249 | switch(dev->board) { | 277 | switch(dev->board) { |
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index 21937d5cbb1..61d75d04db8 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -87,32 +87,6 @@ static void dvb_buf_release(struct videobuf_queue *q, | |||
87 | cx23885_free_buffer(q, (struct cx23885_buffer*)vb); | 87 | cx23885_free_buffer(q, (struct cx23885_buffer*)vb); |
88 | } | 88 | } |
89 | 89 | ||
90 | static int cx23885_request_firmware(struct dvb_frontend *fe, | ||
91 | const struct firmware **fw, char *name) | ||
92 | { | ||
93 | struct cx23885_tsport *port = fe->dvb->priv; | ||
94 | struct cx23885_dev *dev = port->dev; | ||
95 | |||
96 | dprintk(1, "%s(?,?,%s)\n", __FUNCTION__, name); | ||
97 | |||
98 | return request_firmware(fw, name, &dev->pci->dev); | ||
99 | } | ||
100 | |||
101 | static int hauppauge_hvr1500q_tuner_reset(struct dvb_frontend *fe) | ||
102 | { | ||
103 | struct cx23885_tsport *port = fe->dvb->priv; | ||
104 | struct cx23885_dev *dev = port->dev; | ||
105 | |||
106 | dprintk(1, "%s()\n", __FUNCTION__); | ||
107 | |||
108 | /* Drive the tuner into reset back back */ | ||
109 | cx_clear(GP0_IO, 0x00000004); | ||
110 | mdelay(200); | ||
111 | cx_set(GP0_IO, 0x00000004); | ||
112 | |||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | static struct videobuf_queue_ops dvb_qops = { | 90 | static struct videobuf_queue_ops dvb_qops = { |
117 | .buf_setup = dvb_buf_setup, | 91 | .buf_setup = dvb_buf_setup, |
118 | .buf_prepare = dvb_buf_prepare, | 92 | .buf_prepare = dvb_buf_prepare, |
@@ -182,8 +156,8 @@ static struct s5h1409_config hauppauge_hvr1500q_config = { | |||
182 | static struct xc5000_config hauppauge_hvr1500q_tunerconfig = { | 156 | static struct xc5000_config hauppauge_hvr1500q_tunerconfig = { |
183 | .i2c_address = 0x61, | 157 | .i2c_address = 0x61, |
184 | .if_khz = 5380, | 158 | .if_khz = 5380, |
185 | .request_firmware = cx23885_request_firmware, | 159 | /* cannot set .video_dev here, do it before attach. */ |
186 | .tuner_reset = hauppauge_hvr1500q_tuner_reset | 160 | .tuner_callback = cx23885_tuner_callback |
187 | }; | 161 | }; |
188 | 162 | ||
189 | static struct tda829x_config tda829x_no_probe = { | 163 | static struct tda829x_config tda829x_no_probe = { |
@@ -308,6 +282,11 @@ static int dvb_register(struct cx23885_tsport *port) | |||
308 | &hauppauge_hvr1500q_config, | 282 | &hauppauge_hvr1500q_config, |
309 | &dev->i2c_bus[0].i2c_adap); | 283 | &dev->i2c_bus[0].i2c_adap); |
310 | if (port->dvb.frontend != NULL) { | 284 | if (port->dvb.frontend != NULL) { |
285 | /* tunerconfig.video_dev must point to | ||
286 | * i2c_adap.algo_data | ||
287 | */ | ||
288 | hauppauge_hvr1500q_tunerconfig.video_dev = | ||
289 | i2c_bus->i2c_adap.algo_data; | ||
311 | dvb_attach(xc5000_attach, port->dvb.frontend, | 290 | dvb_attach(xc5000_attach, port->dvb.frontend, |
312 | &i2c_bus->i2c_adap, | 291 | &i2c_bus->i2c_adap, |
313 | &hauppauge_hvr1500q_tunerconfig); | 292 | &hauppauge_hvr1500q_tunerconfig); |
diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h index 390f9335bdc..ac9a76624e9 100644 --- a/drivers/media/video/cx23885/cx23885.h +++ b/drivers/media/video/cx23885/cx23885.h | |||
@@ -393,6 +393,7 @@ extern const unsigned int cx23885_bcount; | |||
393 | extern struct cx23885_subid cx23885_subids[]; | 393 | extern struct cx23885_subid cx23885_subids[]; |
394 | extern const unsigned int cx23885_idcount; | 394 | extern const unsigned int cx23885_idcount; |
395 | 395 | ||
396 | extern int cx23885_tuner_callback(void *i2c_bus, int command, int arg); | ||
396 | extern void cx23885_card_list(struct cx23885_dev *dev); | 397 | extern void cx23885_card_list(struct cx23885_dev *dev); |
397 | extern int cx23885_ir_init(struct cx23885_dev *dev); | 398 | extern int cx23885_ir_init(struct cx23885_dev *dev); |
398 | extern void cx23885_gpio_setup(struct cx23885_dev *dev); | 399 | extern void cx23885_gpio_setup(struct cx23885_dev *dev); |