Skip to contentSkip to conversation

MSI TV@nywhere A/D (not 1.1!) IR remote control

PATCH New Michal Pastor 1 participant 1 message May 7, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MSI TV@nywhere A/D (not 1.1!) IR remote control

Hi, I just made the IR remote control for MSI TV@nywhere A/D work and I want to test it on some other cards, so I decided to send this patch to this mailing list.

This patch is originally created against kernel sources 2.6.29.1.

I was unable to detect remote, because i2c port is not answering without some inicialization, so I add parameter to module "ir-kbd-i2c". Parameter is called "i2cport" and for my MSI TV@nywhere A/D must be set to "0x0b". (modprobe ir-kbd-i2c i2cport=0x0b) I also added new card type 222 (just for testing) whitch is detected automatically with PCI device 4e42:3306, because this card is supposet to be clone of LifeWiev FlyDVB-T Hybrid, but when I tested some patches for this card, sometimes it doesn't work, so I think, there can be some differences.

So please if you have this card, can you test it and respond? (you can try it with LifeView FlyDVB-T Hybrid too)

Thank all developers of V4L for great work and sorry for my terrible english :)

Mike Fly
Czech republic

media/common/ir-keymaps.c +37 -0
diff -upr drivers/media/common/ir-keymaps.c drivers/media/common/ir-keymaps.c
@@ -2604,3 +2604,41 @@ IR_KEYTAB_TYPE ir_codes_ati_tv_wonder_hd
 };
 
 EXPORT_SYMBOL_GPL(ir_codes_ati_tv_wonder_hd_600);
+
+IR_KEYTAB_TYPE ir_codes_msi_tvanywhere_ad[IR_KEYTAB_SIZE] = {
+       [ 0x00 ] = KEY_POWER,
+       [ 0x01 ] = KEY_F,
+       [ 0x03 ] = KEY_1,
+       [ 0x04 ] = KEY_2,
+       [ 0x05 ] = KEY_3,
+       [ 0x07 ] = KEY_4,
+       [ 0x08 ] = KEY_5,
+       [ 0x09 ] = KEY_6,
+       [ 0x0b ] = KEY_7,
+       [ 0x0c ] = KEY_8,
+       [ 0x0d ] = KEY_9,
+       [ 0x0f ] = KEY_0,
+       [ 0x06 ] = KEY_F1,
+       [ 0x10 ] = KEY_MUTE,
+       [ 0x02 ] = KEY_F2,
+       [ 0x1b ] = KEY_F3,
+       [ 0x12 ] = KEY_UP,
+       [ 0x13 ] = KEY_DOWN,
+       [ 0x17 ] = KEY_LEFT,
+       [ 0x14 ] = KEY_RIGHT,
+       [ 0x1d ] = KEY_ENTER,
+       [ 0x1a ] = KEY_F4,
+       [ 0x18 ] = KEY_F5,
+       [ 0x1e ] = KEY_RECORD,
+       [ 0x15 ] = KEY_F6,
+       [ 0x1c ] = KEY_F7,
+       [ 0x19 ] = KEY_REWIND,
+       [ 0x0a ] = KEY_PAUSE,
+       [ 0x1f ] = KEY_FORWARD,
+       [ 0x16 ] = KEY_BACK,
+       [ 0x11 ] = KEY_STOP,
+       [ 0x0e ] = KEY_END,
+};
+EXPORT_SYMBOL_GPL(ir_codes_msi_tvanywhere_ad);
+
media/video/saa7134/saa7134-cards.c +56 -0

80 lines not on this page · raw message

