media: rc: ir-spi: constrain carrier frequency
authorCosmin Tanislav <demonsingur@gmail.com>
Fri, 13 Jun 2025 11:21:52 +0000 (14:21 +0300)
committerHans Verkuil <hverkuil@xs4all.nl>
Mon, 23 Jun 2025 10:11:04 +0000 (12:11 +0200)
commit032a68ccb7834b28d51c11bbfe1c2db02e65ad28
treef3763a7483c51ea48f341839b8020120a7b4068a
parentc898efdd6ecc4a9f9f4d4114370e6ed477f66b8a
media: rc: ir-spi: constrain carrier frequency

Carrier frequency is currently unconstrained, allowing the SPI transfer
to be allocated and filled only for it to be later rejected by the SPI
controller since the frequency is too large.

Add a check to constrain the carrier frequency inside
ir_spi_set_tx_carrier().

Also, move the number of bits per pulse to a macro since it is not used
in multiple places.

Signed-off-by: Cosmin Tanislav <demonsingur@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/rc/ir-spi.c