[linux-dvb] [PATCH]: Hauppauge Grey Remote support added

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Description:
For the Hauppauge PVR cards there are at least two different remotes, one 
completly black and one that is Grey and black, they keys differ in values
eg Black remotes 'mute' has the same value as Grey remotes 'menu'.

This patch enables the user to select which keymapping to use by using the 
hauppauge parm. In contrarary to the black remotes keys, all keys are 
mapped for the grey remote and the ATi usb remote mappings has been 
followed.


Signed-off-by: J.O. Aho <trizt@xxxxxxxxx>

---
--- v4l/ir-kbd-i2c.c_org	2006-01-17 12:46:10.000000000 +0100
+++ v4l/ir-kbd-i2c.c	2006-01-17 13:19:26.000000000 +0100
@@ -85,12 +85,62 @@ static IR_KEYTAB_TYPE ir_codes_pv951[IR_
  	[ 28 ] = KEY_MEDIA,             /* PC/TV */
  };

+/* generic RC5 keytable                                          */
+/* Used by the Grey/Black Hauppauge remotes                      */
+/* Key data has been compared with the ATi usb remote            */
+/* No Keys are disabled, compared with ir_codes_rc5_tv which     */
+/* disables half of the keys                                     */
+/*                                    J.O. Aho <trizt@xxxxxxxxx> */
+IR_KEYTAB_TYPE ir_codes_rc5_tv_grey[IR_KEYTAB_SIZE] = {
+        [ 0x00 ] = KEY_KP0,             // 0
+        [ 0x01 ] = KEY_KP1,             // 1
+        [ 0x02 ] = KEY_KP2,             // 2
+        [ 0x03 ] = KEY_KP3,             // 3
+        [ 0x04 ] = KEY_KP4,             // 4
+        [ 0x05 ] = KEY_KP5,             // 5
+        [ 0x06 ] = KEY_KP6,             // 6
+        [ 0x07 ] = KEY_KP7,             // 7
+        [ 0x08 ] = KEY_KP8,             // 8
+        [ 0x09 ] = KEY_KP9,             // 9
+
+        [ 0x0b ] = KEY_R,               // Red Button
+        [ 0x0c ] = KEY_REFRESH,         // Unmarked button on PVR250
+        [ 0x0f ] = KEY_MUTE,            // mute / demute
+        [ 0x0d ] = KEY_MENU,            // display, PVR Menu
+        [ 0x10 ] = KEY_VOLUMEUP,        // volume +
+        [ 0x11 ] = KEY_VOLUMEDOWN,      // volume -
+        [ 0x1e ] = KEY_NEXTSONG,        // Next >>|
+        [ 0x1f ] = KEY_BACKSPACE,       // PVR Back/Exit
+        [ 0x20 ] = KEY_UP,              // channel / program +
+        [ 0x21 ] = KEY_DOWN,            // channel / program -
+        [ 0x24 ] = KEY_PREVIOUSSONG,    // Previous |<<
+        [ 0x25 ] = KEY_ENTER,           // PVR Ok
+        [ 0x29 ] = KEY_B,               // Blue Button
+        [ 0x2e ] = KEY_G,               // Green Button
+        [ 0x30 ] = KEY_PAUSE,           // pause
+        [ 0x32 ] = KEY_LEFT,            // rewind <<
+        [ 0x34 ] = KEY_RIGHT,           // wind >>
+        [ 0x35 ] = KEY_PLAYPAUSE,       // play
+        [ 0x36 ] = KEY_STOP,            // stop
+        [ 0x37 ] = KEY_MEDIA,           // recording
+        [ 0x38 ] = KEY_Y,               // Yellow button
+        [ 0x3b ] = KEY_HOME,            // Go button
+        [ 0x3c ] = KEY_FRONT,           // full
+        [ 0x3d ] = KEY_ESC,             // power (green, left upper corner)
+};
+
  /* ----------------------------------------------------------------------- */
  /* insmod parameters                                                       */

  static int debug;
  module_param(debug, int, 0644);    /* debug level (0,1,2) */

+/*  added option hauppauge and parameter option description                */
+/*                                              J.O. Aho <trizt@xxxxxxxxx> */
+static int hauppauge;
+module_param(hauppauge, int, 0644);    /* 0=black 1=grey */
+
+MODULE_PARM_DESC(hauppauge," 0 = Black remote\t1 = Grey remote");
  #define DEVNAME "ir-kbd-i2c"
  #define dprintk(level, fmt, arg...)	if (debug >= level) \
  	printk(KERN_DEBUG DEVNAME ": " fmt , ## arg)
@@ -346,7 +396,15 @@ static int ir_attach(struct i2c_adapter
  		name        = "Hauppauge";
  		ir->get_key = get_key_haup;
  		ir_type     = IR_TYPE_RC5;
-		ir_codes    = ir_codes_rc5_tv;
+		/* We have two options here black or grey remote */
+		/*                    J.O. Aho <trizt@xxxxxxxxx> */
+		if(hauppauge==0) {
+		   /* We use black remote */
+		   ir_codes    = ir_codes_rc5_tv;
+		} else {
+		   /* We use grey remote  */
+		   ir_codes    = ir_codes_rc5_tv_grey;
+                }
  		break;
  	case 0x30:
  		name        = "KNC One";



[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux