diff options
author | Jarod Wilson <jarod@redhat.com> | 2011-01-06 11:23:13 -0500 |
---|---|---|
committer | Jarod Wilson <jarod@redhat.com> | 2011-01-06 15:13:26 -0500 |
commit | f5f99ef9b8015147c0e8c828ca5488f8babd78b5 (patch) | |
tree | 8d6abf986e07f256b5efb3b2320308254a009de4 | |
parent | ee2bdb0eb2b51e1ff71882cbf503b65dc066ff9c (diff) |
rc/mceusb: timeout should be in ns, not usfor-2.6.37
Fixes an egregious bug in mceusb driver, where the receiver was being
put into idle mode far sooner than it should have, thanks to storing a
timeout value that in us where it should be ns. Basically, the receiver
kept going into idle mode before a trailing space had been fully
received, which was causing problems for some protocols, most notably
manifesting as lirc userspace never receiving a trailing space for any
rc5 signals.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
-rw-r--r-- | drivers/media/IR/mceusb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c index 392ca24132da..ed9572c2f761 100644 --- a/drivers/media/IR/mceusb.c +++ b/drivers/media/IR/mceusb.c @@ -49,7 +49,8 @@ #define USB_BUFLEN 32 /* USB reception buffer length */ #define USB_CTRL_MSG_SZ 2 /* Size of usb ctrl msg on gen1 hw */ #define MCE_G1_INIT_MSGS 40 /* Init messages on gen1 hw to throw out */ -#define MS_TO_NS(msec) ((msec) * 1000) +#define MS_TO_US(msec) ((msec) * 1000) +#define MS_TO_NS(msec) ((msec) * 1000 * 1000) /* MCE constants */ #define MCE_CMDBUF_SIZE 384 /* MCE Command buffer length */ @@ -860,7 +861,7 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) ir->rem--; rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0); rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK) - * MS_TO_NS(MCE_TIME_UNIT); + * MS_TO_US(MCE_TIME_UNIT); dev_dbg(ir->dev, "Storing %s with duration %d\n", rawir.pulse ? "pulse" : "space", |