[linux-dvb] [PATCH] Geniatech DVB-S remote (Digistar) patch

Blake Zero blake.zero at yahoo.com
Fri Jan 25 02:44:26 CET 2008


Hi,

I have tested the following patch by Marek Kidawski  and it is working with my Digiwave  103g (Geniatech\Digistar). Below is the complete patch
which autoload the ir-kbd-i2c module.

--------------------------------------------------------------------------------------------------------------------
diff -r 86817d2750b7 linux/drivers/media/common/ir-keymaps.c
--- a/linux/drivers/media/common/ir-keymaps.c    Fri Jan 18 08:08:21 2008 -0200
+++ b/linux/drivers/media/common/ir-keymaps.c    Thu Jan 24 21:29:11 2008 -0400
@@ -2002,3 +2002,54 @@ IR_KEYTAB_TYPE ir_codes_behold[IR_KEYTAB
 };
 
 EXPORT_SYMBOL_GPL(ir_codes_behold);
+
+/* Marek Kidawski <mark_kiddy at wp.pl> */
+IR_KEYTAB_TYPE ir_codes_digistar[IR_KEYTAB_SIZE] = {
+    [ 0x00 ] = KEY_0,         //'0'
+    [ 0x01 ] = KEY_1,         //'1'
+    [ 0x02 ] = KEY_2,         //'2'
+    [ 0x03 ] = KEY_3,         //'3'
+    [ 0x04 ] = KEY_4,         //'4'
+    [ 0x05 ] = KEY_5,         //'5'
+    [ 0x06 ] = KEY_6,         //'6'
+    [ 0x07 ] = KEY_7,         //'7'
+    [ 0x08 ] = KEY_8,         //'8'
+    [ 0x09 ] = KEY_9,         //'9'
+
+    [ 0x0c ] = KEY_F9,        // 'power'
+
+
+    [ 0x25 ] = KEY_F3,          // 'red'
+    [ 0x14 ] = KEY_F5,          // 'blue'
+    [ 0x0f ] = KEY_F4,          // 'yellow'
+
+    [ 0x21 ] = KEY_DOWN,        // 'channel -'
+    [ 0x20 ] = KEY_UP,          // 'channel +'
+    [ 0x11 ] = KEY_LEFT,        // 'volume -'
+    [ 0x10 ] = KEY_RIGHT,       // 'volume +'
+
+    [ 0x1f ] = KEY_R,           // 'record'
+    [ 0x16 ] = KEY_P,           // 'pause'
+    [ 0x0b ] = KEY_O,           // 'stop'
+    [ 0x17 ] = KEY_L,           // 'play'
+    [ 0x26 ] = KEY_COMMA,       // 'backward <<'
+    [ 0x27 ] = KEY_DOT,         // 'forward >>'
+
+    [ 0x2c ] = KEY_T,           // 'teletext'
+    [ 0x2b ] = KEY_S,           // 'epg'
+    [ 0x1e ] = KEY_I,           // 'osd'
+    [ 0x0e ] = KEY_V,           // 'window'
+
+    [ 0x12 ] = KEY_VOLUMEUP,    // 'bright up'
+    [ 0x13 ] = KEY_VOLUMEDOWN,  // 'bright down'
+
+    [ 0x2d ] = KEY_M,           // 'menu'
+
+    [ 0x0a ] = KEY_ESC,         // '-/--'
+    [ 0x29 ] = KEY_H,           // 'return'
+
+    [ 0x0d ] = KEY_ENTER,       // 'mute / enter'
+    [ 0x38 ] = KEY_F6           // 'tv / radio'
+};
+
+EXPORT_SYMBOL_GPL(ir_codes_digistar);
diff -r 86817d2750b7 linux/drivers/media/video/cx88/cx88-video.c
--- a/linux/drivers/media/video/cx88/cx88-video.c    Fri Jan 18 08:08:21 2008 -0200
+++ b/linux/drivers/media/video/cx88/cx88-video.c    Thu Jan 24 21:29:11 2008 -0400
@@ -2129,6 +2129,9 @@ static int __devinit cx8800_initdev(stru
     case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD:
         request_module("ir-kbd-i2c");
         request_module("rtc-isl1208");
+        break;
+    case CX88_BOARD_GENIATECH_DVBS:
+        request_module("ir-kbd-i2c");
     }
 
     /* register v4l devices */
