mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 19:10:52 +07:00
media: lirc: when transmitting scancodes, block until transmit is done
The semantics for lirc IR transmit with raw IR is that the write call should block until the IR is transmitted. Some drivers have no idea when this actually is (e.g. mceusb), so there is a wait. This is useful for userspace, as it might want to send a IR button press, a gap of a predefined number of milliseconds, and then send a repeat message. It turns out that for transmitting scancodes this feature is even more useful, as user space has no idea how long the IR is. So, maintain the existing semantics for IR scancode transmit. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
fb7ccc6180
commit
dde7edff35
@ -60,8 +60,8 @@ When in :ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` mode, one
|
||||
and the protocol in the :c:type:`rc_proto`: member. All other members must be
|
||||
set to 0, else ``EINVAL`` is returned. If there is no protocol encoder
|
||||
for the protocol or the scancode is not valid for the specified protocol,
|
||||
``EINVAL`` is returned. The write function may not wait until the scancode
|
||||
is transmitted.
|
||||
``EINVAL`` is returned. The write function blocks until the scancode
|
||||
is transmitted by the hardware.
|
||||
|
||||
|
||||
Return Value
|
||||
|
@ -354,6 +354,7 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
|
||||
duration += txbuf[i];
|
||||
|
||||
ret *= sizeof(unsigned int);
|
||||
}
|
||||
|
||||
/*
|
||||
* The lircd gap calculation expects the write function to
|
||||
@ -366,7 +367,6 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
schedule_timeout(usecs_to_jiffies(towait));
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
mutex_unlock(&dev->lock);
|
||||
|
Loading…
Reference in New Issue
Block a user