]> err.no Git - linux-2.6/commitdiff
V4L/DVB (6488): ivtv: add ASUS Falcon2 support
authorHans Verkuil <hverkuil@xs4all.nl>
Tue, 30 Oct 2007 08:50:03 +0000 (05:50 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:01:50 +0000 (19:01 -0200)
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/ivtv/Kconfig
drivers/media/video/ivtv/ivtv-cards.c
drivers/media/video/ivtv/ivtv-cards.h
drivers/media/video/ivtv/ivtv-driver.c
drivers/media/video/ivtv/ivtv-i2c.c
drivers/media/video/ivtv/ivtv-routing.c

index 854cc9c30ca92bb3548aa9f5d5b77571ad7a9f52..6e5eed5e2438ed54024fd7289e3b3bba1a8c713a 100644 (file)
@@ -12,6 +12,7 @@ config VIDEO_IVTV
        select VIDEO_SAA7127
        select VIDEO_TVAUDIO
        select VIDEO_CS53L32A
+       select VIDEO_M52790
        select VIDEO_WM8775
        select VIDEO_WM8739
        select VIDEO_VP27SMPX
index aaa114b5c2680860eb81caa271a532a4b5b55c5f..3211809fe0c8a612a52472d71f7bdd59ece7734b 100644 (file)
@@ -23,6 +23,7 @@
 #include "ivtv-i2c.h"
 
 #include <media/msp3400.h>
+#include <media/m52790.h>
 #include <media/wm8775.h>
 #include <media/cs53l32a.h>
 #include <media/cx25840.h>
@@ -915,6 +916,44 @@ static const struct ivtv_card ivtv_card_avertv_mce116 = {
        .pci_list = ivtv_pci_avertv_mce116,
 };
 
+/* ------------------------------------------------------------------------- */
+
+/* ASUS Falcon2 */
+
+static const struct ivtv_card_pci_info ivtv_pci_asus_falcon2[] = {
+       { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_ASUSTEK, 0x4b66 },
+       { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_ASUSTEK, 0x462e },
+       { PCI_DEVICE_ID_IVTV16, IVTV_PCI_ID_ASUSTEK, 0x4b2e },
+       { 0, 0, 0 }
+};
+
+static const struct ivtv_card ivtv_card_asus_falcon2 = {
+       .type = IVTV_CARD_ASUS_FALCON2,
+       .name = "ASUS Falcon2",
+       .v4l2_capabilities = IVTV_CAP_ENCODER,
+       .hw_video = IVTV_HW_CX25840,
+       .hw_audio = IVTV_HW_CX25840,
+       .hw_audio_ctrl = IVTV_HW_CX25840,
+       .hw_muxer = IVTV_HW_M52790,
+       .hw_all = IVTV_HW_CX25840 | IVTV_HW_M52790 | IVTV_HW_TUNER,
+       .video_inputs = {
+               { IVTV_CARD_INPUT_VID_TUNER,  0, CX25840_COMPOSITE2 },
+               { IVTV_CARD_INPUT_SVIDEO1,    1, CX25840_SVIDEO3    },
+               { IVTV_CARD_INPUT_COMPOSITE1, 2, CX25840_COMPOSITE2 },
+       },
+       .audio_inputs = {
+               { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO5, M52790_IN_TUNER },
+               { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL,
+                       M52790_IN_V2 | M52790_SW1_YCMIX | M52790_SW2_YCMIX },
+               { IVTV_CARD_INPUT_LINE_IN1, CX25840_AUDIO_SERIAL, M52790_IN_V2 },
+       },
+       .radio_input = { IVTV_CARD_INPUT_AUD_TUNER, CX25840_AUDIO_SERIAL, M52790_IN_TUNER },
+       .tuners = {
+               { .std = V4L2_STD_525_60, .tuner = TUNER_PHILIPS_FM1236_MK3 },
+       },
+       .pci_list = ivtv_pci_asus_falcon2,
+};
+
 static const struct ivtv_card *ivtv_card_list[] = {
        &ivtv_card_pvr250,
        &ivtv_card_pvr350,
@@ -937,6 +976,7 @@ static const struct ivtv_card *ivtv_card_list[] = {
        &ivtv_card_pg600v2,
        &ivtv_card_club3d,
        &ivtv_card_avertv_mce116,
+       &ivtv_card_asus_falcon2,
 
        /* Variations of standard cards but with the same PCI IDs.
           These cards must come last in this list. */
index ff46e5ae8653717d978940ccf562dc58f4b2659f..81707bbb60dccd879f39005ef9c40d851b7e9511 100644 (file)
@@ -45,7 +45,8 @@
 #define IVTV_CARD_PG600V2           18 /* Yuan PG600V2/GotView PCI DVD Lite */
 #define IVTV_CARD_CLUB3D            19 /* Club3D ZAP-TV1x01 */
 #define IVTV_CARD_AVERTV_MCE116             20 /* AVerTV MCE 116 Plus */
-#define IVTV_CARD_LAST                      20
+#define IVTV_CARD_ASUS_FALCON2      21 /* ASUS Falcon2 */
+#define IVTV_CARD_LAST                      21
 
 /* Variants of existing cards but with the same PCI IDs. The driver
    detects these based on other device information.
@@ -69,6 +70,7 @@
 #define IVTV_PCI_ID_HAUPPAUGE_ALT1     0x0270
 #define IVTV_PCI_ID_HAUPPAUGE_ALT2     0x4070
 #define IVTV_PCI_ID_ADAPTEC            0x9005
+#define IVTV_PCI_ID_ASUSTEK            0x1043
 #define IVTV_PCI_ID_AVERMEDIA          0x1461
 #define IVTV_PCI_ID_YUAN1              0x12ab
 #define IVTV_PCI_ID_YUAN2              0xff01
@@ -96,7 +98,8 @@
 #define IVTV_HW_SAA717X   (1 << 12)
 #define IVTV_HW_WM8739    (1 << 13)
 #define IVTV_HW_VP27SMPX  (1 << 14)
-#define IVTV_HW_GPIO      (1 << 15)
+#define IVTV_HW_M52790    (1 << 15)
+#define IVTV_HW_GPIO      (1 << 16)
 
 #define IVTV_HW_SAA711X   (IVTV_HW_SAA7115 | IVTV_HW_SAA7114)
 
index ec40453e46e4ffcfe40635fc9da91da2910bf947..a8aca14f98a874200d5e060803d5387081f5b297 100644 (file)
@@ -185,6 +185,7 @@ MODULE_PARM_DESC(cardtype,
                 "\t\t\t19 = Yuan PG600V2/GotView PCI DVD Lite\n"
                 "\t\t\t20 = Club3D ZAP-TV1x01\n"
                 "\t\t\t21 = AverTV MCE 116 Plus\n"
+                "\t\t\t22 = ASUS Falcon2\n"
                 "\t\t\t 0 = Autodetect (default)\n"
                 "\t\t\t-1 = Ignore this card\n\t\t");
 MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60");
@@ -882,6 +883,10 @@ static void ivtv_load_and_init_modules(struct ivtv *itv)
        if (hw & IVTV_HW_CS53L32A)
                ivtv_request_module(itv, "cs53l32a");
 #endif
+#ifndef CONFIG_VIDEO_M52790
+       if (hw & IVTV_HW_M52790)
+               ivtv_request_module(itv, "m52790");
+#endif
 
        /* check which i2c devices are actually found */
        for (i = 0; i < 32; i++) {
index 36e54f78aa2a6aad418f5e05cb921ad33df3ddf5..7f513ecc0781b6b81d3cf7aef0b70a465daa99b6 100644 (file)
@@ -80,6 +80,7 @@
 #endif /* I2C_ADAP_CLASS_TV_ANALOG */
 
 #define IVTV_CS53L32A_I2C_ADDR         0x11
+#define IVTV_M52790_I2C_ADDR           0x48
 #define IVTV_CX25840_I2C_ADDR          0x44
 #define IVTV_SAA7115_I2C_ADDR          0x21
 #define IVTV_SAA7127_I2C_ADDR          0x44
@@ -110,6 +111,7 @@ static const u8 hw_driverids[] = {
        I2C_DRIVERID_SAA717X,
        I2C_DRIVERID_WM8739,
        I2C_DRIVERID_VP27SMPX,
+       I2C_DRIVERID_M52790,
        0               /* IVTV_HW_GPIO dummy driver ID */
 };
 
@@ -130,6 +132,7 @@ static const char * const hw_drivernames[] = {
        "saa717x",
        "wm8739",
        "vp27smpx",
+       "m52790",
        "gpio",
 };
 
index 398bd33033ed6f77ca5291b301f96da8ff4e9211..05564919b57f680c9afc227a95447beabe38ecc7 100644 (file)
@@ -25,6 +25,7 @@
 #include "ivtv-routing.h"
 
 #include <media/msp3400.h>
+#include <media/m52790.h>
 #include <media/upd64031a.h>
 #include <media/upd64083.h>
 
    settings. */
 void ivtv_audio_set_io(struct ivtv *itv)
 {
+       const struct ivtv_card_audio_input *in;
        struct v4l2_routing route;
-       u32 audio_input;
-       int mux_input;
 
        /* Determine which input to use */
-       if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags)) {
-               audio_input = itv->card->radio_input.audio_input;
-               mux_input = itv->card->radio_input.muxer_input;
-       } else {
-               audio_input = itv->card->audio_inputs[itv->audio_input].audio_input;
-               mux_input = itv->card->audio_inputs[itv->audio_input].muxer_input;
-       }
+       if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags))
+               in = &itv->card->radio_input;
+       else
+               in = &itv->card->audio_inputs[itv->audio_input];
 
        /* handle muxer chips */
-       route.input = mux_input;
+       route.input = in->muxer_input;
        route.output = 0;
+       if (itv->card->hw_muxer & IVTV_HW_M52790)
+               route.output = M52790_OUT_STEREO;
        ivtv_i2c_hw(itv, itv->card->hw_muxer, VIDIOC_INT_S_AUDIO_ROUTING, &route);
 
-       route.input = audio_input;
-       if (itv->card->hw_audio & IVTV_HW_MSP34XX) {
+       route.input = in->audio_input;
+       route.output = 0;
+       if (itv->card->hw_audio & IVTV_HW_MSP34XX)
                route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1);
-       }
        ivtv_i2c_hw(itv, itv->card->hw_audio, VIDIOC_INT_S_AUDIO_ROUTING, &route);
 }