]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (7705): pvrusb2: Enable OnAir digital operation
authorMichael Krufky <mkrufky@linuxtv.org>
Fri, 28 Mar 2008 08:47:47 +0000 (05:47 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 24 Apr 2008 17:09:48 +0000 (14:09 -0300)
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/pvrusb2/pvrusb2-devattr.c

index f489aab112dca0bd5e2e7366ffba9b4f65057932..6794862bbb194d6dce658ad10ececa913a133c49 100644 (file)
@@ -32,7 +32,11 @@ pvr2_device_desc structures.
 /* This is needed in order to pull in tuner type ids... */
 #include <linux/i2c.h>
 #include <media/tuner.h>
-
+#ifdef CONFIG_VIDEO_PVRUSB2_DVB
+#include "pvrusb2-hdw-internal.h"
+#include "lgdt330x.h"
+#include "tuner-simple.h"
+#endif
 
 
 /*------------------------------------------------------------------------*/
@@ -147,6 +151,38 @@ static const struct pvr2_device_desc pvr2_device_gotview_2d = {
 /*------------------------------------------------------------------------*/
 /* OnAir Creator */
 
+#ifdef CONFIG_VIDEO_PVRUSB2_DVB
+static struct lgdt330x_config pvr2_lgdt3303_config = {
+       .demod_address       = 0x0e,
+       .demod_chip          = LGDT3303,
+       .clock_polarity_flip = 1,
+};
+
+static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap)
+{
+       adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3303_config,
+                             &adap->channel.hdw->i2c_adap);
+       if (adap->fe)
+               return 0;
+
+       return -EIO;
+}
+
+static int pvr2_lgh06xf_attach(struct pvr2_dvb_adapter *adap)
+{
+       dvb_attach(simple_tuner_attach, adap->fe,
+                  &adap->channel.hdw->i2c_adap, 0x61,
+                  TUNER_LG_TDVS_H06XF);
+
+       return 0;
+}
+
+struct pvr2_dvb_props pvr2_onair_creator_fe_props = {
+       .frontend_attach = pvr2_lgdt3303_attach,
+       .tuner_attach    = pvr2_lgh06xf_attach,
+};
+#endif
+
 static const char *pvr2_client_onair_creator[] = {
        "saa7115",
        "tuner",
@@ -165,6 +201,9 @@ static const struct pvr2_device_desc pvr2_device_onair_creator = {
                .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
                .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
                .default_std_mask = V4L2_STD_NTSC_M,
+#ifdef CONFIG_VIDEO_PVRUSB2_DVB
+               .dvb_props = &pvr2_onair_creator_fe_props,
+#endif
 };
 #endif
 
@@ -174,6 +213,37 @@ static const struct pvr2_device_desc pvr2_device_onair_creator = {
 /*------------------------------------------------------------------------*/
 /* OnAir USB 2.0 */
 
+#ifdef CONFIG_VIDEO_PVRUSB2_DVB
+static struct lgdt330x_config pvr2_lgdt3302_config = {
+       .demod_address       = 0x0e,
+       .demod_chip          = LGDT3302,
+};
+
+static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap)
+{
+       adap->fe = dvb_attach(lgdt330x_attach, &pvr2_lgdt3302_config,
+                             &adap->channel.hdw->i2c_adap);
+       if (adap->fe)
+               return 0;
+
+       return -EIO;
+}
+
+static int pvr2_fcv1236d_attach(struct pvr2_dvb_adapter *adap)
+{
+       dvb_attach(simple_tuner_attach, adap->fe,
+                  &adap->channel.hdw->i2c_adap, 0x61,
+                  TUNER_PHILIPS_FCV1236D);
+
+       return 0;
+}
+
+struct pvr2_dvb_props pvr2_onair_usb2_fe_props = {
+       .frontend_attach = pvr2_lgdt3302_attach,
+       .tuner_attach    = pvr2_fcv1236d_attach,
+};
+#endif
+
 static const char *pvr2_client_onair_usb2[] = {
        "saa7115",
        "tuner",
@@ -192,6 +262,9 @@ static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
                .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
                .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
                .default_std_mask = V4L2_STD_NTSC_M,
+#ifdef CONFIG_VIDEO_PVRUSB2_DVB
+               .dvb_props = &pvr2_onair_usb2_fe_props,
+#endif
 };
 #endif