Skip to contentSkip to conversation

Added support for AVerMedia Cardbus Hybrid remote control

PATCH RESEND In review Oldrich Jedlicka 2 participants 2 messages Feb 11, 2009 – Feb 12, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 Added support for AVerMedia Cardbus Hybrid remote control

Hi,

please have a look at the attached patch.

Thanks,
Oldřich.

# HG changeset patch
# User OldÅ™ich JedliÄ�ka <[email protected]> # Date 1232648889 -3600
# Node ID 2b8e5fc5b41f12950de265a4459dbdeee03f1776 # Parent 66e0b01971de89076fcc9a7ef624b35d5451cbe4 Added support for AVerMedia Cardbus Hybrid remote control

From: OldÅ™ich JedliÄ�ka <[email protected]>

Added support for I2C device at address 0x40 and subaddress 0x0d/0x0b that provides remote control key reading support for AVerMedia Cardbus Hybrid card, possibly for other AVerMedia Cardbus cards.

The I2C address 0x40 doesn't like the SAA7134's 0xfd quirk, so it was disabled.

Priority: normal

linux/drivers/media/common/ir-keymaps.c +59 -0
diff -r 66e0b01971de -r 2b8e5fc5b41f linux/drivers/media/common/ir-keymaps.c
@@ -154,6 +154,65 @@
 };
 EXPORT_SYMBOL_GPL(ir_codes_avermedia_m135a);
 
