Jarod Wilson 49ee500
From: Jarod Wilson <jarod@redhat.com>
Jarod Wilson 49ee500
Date: Sat, 23 Oct 2010 14:54:06 -0400
Jarod Wilson 49ee500
Subject: [PATCH] imon: add back modparam for default protocol
Jarod Wilson 49ee500
Jarod Wilson 49ee500
The latest imon devices support both imon and mce remotes, but we
Jarod Wilson 49ee500
default to using the imon native protocol. Upstream, ir-keytable
Jarod Wilson 49ee500
can be used to change protocol and upload the mce keytable, but it
Jarod Wilson 49ee500
isn't functional with the input layer interfaces in 2.6.35. As a
Jarod Wilson 49ee500
work-around for now, add back a modparam so people can have the
Jarod Wilson 49ee500
driver load the mce keytable by default.
Jarod Wilson 49ee500
Jarod Wilson 49ee500
Note, this patch won't be going upstream. Upstream, we're moving
Jarod Wilson 49ee500
towards all keytables being in userspace, uploaded at driver init
Jarod Wilson 49ee500
time by ir-keytable (triggered by udev events).
Jarod Wilson 49ee500
Jarod Wilson 49ee500
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Jarod Wilson 49ee500
---
Jarod Wilson 49ee500
 drivers/media/rc/imon.c |   14 ++++++++++++++
Jarod Wilson 49ee500
 1 files changed, 14 insertions(+), 0 deletions(-)
Jarod Wilson 49ee500
Jarod Wilson 49ee500
Index: linux-2.6.35.x86_64/drivers/media/rc/imon.c
Jarod Wilson 49ee500
===================================================================
Jarod Wilson 49ee500
--- linux-2.6.35.x86_64.orig/drivers/media/rc/imon.c
Jarod Wilson 49ee500
+++ linux-2.6.35.x86_64/drivers/media/rc/imon.c
Jarod Wilson 49ee500
@@ -328,6 +328,17 @@ MODULE_PARM_DESC(pad_stabilize, "Apply s
Jarod Wilson 49ee500
 		 "presses in arrow key mode. 0=disable, 1=enable (default).");
Jarod Wilson 49ee500
 
Jarod Wilson 49ee500
 /*
Jarod Wilson 49ee500
+ * The latest imon devices support both imon and mce remotes, but we default
Jarod Wilson 49ee500
+ * to using the imon native protocol. Rather than require people to have and
Jarod Wilson 49ee500
+ * run ir-keytable to switch every module load, they can add mce=1 to their
Jarod Wilson 49ee500
+ * modparams to default to mce/rc6 instead.
Jarod Wilson 49ee500
+ */
Jarod Wilson 49ee500
+static bool mce;
Jarod Wilson 49ee500
+module_param(mce, bool, S_IRUGO);
Jarod Wilson 49ee500
+MODULE_PARM_DESC(mce, "Configure for mce/rc6 protocol instead of imon native, "
Jarod Wilson 49ee500
+		 "if supported: 0=no, 1=yes (default: no)");
Jarod Wilson 49ee500
+
Jarod Wilson 49ee500
+/*
Jarod Wilson 49ee500
  * In certain use cases, mouse mode isn't really helpful, and could actually
Jarod Wilson 49ee500
  * cause confusion, so allow disabling it when the IR device is open.
Jarod Wilson 49ee500
  */
Jarod Wilson 49ee500
@@ -1851,6 +1862,9 @@ static struct rc_dev *imon_init_rdev(str
Jarod Wilson 49ee500
 
Jarod Wilson 49ee500
 	imon_set_display_type(ictx);
Jarod Wilson 49ee500
 
Jarod Wilson 49ee500
+	if (mce && ((rdev->allowed_protos & RC_TYPE_RC6) == RC_TYPE_RC6))
Jarod Wilson 49ee500
+		ictx->rc_type = RC_TYPE_RC6;
Jarod Wilson 49ee500
+
Jarod Wilson 49ee500
 	if (ictx->rc_type == RC_TYPE_RC6)
Jarod Wilson 49ee500
 		rdev->map_name = RC_MAP_IMON_MCE;
Jarod Wilson 49ee500
 	else