[PATCH] v4l: 635: add bttv card 137 conceptronic ctvfmi v2
authorRicardo Cerqueira <v4l\@cerqueira.org>
Wed, 9 Nov 2005 05:36:20 +0000 (21:36 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 9 Nov 2005 15:56:07 +0000 (07:56 -0800)
- Add bttv card 137 - Conceptronic CTVFMi v2

Signed-off-by: Ricardo Cerqueira <v4l\@cerqueira.org>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Documentation/video4linux/CARDLIST.bttv
drivers/media/video/bttv-cards.c
drivers/media/video/bttv.h
drivers/media/video/ir-kbd-gpio.c

index ec785f9f15a3168e5d95f230b19da743e7a588db..89460a5babfa2f616867eb9309d73a0b0641d958 100644 (file)
@@ -135,3 +135,4 @@ card=133 - Kodicom 4400R (slave)
 card=134 - Adlink RTV24
 card=135 - DViCO FusionHDTV 5 Lite
 card=136 - Acorp Y878F
+card=137 - Conceptronic CTVFMi v2
index 0881a17d5226416723edfb1e2bc64a66a2d388a1..75033f06551f163fdcf69d8024ce58328cb608d2 100644 (file)
@@ -2418,6 +2418,21 @@ struct tvcard bttv_tvcards[] = {
        .tuner_type     = TUNER_YMEC_TVF66T5_B_DFF,
        .tuner_addr     = 0xc1 >>1,
        .has_radio      = 1,
+},{
+       /* ---- card 0x89 ---------------------------------- */
+       .name           = "Conceptronic CTVFMi v2",
+       .video_inputs   = 3,
+       .audio_inputs   = 1,
+       .tuner          = 0,
+       .svhs           = 2,
+       .gpiomask       = 0x001c0007,
+       .muxsel         = { 2, 3, 1, 1 },
+       .audiomux       = { 0, 1, 2, 2, 3 },
+       .needs_tvaudio  = 0,
+       .pll            = PLL_28,
+       .tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
+       .tuner_addr     = ADDR_UNSET,
+       .has_remote     = 1,
 }};
 
 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
index d254e90e3bb9fe8718a58bb8b080860b2f2b66e2..dcdf9cde785703f490335a59eae08ae3d3644c60 100644 (file)
 #define BTTV_ADLINK_RTV24   0x86
 #define BTTV_DVICO_FUSIONHDTV_5_LITE 0x87
 #define BTTV_ACORP_Y878F   0x88
+#define BTTV_CONCEPTRONIC_CTVFMI2 0x89
 
 /* i2c address list */
 #define I2C_TSA5522        0xc2
index 234151e48edc40ea73c383cc8796dd3e48ba0c98..1861d31f11b8026fc1a768a720f99c47fbd45e4d 100644 (file)
@@ -156,6 +156,71 @@ static IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE] = {
 
 /* ---------------------------------------------------------------------- */
 
+/* Ricardo Cerqueira <v4l@cerqueira.org> */
+/* Weird matching, since the remote has "uncommon" keys */
+
+static IR_KEYTAB_TYPE ir_codes_conceptronic[IR_KEYTAB_SIZE] = {
+
+       [ 30 ] = KEY_POWER,       // power
+       [ 7  ]  = KEY_SWITCHVIDEOMODE,     // source
+       [ 28 ] = KEY_SEARCH,      // scan
+
+/* FIXME: duplicate keycodes?
+ *
+ * These four keys seem to share the same GPIO as CH+, CH-, <<< and >>>
+ * The GPIO values are
+ * 6397fb for both "Scan <" and "CH -",
+ * 639ffb for "Scan >" and "CH+",
+ * 6384fb for "Tune <" and "<<<",
+ * 638cfb for "Tune >" and ">>>", regardless of the mask.
+ *
+ *     [ 23 ] = KEY_BACK,        // fm scan <<
+ *     [ 31 ] = KEY_FORWARD,     // fm scan >>
+ *
+ *     [ 4  ] = KEY_LEFT,        // fm tuning <
+ *     [ 12 ] = KEY_RIGHT,       // fm tuning >
+ *
+ * For now, these four keys are disabled. Pressing them will generate
+ * the CH+/CH-/<<</>>> events
+ */
+
+       [ 3  ] = KEY_TUNER,       // TV/FM
+
+       [ 0  ] = KEY_RECORD,
+       [ 8  ] = KEY_STOP,
+       [ 17 ] = KEY_PLAY,
+
+       [ 26 ] = KEY_PLAYPAUSE,   // freeze
+       [ 25 ] = KEY_ZOOM,        // zoom
+       [ 15 ] = KEY_TEXT,        // min
+
+       [ 1  ] = KEY_KP1,
+       [ 11 ] = KEY_KP2,
+       [ 27 ] = KEY_KP3,
+       [ 5  ] = KEY_KP4,
+       [ 9  ] = KEY_KP5,
+       [ 21 ] = KEY_KP6,
+       [ 6  ] = KEY_KP7,
+       [ 10 ] = KEY_KP8,
+       [ 18 ] = KEY_KP9,
+       [ 2  ] = KEY_KP0,
+       [ 16 ] = KEY_LAST,        // +100
+       [ 19 ] = KEY_LIST,        // recall
+
+       [ 31 ] = KEY_CHANNELUP,   // chn down
+       [ 23 ] = KEY_CHANNELDOWN, // chn up
+       [ 22 ] = KEY_VOLUMEUP,    // vol down
+       [ 20 ] = KEY_VOLUMEDOWN,  // vol up
+
+       [ 4  ] = KEY_KPMINUS,     // <<<
+       [ 14 ] = KEY_SETUP,       // function
+       [ 12 ] = KEY_KPPLUS,      // >>>
+
+       [ 13 ] = KEY_GOTO,        // mts
+       [ 29 ] = KEY_REFRESH,     // reset
+       [ 24 ] = KEY_MUTE         // mute/unmute
+};
+
 struct IR {
        struct bttv_sub_device  *sub;
        struct input_dev        *input;
@@ -329,6 +394,12 @@ static int ir_probe(struct device *dev)
                ir->mask_keyup   = 0x008000;
                ir->polling      = 50; // ms
                break;
+       case BTTV_CONCEPTRONIC_CTVFMI2:
+               ir_codes         = ir_codes_conceptronic;
+               ir->mask_keycode = 0x001F00;
+               ir->mask_keyup   = 0x006000;
+               ir->polling      = 50; // ms
+               break;
        }
        if (NULL == ir_codes) {
                kfree(ir);