Prechádzať zdrojové kódy

V4L/DVB (3395): Hauppauge Grey Remote support

- 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 enables the user to select which keymapping to use by using the
  hauppauge parm. Unlike to the black remote keys, all keys are
  mapped for the grey remote and the ATi usb remote mappings has been
  followed.

Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
J.O. Aho 20 rokov pred
rodič
commit
bf47e4e43e
1 zmenil súbory, kde vykonal 10 pridanie a 1 odobranie
  1. 10 1
      drivers/media/video/ir-kbd-i2c.c

+ 10 - 1
drivers/media/video/ir-kbd-i2c.c

@@ -89,6 +89,11 @@ static IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE] = {
 static int debug;
 static int debug;
 module_param(debug, int, 0644);    /* debug level (0,1,2) */
 module_param(debug, int, 0644);    /* debug level (0,1,2) */
 
 
+static int hauppauge = 0;
+module_param(hauppauge, int, 0644);    /* Choose Hauppauge remote */
+MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults to 0)");
+
+
 #define DEVNAME "ir-kbd-i2c"
 #define DEVNAME "ir-kbd-i2c"
 #define dprintk(level, fmt, arg...)	if (debug >= level) \
 #define dprintk(level, fmt, arg...)	if (debug >= level) \
 	printk(KERN_DEBUG DEVNAME ": " fmt , ## arg)
 	printk(KERN_DEBUG DEVNAME ": " fmt , ## arg)
@@ -336,7 +341,11 @@ static int ir_attach(struct i2c_adapter *adap, int addr,
 		name        = "Hauppauge";
 		name        = "Hauppauge";
 		ir->get_key = get_key_haup;
 		ir->get_key = get_key_haup;
 		ir_type     = IR_TYPE_RC5;
 		ir_type     = IR_TYPE_RC5;
-		ir_codes    = ir_codes_rc5_tv;
+		if (hauppauge == 1) {
+			ir_codes    = ir_codes_rc5_tv_grey;
+		} else {
+			ir_codes    = ir_codes_rc5_tv;
+		}
 		break;
 		break;
 	case 0x30:
 	case 0x30:
 		name        = "KNC One";
 		name        = "KNC One";