aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoristvan_v@mailbox.hu <istvan_v@mailbox.hu>2011-06-07 12:12:29 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:53:04 -0400
commitc21973e8aa930fe8a56ed4939ed9b6d640a6b158 (patch)
tree37f7341e6563bc26b292daec86b2c75105ada67b
parent0db15d525d2d342de8e983c218198d5708a32004 (diff)
[media] cx88: added XC4000 tuner callback and DVB attach functions
Added functions for XC4000 tuner reset and attaching DVB frontend. Signed-off-by: Istvan Varga <istvan_v@mailbox.hu> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/cx88/cx88-cards.c13
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c34
2 files changed, 47 insertions, 0 deletions
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index 27222c92b603..7ae62cc62cdf 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -28,6 +28,7 @@
28 28
29#include "cx88.h" 29#include "cx88.h"
30#include "tea5767.h" 30#include "tea5767.h"
31#include "xc4000.h"
31 32
32static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 33static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
33static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET }; 34static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
@@ -2948,6 +2949,15 @@ static int cx88_xc2028_tuner_callback(struct cx88_core *core,
2948 return -EINVAL; 2949 return -EINVAL;
2949} 2950}
2950 2951
2952static int cx88_xc4000_tuner_callback(struct cx88_core *core,
2953 int command, int arg)
2954{
2955 /* Board-specific callbacks */
2956 switch (core->boardnr) {
2957 }
2958 return -EINVAL;
2959}
2960
2951/* ----------------------------------------------------------------------- */ 2961/* ----------------------------------------------------------------------- */
2952/* Tuner callback function. Currently only needed for the Pinnacle * 2962/* Tuner callback function. Currently only needed for the Pinnacle *
2953 * PCTV HD 800i with an xc5000 sillicon tuner. This is used for both * 2963 * PCTV HD 800i with an xc5000 sillicon tuner. This is used for both *
@@ -3022,6 +3032,9 @@ int cx88_tuner_callback(void *priv, int component, int command, int arg)
3022 case TUNER_XC2028: 3032 case TUNER_XC2028:
3023 info_printk(core, "Calling XC2028/3028 callback\n"); 3033 info_printk(core, "Calling XC2028/3028 callback\n");
3024 return cx88_xc2028_tuner_callback(core, command, arg); 3034 return cx88_xc2028_tuner_callback(core, command, arg);
3035 case TUNER_XC4000:
3036 info_printk(core, "Calling XC4000 callback\n");
3037 return cx88_xc4000_tuner_callback(core, command, arg);
3025 case TUNER_XC5000: 3038 case TUNER_XC5000:
3026 info_printk(core, "Calling XC5000 callback\n"); 3039 info_printk(core, "Calling XC5000 callback\n");
3027 return cx88_xc5000_tuner_callback(core, command, arg); 3040 return cx88_xc5000_tuner_callback(core, command, arg);
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index c69df7ebb6a7..f0fbff499f01 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -41,6 +41,7 @@
41#include "or51132.h" 41#include "or51132.h"
42#include "lgdt330x.h" 42#include "lgdt330x.h"
43#include "s5h1409.h" 43#include "s5h1409.h"
44#include "xc4000.h"
44#include "xc5000.h" 45#include "xc5000.h"
45#include "nxt200x.h" 46#include "nxt200x.h"
46#include "cx24123.h" 47#include "cx24123.h"
@@ -605,6 +606,39 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev)
605 return 0; 606 return 0;
606} 607}
607 608
609static int attach_xc4000(struct cx8802_dev *dev, struct xc4000_config *cfg)
610{
611 struct dvb_frontend *fe;
612 struct videobuf_dvb_frontend *fe0 = NULL;
613
614 /* Get the first frontend */
615 fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);
616 if (!fe0)
617 return -EINVAL;
618
619 if (!fe0->dvb.frontend) {
620 printk(KERN_ERR "%s/2: dvb frontend not attached. "
621 "Can't attach xc4000\n",
622 dev->core->name);
623 return -EINVAL;
624 }
625
626 fe = dvb_attach(xc4000_attach, fe0->dvb.frontend, &dev->core->i2c_adap,
627 cfg);
628 if (!fe) {
629 printk(KERN_ERR "%s/2: xc4000 attach failed\n",
630 dev->core->name);
631 dvb_frontend_detach(fe0->dvb.frontend);
632 dvb_unregister_frontend(fe0->dvb.frontend);
633 fe0->dvb.frontend = NULL;
634 return -EINVAL;
635 }
636
637 printk(KERN_INFO "%s/2: xc4000 attached\n", dev->core->name);
638
639 return 0;
640}
641
608static int cx24116_set_ts_param(struct dvb_frontend *fe, 642static int cx24116_set_ts_param(struct dvb_frontend *fe,
609 int is_punctured) 643 int is_punctured)
610{ 644{