media/video/saa7134/saa7134-dvb.c +1 -0
diff -upr drivers/media/video/saa7134/saa7134-dvb.c drivers/media/video/saa7134/saa7134-dvb.c
@@ -1109,6 +1109,7 @@ static int dvb_init(struct saa7134_dev *
 		break;
 	case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331:
 	case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS:
+	case SAA7134_BOARD_MSI_TVANYWHERE_AD:
 		fe0->dvb.frontend = dvb_attach(tda10046_attach,
 					       &ads_tech_duo_config,
 					       &dev->i2c_adap);
media/video/saa7134/saa7134-i2c.c +1 -0
diff -upr drivers/media/video/saa7134/saa7134-i2c.c drivers/media/video/saa7134/saa7134-i2c.c
@@ -338,6 +338,7 @@ static int attach_inform(struct i2c_clie
 		case 0x71:
 		case 0x2d:
 		case 0x30:
+		case 0x0b:
 		{
 			struct IR_i2c *ir = i2c_get_clientdata(client);
 			d1printk("%s i2c IR detected (%s).\n",
media/video/saa7134/saa7134-input.c +54 -1

73 lines not on this page · raw message

media/video/saa7134/saa7134.h +1 -0
diff -upr drivers/media/video/saa7134/saa7134.h drivers/media/video/saa7134/saa7134.h
@@ -277,6 +277,7 @@ struct saa7134_format {
 #define SAA7134_BOARD_ASUSTeK_TIGER         152
 #define SAA7134_BOARD_KWORLD_PLUS_TV_ANALOG 153
 #define SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS 154
+#define SAA7134_BOARD_MSI_TVANYWHERE_AD 155
 
 #define SAA7134_MAXBOARDS 32
 #define SAA7134_INPUT_MAX 8
media/ir-common.h +1 -0
diff -upr include/media/ir-common.h include/media/ir-common.h
@@ -159,6 +159,7 @@ extern IR_KEYTAB_TYPE ir_codes_real_audi
 extern IR_KEYTAB_TYPE ir_codes_msi_tvanywhere_plus[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_ati_tv_wonder_hd_600[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE];
+extern IR_KEYTAB_TYPE ir_codes_msi_tvanywhere_ad[IR_KEYTAB_SIZE];
 #endif
 
 /*
drivers/media/video/ir-kbd-i2c.c +19 -2
diff -upr drivers/media/video/ir-kbd-i2c.c drivers/media/video/ir-kbd-i2c.c
@@ -58,6 +58,9 @@ static int hauppauge;
 module_param(hauppauge, int, 0644);    /* Choose Hauppauge remote */
 MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults to 0)");
 
+static int i2cport;
+module_param(i2cport, int, 0644);    /* manual select i2c port */
+MODULE_PARM_DESC(i2cport, 	"Manual select i2c port - can't do probes :(");
 
 #define DEVNAME "ir-kbd-i2c"
 #define dprintk(level, fmt, arg...)	if (debug >= level) \
@@ -303,7 +306,15 @@ static int ir_attach(struct i2c_adapter 
 	ir->c.addr    = addr;
 
 	i2c_set_clientdata(&ir->c, ir);
-
+	
+	if (i2cport != 0){
+	        name        = "MSI TV anywhere A/D";
+	        ir_type     = IR_TYPE_OTHER;
+	        ir_codes    = ir_codes_msi_tvanywhere_ad;
+		
+	}
+	else
+	{
 	switch(addr) {
 	case 0x64:
 		name        = "Pixelview";
@@ -366,6 +377,7 @@ static int ir_attach(struct i2c_adapter 
 		err = -ENODEV;
 		goto err_out_free;
 	}
+	}
 
 	/* Sets name */
 	snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (%s)", name);
@@ -496,7 +508,12 @@ static int ir_probe(struct i2c_adapter *
 			return 0;
 		}
 	}
-
+	/* FOR MSI TV anywhere A/D - setup manually i2c address*/
+	if (i2cport != 0) {
+		printk(DEVNAME ": Using MSI TV @nywhere A/D remote - i2c port: 0x%02x\n", i2cport);
+		ir_attach(adap, i2cport, 0, 0);
+	}
+				
 	/* Special case for MSI TV@nywhere Plus remote */
 	if (adap->id == I2C_HW_SAA7134) {
 		u8 temp;