Have a tv tuner believe to be sinovideo 1300, and the remote has h-338 in the
back, the tuner is detected as saa7134 proteus 2309, and working fine, the
patch is for the remote.
following buttons supposed to be working: all the number button, channel up and
down, volumn up and down, off, mute, full screen, recall, snapshot, tv. Some
buttons do not have valid entry for tvtime, so I did not map them(record, stop
...)
to apply, use command
modprobe saa7134 card=157
if it does not work, use
modprobe saa7134 card=157 ir_debug=1
and send me(yahoo.com) the output of dmesg(after modprobe and after a button is
pressed)
--- a/include/media/ir-common.h2009-07-08 19:28:50.0 -0400
+++ b/include/media/ir-common.h2009-07-16 01:37:41.0 -0400
@@ -162,6 +162,7 @@
extern IR_KEYTAB_TYPE ir_codes_kworld_plus_tv_analog[IR_KEYTAB_SIZE];
extern IR_KEYTAB_TYPE ir_codes_kaiomy[IR_KEYTAB_SIZE];
extern IR_KEYTAB_TYPE ir_codes_dm1105_nec[IR_KEYTAB_SIZE];
+extern IR_KEYTAB_TYPE ir_codes_sinovideo_1300[IR_KEYTAB_SIZE];
#endif
/*
--- a/drivers/media/common/ir-keymaps.c2009-07-08 19:28:49.0 -0400
+++ b/drivers/media/common/ir-keymaps.c2009-07-16 13:17:30.0 -0400
@@ -62,6 +62,38 @@
};
EXPORT_SYMBOL_GPL(ir_codes_proteus_2309);
+
+IR_KEYTAB_TYPE ir_codes_sinovideo_1300[IR_KEYTAB_SIZE] = {
+/* numeric */
+[ 0x00 ] = KEY_0,
+[ 0x01 ] = KEY_1,
+[ 0x02 ] = KEY_2,
+[ 0x03 ] = KEY_3,
+[ 0x04 ] = KEY_4,
+[ 0x05 ] = KEY_5,
+[ 0x06 ] = KEY_6,
+[ 0x07 ] = KEY_7,
+[ 0x08 ] = KEY_8,
+[ 0x09 ] = KEY_9,
+
+[ 0x5c ] = KEY_POWER, /* power */
+[ 0x20 ] = KEY_F, /* full screen */
+[ 0x0f ] = KEY_BACKSPACE, /* recall */
+[ 0x1b ] = KEY_M, /* mute*/
+[ 0x41 ] = KEY_RECORD,/* record */
+[ 0x43 ] = KEY_STOP, /* stop*/
+[ 0x16 ] = KEY_S, /* snapshot*/
+[ 0x1a ] = KEY_Q, /* off */
+[ 0x2e ] = KEY_RED,
+[ 0x1f ] = KEY_DOWN, /* channel - */
+[ 0x1c ] = KEY_UP,/* channel + */
+[ 0x10 ] = KEY_LEFT, /* volume -*/
+[ 0x1e ] = KEY_RIGHT, /* volume +*/
+[ 0x14 ] = KEY_F1,
+[ 0x15 ] = KEY_I, /* tv */
+};
+
+EXPORT_SYMBOL_GPL(ir_codes_sinovideo_1300);
/* Matt Jesson has_remote = SAA7134_REMOTE_GPIO;
break;
case SAA7134_BOARD_FLYDVBS_LR300:
--- a/drivers/media/video/saa7134/saa7134.h2009-07-08 19:28:49.0
-0400
+++ b/drivers/media/video/saa7134/saa7134.h2009-07-16 15:31:54.0
-0400
@@ -280,6 +280,7 @@
#define SAA7134_BOARD_AVERMEDIA_GO_007_FM_PLUS 154
#define SAA7134_BOARD_HAUPPAUGE_HVR1120 155
#define SAA7134_BOARD_HAUPPAUGE_HVR1110R3 156
+#define SAA7134_BOARD_SINOVIDEO_1300 157
#define SAA7134_MAXBOARDS 32
#define SAA7134_INPUT_MAX 8
--- a/drivers/media/video/saa7134/saa7134-input.c2009-03-23
19:12:14.0 -0400
+++ b/drivers/media/video/saa7134/saa7134-input.c2009-07-16
15:08:50.0 -0400
@@ -67,6 +67,7 @@
static int saa7134_nec_irq(struct saa7134_dev *dev);
static void nec_task(unsigned long data);
static void saa7134_nec_timer(unsigned long data);
+static void ir_sv_timer_end(unsigned long data);
/* GPIO generic keycode builder */
@@ -367,7 +368,10 @@
} else if (ir->rc5_gpio) {
/* set timer_end for code completion */
init_timer(&ir->timer_end);
-ir->timer_end.function = ir_rc5_timer_end;
+if (dev->board == SAA7134_BOARD_SINOVIDEO_1300)
+ir->timer_end.function = ir_sv_timer_end;
+else
+ir->timer_end.function = ir_rc5_timer_end;
ir->timer_end.data = (unsigned long)ir;
init_timer(&ir->timer_keyup);
ir->timer_keyup.function = ir_rc5_timer_keyup;
@@ -601,6 +605,13 @@
mask_keycode = 0x7f;
polling = 40; /* ms */
break;
+case SAA7134_BOARD_SINOVIDEO_1300:
+ir_codes = ir_codes_sinovideo_1300;
+mask_keycode = 0x7F;
+mask_keyup = 0x04;
+rc5_gpio = 1;
+ir_rc5_remote_gap = 1125;
+break;
}
if (NULL == ir_codes) {
printk("%s: Oops: IR config error [card=%d]\n",
@@ -748,6 +759,7 @@
tv.tv_usec - ir->base_time.tv_usec;
}
+dprintk("gap is %d\n", gap);
/* active code => add bit */
if (ir->active) {
/* only if in the code (otherwise spurious IRQ or timer
@@ -764,7 +776,10 @@
ir->base_time = tv;
ir->last_bit = 0;
-timeout = current_jiffies + (500 + 30 * HZ) / 1000;
+if (dev->board == SAA7134_BOARD_SINOVIDEO_1300)
+timeout = current_jiffies + (500 + 35 * HZ) / 1000;
+else
+timeout = current_jiffies + (500 + 30 * HZ) / 1000;
mod_timer(&ir->timer_end, timeout);
}
@@ -893,3 +908,140 @@
return 1;
}
+
+static u32 ir_sv_decode(un