jetson tk1 lirc_serial not working

I am trying to get the kernel module lirc_serial to work.
But when I

modprobe lirc_serial io=0x70006040 irq=69

I get the message

[  332.343963] lirc_dev: IR Remote Control driver registered, major 239 
[  332.351853] lirc_serial lirc_serial.0: port 70006040 already in use (0)
[  332.424269] lirc_serial lirc_serial.0: use 'setserial /dev/ttySX uart none'
[  332.424315] lirc_serial lirc_serial.0: or compile the serial port driver as module and
[  332.425659] lirc_serial lirc_serial.0: make sure this module is loaded first
[  332.425775] lirc_serial: probe of lirc_serial.0 failed with error -16

I tried to use

setserial /dev/ttyTHS1 uart none

but it failes with:

Cannot set serial info: Invalid argument

I am not using /dev/ttyTHS1 as console (from bootargs or by init scripts). So it should
not be in use.


Without first trying your own module (we want to see what is there before your module load attempt), run this:

sudo -s
cat `find -L /sys/class/tty -maxdepth 2 -name irq 2>/dev/null`
find -L /sys/class/tty -maxdepth 2 -name irq 2>/dev/null

If your IRQ 69 shows up, then there was something already using it. This is likely. The second “find” statement lists the order of showing the IRQs from the first find statement, so if your IRQ is next to last, then the device with that irq is also next to last in listed devices. The default on the Jetson I’m testing is ttyTHS1 using IRQ 69. Trying to load a module naming IRQ 69 would not work without first disabling ttyTHS1…or possibly your module can attach to an existing configured serial port, it might just be able to use ttyTHS1. The current ttyTHS1 settings are seen via:

setserial -a /dev/ttyTHS1

…sorry, I don’t know anything about remote control configuration.

Thank you for the quick reply. ttyTHS1 is using the IRQ.
Anyway I switched to another module (lirc_rpi with minor changes) for remote control that uses gpio. This is working so I don’t need to bother with lirc_serial anymore. Just out of interest, would it be sufficient to switch off ttyTHS1 in .dtb?

I do not know if that would be enough. The dtb sets up some of the controller registers at times, but the registers have defaults as well. Then there are the kernel drivers…they may try to use a serial port, even if the port is configured wrong for the kernel driver…the effect could be none at all or crash. I think it would be more of a case of “try it and find out” for each individual part of hardware.