diff options
Diffstat (limited to 'drivers/media/rc/streamzap.c')
-rw-r--r-- | drivers/media/rc/streamzap.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index 6e2911c2abfb..e435d94c0776 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c | |||
@@ -164,7 +164,7 @@ static void sz_push_full_pulse(struct streamzap_ir *sz, | |||
164 | sz->signal_start.tv_usec - | 164 | sz->signal_start.tv_usec - |
165 | sz->signal_last.tv_usec); | 165 | sz->signal_last.tv_usec); |
166 | rawir.duration -= sz->sum; | 166 | rawir.duration -= sz->sum; |
167 | rawir.duration *= 1000; | 167 | rawir.duration = US_TO_NS(rawir.duration); |
168 | rawir.duration &= IR_MAX_DURATION; | 168 | rawir.duration &= IR_MAX_DURATION; |
169 | } | 169 | } |
170 | sz_push(sz, rawir); | 170 | sz_push(sz, rawir); |
@@ -177,7 +177,7 @@ static void sz_push_full_pulse(struct streamzap_ir *sz, | |||
177 | rawir.duration = ((int) value) * SZ_RESOLUTION; | 177 | rawir.duration = ((int) value) * SZ_RESOLUTION; |
178 | rawir.duration += SZ_RESOLUTION / 2; | 178 | rawir.duration += SZ_RESOLUTION / 2; |
179 | sz->sum += rawir.duration; | 179 | sz->sum += rawir.duration; |
180 | rawir.duration *= 1000; | 180 | rawir.duration = US_TO_NS(rawir.duration); |
181 | rawir.duration &= IR_MAX_DURATION; | 181 | rawir.duration &= IR_MAX_DURATION; |
182 | sz_push(sz, rawir); | 182 | sz_push(sz, rawir); |
183 | } | 183 | } |
@@ -197,7 +197,7 @@ static void sz_push_full_space(struct streamzap_ir *sz, | |||
197 | rawir.duration = ((int) value) * SZ_RESOLUTION; | 197 | rawir.duration = ((int) value) * SZ_RESOLUTION; |
198 | rawir.duration += SZ_RESOLUTION / 2; | 198 | rawir.duration += SZ_RESOLUTION / 2; |
199 | sz->sum += rawir.duration; | 199 | sz->sum += rawir.duration; |
200 | rawir.duration *= 1000; | 200 | rawir.duration = US_TO_NS(rawir.duration); |
201 | sz_push(sz, rawir); | 201 | sz_push(sz, rawir); |
202 | } | 202 | } |
203 | 203 | ||
@@ -273,6 +273,7 @@ static void streamzap_callback(struct urb *urb) | |||
273 | if (sz->timeout_enabled) | 273 | if (sz->timeout_enabled) |
274 | sz_push(sz, rawir); | 274 | sz_push(sz, rawir); |
275 | ir_raw_event_handle(sz->rdev); | 275 | ir_raw_event_handle(sz->rdev); |
276 | ir_raw_event_reset(sz->rdev); | ||
276 | } else { | 277 | } else { |
277 | sz_push_full_space(sz, sz->buf_in[i]); | 278 | sz_push_full_space(sz, sz->buf_in[i]); |
278 | } | 279 | } |
@@ -290,6 +291,7 @@ static void streamzap_callback(struct urb *urb) | |||
290 | } | 291 | } |
291 | } | 292 | } |
292 | 293 | ||
294 | ir_raw_event_handle(sz->rdev); | ||
293 | usb_submit_urb(urb, GFP_ATOMIC); | 295 | usb_submit_urb(urb, GFP_ATOMIC); |
294 | 296 | ||
295 | return; | 297 | return; |
@@ -430,13 +432,13 @@ static int __devinit streamzap_probe(struct usb_interface *intf, | |||
430 | sz->decoder_state = PulseSpace; | 432 | sz->decoder_state = PulseSpace; |
431 | /* FIXME: don't yet have a way to set this */ | 433 | /* FIXME: don't yet have a way to set this */ |
432 | sz->timeout_enabled = true; | 434 | sz->timeout_enabled = true; |
433 | sz->rdev->timeout = (((SZ_TIMEOUT * SZ_RESOLUTION * 1000) & | 435 | sz->rdev->timeout = ((US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION) & |
434 | IR_MAX_DURATION) | 0x03000000); | 436 | IR_MAX_DURATION) | 0x03000000); |
435 | #if 0 | 437 | #if 0 |
436 | /* not yet supported, depends on patches from maxim */ | 438 | /* not yet supported, depends on patches from maxim */ |
437 | /* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */ | 439 | /* see also: LIRC_GET_REC_RESOLUTION and LIRC_SET_REC_TIMEOUT */ |
438 | sz->min_timeout = SZ_TIMEOUT * SZ_RESOLUTION * 1000; | 440 | sz->min_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION); |
439 | sz->max_timeout = SZ_TIMEOUT * SZ_RESOLUTION * 1000; | 441 | sz->max_timeout = US_TO_NS(SZ_TIMEOUT * SZ_RESOLUTION); |
440 | #endif | 442 | #endif |
441 | 443 | ||
442 | do_gettimeofday(&sz->signal_start); | 444 | do_gettimeofday(&sz->signal_start); |