aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/cx23885/cx23885-cards.c16
-rw-r--r--drivers/media/video/cx23885/cx23885-dvb.c34
-rw-r--r--drivers/media/video/cx23885/cx23885.h1
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
373int 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
370void cx23885_gpio_setup(struct cx23885_dev *dev) 384void 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
306static 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
336static int dvb_register(struct cx23885_tsport *port) 306static 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[];
410extern const unsigned int cx23885_idcount; 410extern const unsigned int cx23885_idcount;
411 411
412extern int cx23885_xc5000_tuner_callback(void *priv, int command, int arg); 412extern int cx23885_xc5000_tuner_callback(void *priv, int command, int arg);
413extern int cx23885_xc3028_tuner_callback(void *priv, int command, int arg);
413extern void cx23885_card_list(struct cx23885_dev *dev); 414extern void cx23885_card_list(struct cx23885_dev *dev);
414extern int cx23885_ir_init(struct cx23885_dev *dev); 415extern int cx23885_ir_init(struct cx23885_dev *dev);
415extern void cx23885_gpio_setup(struct cx23885_dev *dev); 416extern void cx23885_gpio_setup(struct cx23885_dev *dev);