linux/drivers/media/rc
Anton Blanchard cc20ba4ed8 [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: fe052da492 ("[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>
2017-06-07 09:40:55 -03:00
..
img-ir [media] rc-core: img-ir - leave the internals of rc_dev alone 2017-06-06 09:08:50 -03:00
keymaps
ati_remote.c [media] rc-core: ati_remote - leave the internals of rc_dev alone 2017-06-06 09:08:10 -03:00
ene_ir.c
ene_ir.h
fintek-cir.c
fintek-cir.h
gpio-ir-recv.c
igorplugusb.c
iguanair.c [media] media drivers: annotate fall-through 2017-05-19 07:10:03 -03:00
imon.c [media] ir-core: fix gcc-7 warning on bool arithmetic 2017-05-19 07:04:45 -03:00
ir-hix5hd2.c
ir-jvc-decoder.c
ir-lirc-codec.c [media] lirc_dev: remove unused set_use_inc/set_use_dec 2017-06-06 09:00:11 -03:00
ir-mce_kbd-decoder.c
ir-nec-decoder.c
ir-rc5-decoder.c
ir-rc6-decoder.c
ir-rx51.c
ir-sanyo-decoder.c
ir-sharp-decoder.c
ir-sony-decoder.c
ir-spi.c [media] ir-spi: Fix issues with lirc API 2017-06-07 09:40:55 -03:00
ir-xmp-decoder.c
ite-cir.c
ite-cir.h
Kconfig [media] rc: fix breakage in "make menuconfig" for media_build 2017-06-06 08:56:31 -03:00
lirc_dev.c [media] lirc_dev: cleanup includes 2017-06-06 09:06:40 -03:00
Makefile [media] rc: promote lirc_sir out of staging 2017-04-05 14:50:57 -03:00
mceusb.c [media] mceusb: drop redundant urb reinitialisation 2017-06-07 09:39:52 -03:00
meson-ir.c [media] rc: meson-ir: switch config to NEC decoding on shutdown 2017-06-06 08:56:32 -03:00
mtk-cir.c
nuvoton-cir.c
nuvoton-cir.h
rc-core-priv.h
rc-ir-raw.c [media] rc-core: race condition during ir_raw_event_register() 2017-06-04 15:25:38 -03:00
rc-loopback.c
rc-main.c [media] rc-core: fix input repeat handling 2017-05-18 06:18:21 -03:00
redrat3.c
serial_ir.c Annotation of module parameters that specify device settings 2017-05-10 19:13:03 -07:00
sir_ir.c [media] sir_ir: remove init_chrdev and init_sir_ir functions 2017-06-06 09:16:16 -03:00
st_rc.c
streamzap.c
sunxi-cir.c
ttusbir.c
winbond-cir.c