summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJarod Wilson <jarod@redhat.com>2011-01-06 20:59:36 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-01-19 14:45:52 +0100
commit5aad724280b9f8ffff3a55311ef0ba35ebb4099a (patch)
tree0f076e7baaf5d91cbcc6557d4c88208f83402145 /include
parent[media] rc/imon: need to submit urb before ffdc type check (diff)
downloadlinux-5aad724280b9f8ffff3a55311ef0ba35ebb4099a.tar.xz
linux-5aad724280b9f8ffff3a55311ef0ba35ebb4099a.zip
[media] rc: fix up and genericize some time unit conversions
The ene_ir driver was using a private define of MS_TO_NS, which is meant to be microseconds to nanoseconds. The mceusb driver copied it, intending to use is a milliseconds to microseconds. Lets move the defines to a common location, expand and standardize them a touch, so that we now have: MS_TO_NS - milliseconds to nanoseconds MS_TO_US - milliseconds to microseconds US_TO_NS - microseconds to nanoseconds Reported-by: David Härdeman <david@hardeman.nu> CC: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/media/rc-core.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index a23c1fc685a1..2963263f31e2 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -183,6 +183,9 @@ static inline void init_ir_raw_event(struct ir_raw_event *ev)
}
#define IR_MAX_DURATION 0xFFFFFFFF /* a bit more than 4 seconds */
+#define US_TO_NS(usec) ((usec) * 1000)
+#define MS_TO_US(msec) ((msec) * 1000)
+#define MS_TO_NS(msec) ((msec) * 1000 * 1000)
void ir_raw_event_handle(struct rc_dev *dev);
int ir_raw_event_store(struct rc_dev *dev, struct ir_raw_event *ev);