+/* Oldrich Jedlicka <[email protected]> */
+IR_KEYTAB_TYPE ir_codes_avermedia_cardbus[IR_KEYTAB_SIZE] = {
+	[ 0x00 ] = KEY_POWER,
+	[ 0x01 ] = KEY_TUNER,		/* TV/FM */
+	[ 0x03 ] = KEY_TEXT,		/* Teletext */
+	[ 0x04 ] = KEY_EPG,
+	[ 0x05 ] = KEY_1,
+	[ 0x06 ] = KEY_2,
+	[ 0x07 ] = KEY_3,
+	[ 0x08 ] = KEY_AUDIO,
+	[ 0x09 ] = KEY_4,
+	[ 0x0a ] = KEY_5,
+	[ 0x0b ] = KEY_6,
+	[ 0x0c ] = KEY_ZOOM,		/* Full screen */
+	[ 0x0d ] = KEY_7,
+	[ 0x0e ] = KEY_8,
+	[ 0x0f ] = KEY_9,
+	[ 0x10 ] = KEY_PAGEUP,		/* 16-CH PREV */
+	[ 0x11 ] = KEY_0,
+	[ 0x12 ] = KEY_INFO,
+	[ 0x13 ] = KEY_AGAIN,		/* CH RTN - channel return */
+	[ 0x14 ] = KEY_MUTE,
+	[ 0x15 ] = KEY_EDIT,		/* Autoscan */
+	[ 0x17 ] = KEY_SAVE,		/* Screenshot */
+	[ 0x18 ] = KEY_PLAYPAUSE,
+	[ 0x19 ] = KEY_RECORD,
+	[ 0x1a ] = KEY_PLAY,
+	[ 0x1b ] = KEY_STOP,
+	[ 0x1c ] = KEY_FASTFORWARD,
+	[ 0x1d ] = KEY_REWIND,
+	[ 0x1e ] = KEY_VOLUMEDOWN,
+	[ 0x1f ] = KEY_VOLUMEUP,
+	[ 0x22 ] = KEY_SLEEP,		/* Sleep */
+	[ 0x23 ] = KEY_ZOOM,		/* Aspect */
+	[ 0x26 ] = KEY_SCREEN,		/* Pos */
+	[ 0x27 ] = KEY_ANGLE,		/* Size */
+	[ 0x28 ] = KEY_SELECT,		/* Select */
+	[ 0x29 ] = KEY_BLUE,		/* Blue/Picture */
+	[ 0x2a ] = KEY_BACKSPACE,	/* Back */
+	[ 0x2b ] = KEY_MEDIA,		/* PIP (Picture-in-picture) */
+	[ 0x2c ] = KEY_DOWN,
+	[ 0x2e ] = KEY_DOT,
+	[ 0x2f ] = KEY_TV,		/* Live TV */
+	[ 0x32 ] = KEY_LEFT,
+	[ 0x33 ] = KEY_CLEAR,		/* Clear */
+	[ 0x35 ] = KEY_RED,		/* Red/TV */
+	[ 0x36 ] = KEY_UP,
+	[ 0x37 ] = KEY_HOME,		/* Home */
+	[ 0x39 ] = KEY_GREEN,		/* Green/Video */
+	[ 0x3d ] = KEY_YELLOW,		/* Yellow/Music */
+	[ 0x3e ] = KEY_OK,		/* Ok */
+	[ 0x3f ] = KEY_RIGHT,
+	[ 0x40 ] = KEY_NEXT,		/* Next */
+	[ 0x41 ] = KEY_PREVIOUS,	/* Previous */
+	[ 0x42 ] = KEY_CHANNELDOWN,	/* Channel down */
+	[ 0x43 ] = KEY_CHANNELUP	/* Channel up */
+};
+EXPORT_SYMBOL_GPL(ir_codes_avermedia_cardbus);
+
 /* Attila Kondoros <[email protected]> */
 IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE] = {
 
linux/drivers/media/video/ir-kbd-i2c.c +64 -0

88 lines not on this page · raw message

linux/drivers/media/video/saa7134/saa7134-cards.c +5 -0
diff -r 66e0b01971de -r 2b8e5fc5b41f linux/drivers/media/video/saa7134/saa7134-cards.c
@@ -6120,6 +6120,11 @@
 		msleep(10);
 		break;
 	case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
+		saa7134_set_gpio(dev, 23, 0);
+		msleep(10);
+		saa7134_set_gpio(dev, 23, 1);
+		dev->has_remote = SAA7134_REMOTE_I2C;
+		break;
 	case SAA7134_BOARD_AVERMEDIA_M103:
 		saa7134_set_gpio(dev, 23, 0);
 		msleep(10);
linux/drivers/media/video/saa7134/saa7134-i2c.c +1 -1
diff -r 66e0b01971de -r 2b8e5fc5b41f linux/drivers/media/video/saa7134/saa7134-i2c.c
@@ -260,7 +260,7 @@
 			addr  = msgs[i].addr << 1;
 			if (msgs[i].flags & I2C_M_RD)
 				addr |= 1;
-			if (i > 0 && msgs[i].flags & I2C_M_RD) {
+			if (i > 0 && msgs[i].flags & I2C_M_RD && msgs[i].addr != 0x40) {
 				/* workaround for a saa7134 i2c bug
 				 * needed to talk to the mt352 demux
 				 * thanks to pinnacle for the hint */
linux/include/media/ir-common.h +1 -0
diff -r 66e0b01971de -r 2b8e5fc5b41f linux/include/media/ir-common.h
@@ -111,6 +111,7 @@
 extern IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_avermedia_dvbt[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_avermedia_m135a[IR_KEYTAB_SIZE];
+extern IR_KEYTAB_TYPE ir_codes_avermedia_cardbus[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_pixelview_new[IR_KEYTAB_SIZE];
#1 lore raw
Quoted 8 lines · Oldrich Jedlicka

Hi,

please have a look at the attached patch.

Thanks,
Oldřich.

Hello, Oldrich

I tried to find your patch(this and from 1 Feb) on patchwork.kernel.org and failed :(
Probably this tool doesn't handle attachment patches. So, there is a good hint - it's better to inline text in the body of the emai. It's easier to review them and they didn't lost cos patchwork.kernel.org catches them.
You can find instructions in linux/Documentation/email-clients.txt how to use email-client in this way.

Signature · 1 line
Best regards, Klimov Alexey