From 443b391900469f2c5ec5a354ce305000096a94b7 Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Sat, 4 Jun 2011 14:00:54 -0300 Subject: [media] imon: support for 0x46 0xffdc imon vfd Courtesy of information from Andreas Dick on the lirc list. Signed-off-by: Jarod Wilson Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/imon.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers/media/rc/imon.c') diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 3f3c70716268..43344fd67130 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -307,6 +307,14 @@ static const struct { /* 0xffdc iMON MCE VFD */ { 0x00010000ffffffeell, KEY_VOLUMEUP }, { 0x01000000ffffffeell, KEY_VOLUMEDOWN }, + { 0x00000001ffffffeell, KEY_MUTE }, + { 0x0000000fffffffeell, KEY_MEDIA }, + { 0x00000012ffffffeell, KEY_UP }, + { 0x00000013ffffffeell, KEY_DOWN }, + { 0x00000014ffffffeell, KEY_LEFT }, + { 0x00000015ffffffeell, KEY_RIGHT }, + { 0x00000016ffffffeell, KEY_ENTER }, + { 0x00000017ffffffeell, KEY_ESC }, /* iMON Knob values */ { 0x000100ffffffffeell, KEY_VOLUMEUP }, { 0x010000ffffffffeell, KEY_VOLUMEDOWN }, @@ -1740,6 +1748,7 @@ static void imon_get_ffdc_type(struct imon_context *ictx) detected_display_type = IMON_DISPLAY_TYPE_VFD; break; /* iMON VFD, MCE IR */ + case 0x46: case 0x9e: dev_info(ictx->dev, "0xffdc iMON VFD, MCE IR"); detected_display_type = IMON_DISPLAY_TYPE_VFD; -- cgit v1.2.3 From 94215ccd99eb6e3c8a035c06984630bd7479d963 Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Sat, 4 Jun 2011 14:14:41 -0300 Subject: [media] imon: fix initial panel key repeat suppression As pointed out on the lirc list by Andreas Dick, initial panel key repeat suppression wasn't working, as we had no timevals accumulated until after the first repeat. Also add a missing locking call. Signed-off-by: Jarod Wilson Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/imon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/media/rc/imon.c') diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 43344fd67130..7136582a8573 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -1590,16 +1590,16 @@ static void imon_incoming_packet(struct imon_context *ictx, /* Only panel type events left to process now */ spin_lock_irqsave(&ictx->kc_lock, flags); + do_gettimeofday(&t); /* KEY_MUTE repeats from knob need to be suppressed */ if (ictx->kc == KEY_MUTE && ictx->kc == ictx->last_keycode) { - do_gettimeofday(&t); msec = tv2int(&t, &prev_time); - prev_time = t; if (msec < ictx->idev->rep[REP_DELAY]) { spin_unlock_irqrestore(&ictx->kc_lock, flags); return; } } + prev_time = t; kc = ictx->kc; spin_unlock_irqrestore(&ictx->kc_lock, flags); @@ -1611,7 +1611,9 @@ static void imon_incoming_packet(struct imon_context *ictx, input_report_key(ictx->idev, kc, 0); input_sync(ictx->idev); + spin_lock_irqsave(&ictx->kc_lock, flags); ictx->last_keycode = kc; + spin_unlock_irqrestore(&ictx->kc_lock, flags); return; -- cgit v1.2.3 From 842071c9ea021a42256386cb0cbe3735af33c4db Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Mon, 20 Jun 2011 00:04:05 -0300 Subject: [media] imon: auto-config ffdc 7e device Another device with the 0xffdc device id, this one with 0x7e in the config byte. Its an iMON VFD + RC6 IR, in a CoolerMaster 260 case. Reported-by: Filip Streibl Signed-off-by: Jarod Wilson Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/imon.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media/rc/imon.c') diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 7136582a8573..ba480325851b 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -1751,6 +1751,7 @@ static void imon_get_ffdc_type(struct imon_context *ictx) break; /* iMON VFD, MCE IR */ case 0x46: + case 0x7e: case 0x9e: dev_info(ictx->dev, "0xffdc iMON VFD, MCE IR"); detected_display_type = IMON_DISPLAY_TYPE_VFD; -- cgit v1.2.3 From 372b4249243d1e7c12a0f2b67e7badc608fcff45 Mon Sep 17 00:00:00 2001 From: Jarod Wilson Date: Mon, 20 Jun 2011 00:07:13 -0300 Subject: [media] imon: allow either proto on unknown 0xffdc While 0xffdc devices have their IR protocol hard-coded into the firmware of the device, we have no known way of telling what it is if we don't have the device's config byte already in the driver. Unknown devices default to the imon native protocol, but might actually be rc6, so we should set the driver up such that the user can load the rc6 keytable from userspace and still have a working device ahead of its config byte being added to the driver. Signed-off-by: Jarod Wilson Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/imon.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/media/rc/imon.c') diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index ba480325851b..6bc35eeb653b 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -1767,6 +1767,9 @@ static void imon_get_ffdc_type(struct imon_context *ictx) dev_info(ictx->dev, "Unknown 0xffdc device, " "defaulting to VFD and iMON IR"); detected_display_type = IMON_DISPLAY_TYPE_VFD; + /* We don't know which one it is, allow user to set the + * RC6 one from userspace if OTHER wasn't correct. */ + allowed_protos |= RC_TYPE_RC6; break; } -- cgit v1.2.3