V4L/DVB(7879): Adding cx18 Support for mxl5005s
authorSteven Toth <stoth@hauppauge.com>
Thu, 1 May 2008 10:23:23 +0000 (07:23 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 14 May 2008 05:56:43 +0000 (02:56 -0300)
Adding cx18 Support

Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/cx18/Kconfig
drivers/media/video/cx18/cx18-cards.c
drivers/media/video/cx18/cx18-dvb.c

index 35a55998a8d34865c4e8d75fd43a11261b2b249b..5f942690570c2079626c15c113cdaa02538d3e05 100644 (file)
@@ -11,6 +11,7 @@ config VIDEO_CX18
        select VIDEO_CX2341X
        select VIDEO_CS5345
        select DVB_S5H1409
+       select MEDIA_TUNER_MXL5005S
        ---help---
          This is a video4linux driver for Conexant cx23418 based
          PCI combo video recorder devices.
index f5e3ba1f5354153d7780d53bd530dda4456aea9a..bf6f7edca88722c507c9d0045170f24bb97988dd 100644 (file)
@@ -51,7 +51,8 @@ static const struct cx18_card cx18_card_hvr1600_esmt = {
        .v4l2_capabilities = CX18_CAP_ENCODER,
        .hw_audio_ctrl = CX18_HW_CX23418,
        .hw_muxer = CX18_HW_CS5345,
-       .hw_all = CX18_HW_TVEEPROM | CX18_HW_TUNER | CX18_HW_CS5345,
+       .hw_all = CX18_HW_TVEEPROM | CX18_HW_TUNER | CX18_HW_CS5345
+               | CX18_HW_DVB,
        .video_inputs = {
                { CX18_CARD_INPUT_VID_TUNER,  0, CX23418_COMPOSITE7 },
                { CX18_CARD_INPUT_SVIDEO1,    1, CX23418_SVIDEO1    },
index 65efe69d939a83513d4c5fc79fa2edbb3e63bf08..c9744173f9692d635455d844beb7a2f9aef2020a 100644 (file)
 #include "cx18-streams.h"
 #include "cx18-cards.h"
 #include "s5h1409.h"
-
-/* Wait until the MXL500X driver is merged */
-#ifdef HAVE_MXL500X
-#include "mxl500x.h"
-#endif
+#include "mxl5005s.h"
 
 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
 
 #define CX18_REG_DMUX_NUM_PORT_0_CONTROL 0xd5a000
 
-#ifdef HAVE_MXL500X
-static struct mxl500x_config hauppauge_hvr1600_tuner = {
-       .delsys    = MXL500x_MODE_ATSC,
-       .octf      = MXL500x_OCTF_CH,
-       .xtal_freq = 16000000,
-       .iflo_freq = 5380000,
-       .ref_freq  = 322800000,
-       .rssi_ena  = MXL_RSSI_ENABLE,
-       .addr      = 0xC6 >> 1,
+static struct mxl5005s_config hauppauge_hvr1600_tuner = {
+       .i2c_address     = 0xC6 >> 1,
+       .if_freq         = IF_FREQ_5380000HZ,
+       .xtal_freq       = CRYSTAL_FREQ_16000000HZ,
+       .agc_mode        = MXL_SINGLE_AGC,
+       .tracking_filter = MXL_TF_C_H,
+       .rssi_enable     = MXL_RSSI_ENABLE,
+       .cap_select      = MXL_CAP_SEL_ENABLE,
+       .div_out         = MXL_DIV_OUT_4,
+       .clock_out       = MXL_CLOCK_OUT_DISABLE,
+       .output_load     = MXL5005S_IF_OUTPUT_LOAD_200_OHM,
+       .top             = MXL5005S_TOP_25P2,
+       .mod_mode        = MXL_DIGITAL_MODE,
+       .if_mode         = MXL_ZERO_IF,
+       .AgcMasterByte   = 0x00,
 };
 
 static struct s5h1409_config hauppauge_hvr1600_config = {
@@ -55,7 +57,6 @@ static struct s5h1409_config hauppauge_hvr1600_config = {
        .mpeg_timing   = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK
 
 };
-#endif
 
 static int dvb_register(struct cx18_stream *stream);
 
@@ -252,21 +253,18 @@ static int dvb_register(struct cx18_stream *stream)
        int ret = 0;
 
        switch (cx->card->type) {
-/* Wait until the MXL500X driver is merged */
-#ifdef HAVE_MXL500X
        case CX18_CARD_HVR_1600_ESMT:
        case CX18_CARD_HVR_1600_SAMSUNG:
                dvb->fe = dvb_attach(s5h1409_attach,
                        &hauppauge_hvr1600_config,
                        &cx->i2c_adap[0]);
                if (dvb->fe != NULL) {
-                       dvb_attach(mxl500x_attach, dvb->fe,
-                               &hauppauge_hvr1600_tuner,
-                               &cx->i2c_adap[0]);
+                       dvb_attach(mxl5005s_attach, dvb->fe,
+                               &cx->i2c_adap[0],
+                               &hauppauge_hvr1600_tuner);
                        ret = 0;
                }
                break;
-#endif
        default:
                /* No Digital Tv Support */
                break;