diff options
author | Steven Toth <stoth@hauppauge.com> | 2008-08-04 20:38:46 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:49 -0400 |
commit | 90a71b1c1ab003dd4524afca44c2ad2519f4420c (patch) | |
tree | bc5852eaaaac7f9c81778ab95ee90333d552b69a /drivers/media/video | |
parent | 0fbbff33fcab605b1a5c53a20c302aad24b082ef (diff) |
V4L/DVB (8643): Switch Hauppauge HVR1400 and HVR1500 to common cx23885 tuner callback
The Hauppauge HVR1400 and HVR1500 can now use the common cx23885 tuner
callback.
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-cards.c | 16 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885-dvb.c | 34 | ||||
-rw-r--r-- | drivers/media/video/cx23885/cx23885.h | 1 |
3 files changed, 18 insertions, 33 deletions
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index e5e688e5e4b0..93ad7f8ce203 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <media/cx25840.h> | 26 | #include <media/cx25840.h> |
27 | 27 | ||
28 | #include "cx23885.h" | 28 | #include "cx23885.h" |
29 | #include "tuner-xc2028.h" | ||
29 | 30 | ||
30 | /* ------------------------------------------------------------------ */ | 31 | /* ------------------------------------------------------------------ */ |
31 | /* board config info */ | 32 | /* board config info */ |
@@ -331,8 +332,10 @@ static int cx23885_tuner_callback(struct cx23885_dev *dev, int port, | |||
331 | } | 332 | } |
332 | 333 | ||
333 | switch(dev->board) { | 334 | switch(dev->board) { |
335 | case CX23885_BOARD_HAUPPAUGE_HVR1400: | ||
336 | case CX23885_BOARD_HAUPPAUGE_HVR1500: | ||
334 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: | 337 | case CX23885_BOARD_HAUPPAUGE_HVR1500Q: |
335 | /* Tuner Reset Command from xc5000 */ | 338 | /* Tuner Reset Command */ |
336 | if (command == 0) | 339 | if (command == 0) |
337 | bitmask = 0x04; | 340 | bitmask = 0x04; |
338 | break; | 341 | break; |
@@ -367,6 +370,17 @@ int cx23885_xc5000_tuner_callback(void *priv, int command, int arg) | |||
367 | return cx23885_tuner_callback(dev, bus->nr, command, arg); | 370 | return cx23885_tuner_callback(dev, bus->nr, command, arg); |
368 | } | 371 | } |
369 | 372 | ||
373 | int cx23885_xc3028_tuner_callback(void *priv, int command, int arg) | ||
374 | { | ||
375 | struct cx23885_tsport *port = priv; | ||
376 | struct cx23885_dev *dev = port->dev; | ||
377 | |||
378 | if (command == XC2028_RESET_CLK) | ||
379 | return 0; | ||
380 | |||
381 | return cx23885_tuner_callback(dev, port->nr, command, arg); | ||
382 | } | ||
383 | |||
370 | void cx23885_gpio_setup(struct cx23885_dev *dev) | 384 | void cx23885_gpio_setup(struct cx23885_dev *dev) |
371 | { | 385 | { |
372 | switch(dev->board) { | 386 | switch(dev->board) { |
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index bfe49df3f6dd..45670051e7d5 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -303,36 +303,6 @@ static struct dib7000p_config hauppauge_hvr1400_dib7000_config = { | |||
303 | .output_mode = OUTMODE_MPEG2_SERIAL, | 303 | .output_mode = OUTMODE_MPEG2_SERIAL, |
304 | }; | 304 | }; |
305 | 305 | ||
306 | static int cx23885_hvr1500_xc3028_callback(void *ptr, int command, int arg) | ||
307 | { | ||
308 | struct cx23885_tsport *port = ptr; | ||
309 | struct cx23885_dev *dev = port->dev; | ||
310 | |||
311 | switch (command) { | ||
312 | case XC2028_TUNER_RESET: | ||
313 | /* Send the tuner in then out of reset */ | ||
314 | /* GPIO-2 xc3028 tuner */ | ||
315 | dprintk(1, "%s: XC2028_TUNER_RESET %d\n", __func__, arg); | ||
316 | |||
317 | cx_set(GP0_IO, 0x00040000); | ||
318 | cx_clear(GP0_IO, 0x00000004); | ||
319 | msleep(5); | ||
320 | |||
321 | cx_set(GP0_IO, 0x00040004); | ||
322 | msleep(5); | ||
323 | break; | ||
324 | case XC2028_RESET_CLK: | ||
325 | dprintk(1, "%s: XC2028_RESET_CLK %d\n", __func__, arg); | ||
326 | break; | ||
327 | default: | ||
328 | dprintk(1, "%s: unknown command %d, arg %d\n", __func__, | ||
329 | command, arg); | ||
330 | return -EINVAL; | ||
331 | } | ||
332 | |||
333 | return 0; | ||
334 | } | ||
335 | |||
336 | static int dvb_register(struct cx23885_tsport *port) | 306 | static int dvb_register(struct cx23885_tsport *port) |
337 | { | 307 | { |
338 | struct cx23885_dev *dev = port->dev; | 308 | struct cx23885_dev *dev = port->dev; |
@@ -426,7 +396,7 @@ static int dvb_register(struct cx23885_tsport *port) | |||
426 | struct xc2028_config cfg = { | 396 | struct xc2028_config cfg = { |
427 | .i2c_adap = &i2c_bus->i2c_adap, | 397 | .i2c_adap = &i2c_bus->i2c_adap, |
428 | .i2c_addr = 0x61, | 398 | .i2c_addr = 0x61, |
429 | .callback = cx23885_hvr1500_xc3028_callback, | 399 | .callback = cx23885_xc3028_tuner_callback, |
430 | }; | 400 | }; |
431 | static struct xc2028_ctrl ctl = { | 401 | static struct xc2028_ctrl ctl = { |
432 | .fname = "xc3028-v27.fw", | 402 | .fname = "xc3028-v27.fw", |
@@ -465,7 +435,7 @@ static int dvb_register(struct cx23885_tsport *port) | |||
465 | struct xc2028_config cfg = { | 435 | struct xc2028_config cfg = { |
466 | .i2c_adap = &dev->i2c_bus[1].i2c_adap, | 436 | .i2c_adap = &dev->i2c_bus[1].i2c_adap, |
467 | .i2c_addr = 0x64, | 437 | .i2c_addr = 0x64, |
468 | .callback = cx23885_hvr1500_xc3028_callback, | 438 | .callback = cx23885_xc3028_tuner_callback, |
469 | }; | 439 | }; |
470 | static struct xc2028_ctrl ctl = { | 440 | static struct xc2028_ctrl ctl = { |
471 | .fname = "xc3028L-v36.fw", | 441 | .fname = "xc3028L-v36.fw", |
diff --git a/drivers/media/video/cx23885/cx23885.h b/drivers/media/video/cx23885/cx23885.h index c3478b24012a..64827fb669a2 100644 --- a/drivers/media/video/cx23885/cx23885.h +++ b/drivers/media/video/cx23885/cx23885.h | |||
@@ -410,6 +410,7 @@ extern struct cx23885_subid cx23885_subids[]; | |||
410 | extern const unsigned int cx23885_idcount; | 410 | extern const unsigned int cx23885_idcount; |
411 | 411 | ||
412 | extern int cx23885_xc5000_tuner_callback(void *priv, int command, int arg); | 412 | extern int cx23885_xc5000_tuner_callback(void *priv, int command, int arg); |
413 | extern int cx23885_xc3028_tuner_callback(void *priv, int command, int arg); | ||
413 | extern void cx23885_card_list(struct cx23885_dev *dev); | 414 | extern void cx23885_card_list(struct cx23885_dev *dev); |
414 | extern int cx23885_ir_init(struct cx23885_dev *dev); | 415 | extern int cx23885_ir_init(struct cx23885_dev *dev); |
415 | extern void cx23885_gpio_setup(struct cx23885_dev *dev); | 416 | extern void cx23885_gpio_setup(struct cx23885_dev *dev); |