diff -r 86817d2750b7 linux/drivers/media/video/ir-kbd-i2c.c
--- a/linux/drivers/media/video/ir-kbd-i2c.c    Fri Jan 18 08:08:21 2008 -0200
+++ b/linux/drivers/media/video/ir-kbd-i2c.c    Thu Jan 24 21:29:11 2008 -0400
@@ -277,6 +277,39 @@ int get_key_pinnacle_color(struct IR_i2c
 }
 
 EXPORT_SYMBOL_GPL(get_key_pinnacle_color);
+
+
+static int get_key_geniatech(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
+{
+    unsigned char buf;
+    int code, toggle;
+
+    /* poll IR chip */
+    if (1 != i2c_master_recv(&ir->c,&buf,1))
+        return -EIO;
+
+    code = buf & 0x7f;
+    toggle = (buf >> 7) & 1;
+
+     if ( ir->old == toggle )
+         /* the same key */
+         return 0;
+
+    /* continue only if mod 2 = 1 */         
+    if ( 1 != code % 2 )
+        return 0;
+
+    code = (code - 1) / 2;
+
+    dprintk(1, "DigiStar key=%d\n", code);
+    ir->old  = toggle;
+
+    /* return key */
+    *ir_key = code;
+    *ir_raw = code;
+    return 1;
+}
+
 
 /* ----------------------------------------------------------------------- */
 
@@ -405,6 +438,19 @@ static int ir_attach(struct i2c_adapter 
         ir->get_key = get_key_knc1;
         ir_type     = IR_TYPE_OTHER;
         ir_codes    = ir_codes_empty;
+        break;
+    case 0x33:
+        /* I don't know which other cards have IR under i2c=0x33 but my geniatech has...
+        so I comment this line to prevent compiler warning
+        if (adap->id == I2C_HW_B_CX2388x) { */
+            /* Handled by cx88-input */
+                name        = "DigiStar remote";
+                ir_type     = IR_TYPE_OTHER;
+                ir->get_key = get_key_geniatech;
+                ir_codes    = ir_codes_digistar;
+        /*
+        }
+        */
         break;
     case 0x6b:
         name        = "FusionHDTV";
@@ -528,7 +574,7 @@ static int ir_probe(struct i2c_adapter *
     static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
     static const int probe_saa7134[] = { 0x7a, 0x47, 0x71, 0x2d, -1 };
     static const int probe_em28XX[] = { 0x30, 0x47, -1 };
-    static const int probe_cx88[] = { 0x18, 0x6b, 0x71, -1 };
+    static const int probe_cx88[] = { 0x18, 0x71, 0x33, -1 };
     static const int probe_cx23885[] = { 0x6b, -1 };
     const int *probe = NULL;
     struct i2c_client c;
diff -r 86817d2750b7 linux/include/media/ir-common.h
--- a/linux/include/media/ir-common.h    Fri Jan 18 08:08:21 2008 -0200
+++ b/linux/include/media/ir-common.h    Thu Jan 24 21:29:11 2008 -0400
@@ -141,6 +141,7 @@ extern IR_KEYTAB_TYPE ir_codes_tt_1500[I
 extern IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_fusionhdtv_mce[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_behold[IR_KEYTAB_SIZE];
+extern IR_KEYTAB_TYPE ir_codes_digistar[IR_KEYTAB_SIZE];
 
 #endif
 




      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.linuxtv.org/pipermail/linux-dvb/attachments/20080124/af8f7f2c/attachment.htm 


More information about the linux-dvb mailing list