From: Stefan Lippers-H. <s....@gm...> - 2014-02-12 18:26:57
|
Hi On Wednesday 12 February 2014, Paul D Smith wrote: > Copying to the list "for the record". Like this mail, it was addressed to the list (where ended up[1]) and the original mail author in CC. [...] > > Stefan, > > Apologies since I'm not at all familiar with either the LIRC or Linux > release processes, but can you expand on your comments please? > > Specifically, I'm about to write a new LIRC driver for some new hardware and > want to know where to start. I had started by downloading the 0.9.0 code > from Sourceforge but your commands make me think I'm about to head off in > the wrong direction. [...] In general, lirc supports two different kinds of drivers, userspace drivers (./daemons/) and kernel modules (./drivers/), which one to prefer depends a lot on the kind of IR transceiver you're dealing with. Userspace drivers are probably best submitted to lirc upstream, so they can be integrated here. Kernel modules, like the one Bengt Martensson linked to[2], have traditionally been added to lirc's ./drivers/ directory as out-of-tree modules. However the kernel components of lirc have been merged into the mainline kernel with v2.6.36. Most of the 'legacy' ones only made it into staging[3], where they are maintained under the umbrella of the v4l subsystem, but several have already been ported to the new RC_CORE subsystem. Among these are, for example, mceusb, lirc_i2c --> ir-kbd-i2c and others - in addition to these ports, there've been many new drivers written for the RC_CORE subsystem which have never been supported under lirc before (most of the IR receivers in modern day DVB-[CST] USB cards for example, e.g dvb_usb_af9015, dvb_usb_dw2102, ...). RC_CORE based IR drivers usually support several protocols and modes of operation, taking mceusb as example: $ cat /sys/class/rc/rc0/protocols rc-5 nec rc-6 jvc sony sanyo mce_kbd [lirc] This means that the mceusb device in question has native decoding capabilities for several IR protocols. In other words you can use a (any) RC-6 based remote and your transceiver will emit input events on its own - without the help of lirc. lsinput and ir-keytable can be used to configure your device. As you can see in the protocol list above, the mceusb driver also supports the lirc protocol in addition (the square brackets signify that I've selected this mode of operation here), where the kernel module hands off the IR signal decoding to the lircd dæmon. This allows to use remotes which don't adhere to recognized IR protocols (like RC-5, RC-6, NEC et al). In this mode of operation you can use the traditional lirc userspace (and feed userspace consumers which expect the lirc protocol, e.g. irexec, vdr, ...), irrecord, irw and lircd.conf are the tools of choice here. If you're now starting to write an IR driver for new devices, you definately should target the RC_CORE subsystem (unless you can get away with a userspace driver under ./daemons/), which gets you support for the modern (lirc-less) input event devices and traditional lirc support for free. As an added bonus you now can submit your new RC_CORE based driver to the mainline kernel (via the v4l subsystem), where it will become available to all distributions without further efforts. You can find some of the standalone drivers using RC_CORE under[4], but there are many more 'hidden' among the different DVB-[CST] drivers. For a more general overview of the different driver types supported by lirc (some of which can also be used without lirc, be it through ir-keytable directly or alternative lirc implementations like inputlirc), you may find additional information under [5], although that mail targets a slightly different audience (and is specific to Debian's way of packaging and configuring lirc). Regards Stefan Lippers-Hollmann [1] http://sourceforge.net/mailarchive/message.php?msg_id=31964119 [2] http://harctoolbox.org/lirc_rpi.html [3] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/staging/media/lirc [4] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/media/rc [5] https://lists.debian.org/debian-backports/2012/04/msg00076.html |