diff options
author | Anton Blanchard <anton@samba.org> | 2017-05-07 04:00:11 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-06-07 15:40:55 +0300 |
commit | cc20ba4ed8576abfa10a17e81cb4521f474624f0 (patch) | |
tree | 017169855013c31b16c540e13177e44e3ea98dca /drivers/nubus | |
parent | fb3562c81e98e52f6acca2cd7ee36532634ec38e (diff) | |
download | linux-cc20ba4ed8576abfa10a17e81cb4521f474624f0.tar.xz |
[media] ir-spi: Fix issues with lirc API
The ir-spi driver has 2 issues which prevents it from working with
lirc:
1. The ir-spi driver uses 16 bits of SPI data to create one cycle of
the waveform. As such our SPI clock needs to be 16x faster than the
carrier frequency.
The driver is inconsistent in how it currently handles this. It
initializes it to the carrier frequency:
But the commit message has some example code which initialises it
to 16x the carrier frequency:
val = 608000;
ret = ioctl(fd, LIRC_SET_SEND_CARRIER, &val);
To maintain compatibility with lirc, always do the frequency adjustment
in the driver.
2. lirc presents pulses in microseconds, but the ir-spi driver treats
them as cycles of the carrier. Similar to other lirc drivers, do the
conversion with DIV_ROUND_CLOSEST().
Fixes: fe052da49201 ("[media] rc: add support for IR LEDs driven through SPI")
Cc: stable@vger.kernel.org
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/nubus')
0 files changed, 0 insertions, 0 deletions