* [PATCH 0/3] imon IR driver fixups
@ 2010-10-23 19:41 Jarod Wilson
2010-10-23 19:42 ` [PATCH 1/3] imon: fix my egregious brown paper bag w/rdev/idev split Jarod Wilson
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jarod Wilson @ 2010-10-23 19:41 UTC (permalink / raw)
To: linux-media
Three minor imon IR driver fixups. Well, the first isn't so minor, since
without it, the imon driver can wedge your system. Getting ir_input_dev
(or at least try to get it) from the mouse input dev instead of the
remote input dev is bad... Then a minor cleanup patch and a modparam
option fixup.
Jarod Wilson (3):
imon: fix my egregious brown paper bag w/rdev/idev split
imon: remove redundant change_protocol call
imon: fix nomouse modprobe option
drivers/media/IR/imon.c | 48 +++++++++++++++++-----------------------------
1 files changed, 18 insertions(+), 30 deletions(-)
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/3] imon: fix my egregious brown paper bag w/rdev/idev split
2010-10-23 19:41 [PATCH 0/3] imon IR driver fixups Jarod Wilson
@ 2010-10-23 19:42 ` Jarod Wilson
2010-10-23 19:42 ` [PATCH 2/3] imon: remove redundant change_protocol call Jarod Wilson
2010-10-23 19:43 ` [PATCH 3/3] imon: fix nomouse modprobe option Jarod Wilson
2 siblings, 0 replies; 4+ messages in thread
From: Jarod Wilson @ 2010-10-23 19:42 UTC (permalink / raw)
To: linux-media
Somehow, I managed to screw things up when reworking the rdev/idev split
patch from David, and started trying to get ir_input_dev from idev
instead of rdev, thus resulting in button presses hanging the system.
This fixes it.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/media/IR/imon.c | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/media/IR/imon.c b/drivers/media/IR/imon.c
index 0391c3b..bcb2826 100644
--- a/drivers/media/IR/imon.c
+++ b/drivers/media/IR/imon.c
@@ -1477,7 +1477,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
bool norelease = false;
int i;
u64 scancode;
- struct input_dev *idev = NULL;
+ struct input_dev *rdev = NULL;
struct ir_input_dev *irdev = NULL;
int press_type = 0;
int msec;
@@ -1485,8 +1485,8 @@ static void imon_incoming_packet(struct imon_context *ictx,
static struct timeval prev_time = { 0, 0 };
u8 ktype;
- idev = ictx->idev;
- irdev = input_get_drvdata(idev);
+ rdev = ictx->rdev;
+ irdev = input_get_drvdata(rdev);
/* filter out junk data on the older 0xffdc imon devices */
if ((buf[0] == 0xff) && (buf[1] == 0xff) && (buf[2] == 0xff))
@@ -1570,8 +1570,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
if (press_type == 0)
ir_keyup(irdev);
else {
- ir_keydown(ictx->rdev, ictx->rc_scancode,
- ictx->rc_toggle);
+ ir_keydown(rdev, ictx->rc_scancode, ictx->rc_toggle);
spin_lock_irqsave(&ictx->kc_lock, flags);
ictx->last_keycode = ictx->kc;
spin_unlock_irqrestore(&ictx->kc_lock, flags);
@@ -1587,7 +1586,7 @@ static void imon_incoming_packet(struct imon_context *ictx,
do_gettimeofday(&t);
msec = tv2int(&t, &prev_time);
prev_time = t;
- if (msec < idev->rep[REP_DELAY]) {
+ if (msec < ictx->idev->rep[REP_DELAY]) {
spin_unlock_irqrestore(&ictx->kc_lock, flags);
return;
}
@@ -1596,12 +1595,12 @@ static void imon_incoming_packet(struct imon_context *ictx,
spin_unlock_irqrestore(&ictx->kc_lock, flags);
- input_report_key(idev, kc, press_type);
- input_sync(idev);
+ input_report_key(ictx->idev, kc, press_type);
+ input_sync(ictx->idev);
/* panel keys don't generate a release */
- input_report_key(idev, kc, 0);
- input_sync(idev);
+ input_report_key(ictx->idev, kc, 0);
+ input_sync(ictx->idev);
ictx->last_keycode = kc;
--
1.7.2.3
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] imon: remove redundant change_protocol call
2010-10-23 19:41 [PATCH 0/3] imon IR driver fixups Jarod Wilson
2010-10-23 19:42 ` [PATCH 1/3] imon: fix my egregious brown paper bag w/rdev/idev split Jarod Wilson
@ 2010-10-23 19:42 ` Jarod Wilson
2010-10-23 19:43 ` [PATCH 3/3] imon: fix nomouse modprobe option Jarod Wilson
2 siblings, 0 replies; 4+ messages in thread
From: Jarod Wilson @ 2010-10-23 19:42 UTC (permalink / raw)
To: linux-media
There was a redundant call to imon_ir_change_protocol -- its already
getting called from ir_input_register. Also do some minor housekeeping
with var names and formatting.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/media/IR/imon.c | 25 +++++++------------------
1 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/drivers/media/IR/imon.c b/drivers/media/IR/imon.c
index bcb2826..b4d489d 100644
--- a/drivers/media/IR/imon.c
+++ b/drivers/media/IR/imon.c
@@ -315,7 +315,7 @@ MODULE_DEVICE_TABLE(usb, imon_usb_id_table);
static bool debug;
module_param(debug, bool, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes(default: no)");
+MODULE_PARM_DESC(debug, "Debug messages: 0=no, 1=yes (default: no)");
/* lcd, vfd, vga or none? should be auto-detected, but can be overridden... */
static int display_type;
@@ -784,7 +784,7 @@ static struct attribute *imon_display_sysfs_entries[] = {
NULL
};
-static struct attribute_group imon_display_attribute_group = {
+static struct attribute_group imon_display_attr_group = {
.attrs = imon_display_sysfs_entries
};
@@ -793,7 +793,7 @@ static struct attribute *imon_rf_sysfs_entries[] = {
NULL
};
-static struct attribute_group imon_rf_attribute_group = {
+static struct attribute_group imon_rf_attr_group = {
.attrs = imon_rf_sysfs_entries
};
@@ -2238,8 +2238,7 @@ static void imon_init_display(struct imon_context *ictx,
dev_dbg(ictx->dev, "Registering iMON display with sysfs\n");
/* set up sysfs entry for built-in clock */
- ret = sysfs_create_group(&intf->dev.kobj,
- &imon_display_attribute_group);
+ ret = sysfs_create_group(&intf->dev.kobj, &imon_display_attr_group);
if (ret)
dev_err(ictx->dev, "Could not create display sysfs "
"entries(%d)", ret);
@@ -2312,7 +2311,7 @@ static int __devinit imon_probe(struct usb_interface *interface,
if (ifnum == 0) {
if (product == 0xffdc && ictx->rf_device) {
sysfs_err = sysfs_create_group(&interface->dev.kobj,
- &imon_rf_attribute_group);
+ &imon_rf_attr_group);
if (sysfs_err)
pr_err("Could not create RF sysfs entries(%d)\n",
sysfs_err);
@@ -2322,14 +2321,6 @@ static int __devinit imon_probe(struct usb_interface *interface,
imon_init_display(ictx, interface);
}
- /* set IR protocol/remote type */
- ret = imon_ir_change_protocol(ictx, ictx->ir_type);
- if (ret) {
- dev_warn(dev, "%s: failed to set IR protocol, falling back "
- "to standard iMON protocol mode\n", __func__);
- ictx->ir_type = IR_TYPE_OTHER;
- }
-
dev_info(dev, "iMON device (%04x:%04x, intf%d) on "
"usb<%d:%d> initialized\n", vendor, product, ifnum,
usbdev->bus->busnum, usbdev->devnum);
@@ -2368,10 +2359,8 @@ static void __devexit imon_disconnect(struct usb_interface *interface)
* sysfs_remove_group is safe to call even if sysfs_create_group
* hasn't been called
*/
- sysfs_remove_group(&interface->dev.kobj,
- &imon_display_attribute_group);
- sysfs_remove_group(&interface->dev.kobj,
- &imon_rf_attribute_group);
+ sysfs_remove_group(&interface->dev.kobj, &imon_display_attr_group);
+ sysfs_remove_group(&interface->dev.kobj, &imon_rf_attr_group);
usb_set_intfdata(interface, NULL);
--
1.7.2.3
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] imon: fix nomouse modprobe option
2010-10-23 19:41 [PATCH 0/3] imon IR driver fixups Jarod Wilson
2010-10-23 19:42 ` [PATCH 1/3] imon: fix my egregious brown paper bag w/rdev/idev split Jarod Wilson
2010-10-23 19:42 ` [PATCH 2/3] imon: remove redundant change_protocol call Jarod Wilson
@ 2010-10-23 19:43 ` Jarod Wilson
2 siblings, 0 replies; 4+ messages in thread
From: Jarod Wilson @ 2010-10-23 19:43 UTC (permalink / raw)
To: linux-media
Pointed out by Bonne Eggleston on the lirc list.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/media/IR/imon.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/IR/imon.c b/drivers/media/IR/imon.c
index b4d489d..f782a9d 100644
--- a/drivers/media/IR/imon.c
+++ b/drivers/media/IR/imon.c
@@ -1004,7 +1004,7 @@ int imon_ir_change_protocol(void *priv, u64 ir_type)
case IR_TYPE_UNKNOWN:
case IR_TYPE_OTHER:
dev_dbg(dev, "Configuring IR receiver for iMON protocol\n");
- if (pad_stabilize)
+ if (pad_stabilize && !nomouse)
pad_mouse = true;
else {
dev_dbg(dev, "PAD stabilize functionality disabled\n");
@@ -1016,7 +1016,7 @@ int imon_ir_change_protocol(void *priv, u64 ir_type)
default:
dev_warn(dev, "Unsupported IR protocol specified, overriding "
"to iMON IR protocol\n");
- if (pad_stabilize)
+ if (pad_stabilize && !nomouse)
pad_mouse = true;
else {
dev_dbg(dev, "PAD stabilize functionality disabled\n");
--
1.7.2.3
--
Jarod Wilson
jarod@redhat.com
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-23 19:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-23 19:41 [PATCH 0/3] imon IR driver fixups Jarod Wilson
2010-10-23 19:42 ` [PATCH 1/3] imon: fix my egregious brown paper bag w/rdev/idev split Jarod Wilson
2010-10-23 19:42 ` [PATCH 2/3] imon: remove redundant change_protocol call Jarod Wilson
2010-10-23 19:43 ` [PATCH 3/3] imon: fix nomouse modprobe option Jarod Wilson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.