diff options
author | David Härdeman <david@hardeman.nu> | 2011-04-28 11:14:03 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-13 19:59:41 -0300 |
commit | f8e00d5fa86fbc4462647da162152d4e74db784c (patch) | |
tree | 142c42d64707914aea0b6194322c3cd6db47c9c3 /drivers/media/rc/rc-loopback.c | |
parent | 0a67fe458471cc13adeb0e10694e10674bf383eb (diff) | |
download | linux-exynos-f8e00d5fa86fbc4462647da162152d4e74db784c.tar.gz linux-exynos-f8e00d5fa86fbc4462647da162152d4e74db784c.tar.bz2 linux-exynos-f8e00d5fa86fbc4462647da162152d4e74db784c.zip |
[media] rc-core: move timeout and checks to lirc
The lirc TX functionality expects the process which writes (TX) data to
the lirc dev to sleep until the actual data has been transmitted by the
hardware.
Since the same timeout calculation is duplicated in more than one driver
(and would have to be duplicated in even more drivers as they gain TX
support), it makes sense to move this timeout calculation to the lirc
layer instead.
At the same time, centralize some of the sanity checks.
Signed-off-by: David Härdeman <david@hardeman.nu>
Cc: Jarod Wilson <jwilson@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/rc-loopback.c')
-rw-r--r-- | drivers/media/rc/rc-loopback.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/drivers/media/rc/rc-loopback.c b/drivers/media/rc/rc-loopback.c index fae1615e0ff2..f9be68132c67 100644 --- a/drivers/media/rc/rc-loopback.c +++ b/drivers/media/rc/rc-loopback.c @@ -105,18 +105,9 @@ static int loop_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count) { struct loopback_dev *lodev = dev->priv; u32 rxmask; - unsigned total_duration = 0; unsigned i; DEFINE_IR_RAW_EVENT(rawir); - for (i = 0; i < count; i++) - total_duration += abs(txbuf[i]); - - if (total_duration == 0) { - dprintk("invalid tx data, total duration zero\n"); - return -EINVAL; - } - if (lodev->txcarrier < lodev->rxcarriermin || lodev->txcarrier > lodev->rxcarriermax) { dprintk("ignoring tx, carrier out of range\n"); @@ -148,9 +139,6 @@ static int loop_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned count) ir_raw_event_handle(dev); out: - /* Lirc expects this function to take as long as the total duration */ - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(usecs_to_jiffies(total_duration)); return count; } |