HOWTO Get SMC FastIR IRDA to work under linuxPosted: 2007-09-28
- Knowledge how to modify module set of kernel or roll your own
- linux 2.6.x
- Laptop with SMC IrDA chip
Many laptops nowadays come with IrDA served through an SMC IrCC SIR/FIR controller. Unfortunately, it’s setup is not done “by default”, leading people to think that IrDA simply doesn’t works. This is not true. Here’s a howto (not full, you have to read your distro’s manuals about how to adapt it to your system. Console commands however are universal on 99% percent of distros)
In order to get it working under linux, you first need to either modify your current kernel or compile a new one, ensuring that it has all IrDA features you want as well as option
CONFIG_SMC_IRCC_FIR=m is set in your kernel config. Make sure it is set for compiling as module, not compiled-in!
After you get all of this compiled with all IrDA tools you have been dying to use ;-), it’s time to load the driver.
So you eagerly try to cast
modprobe smsc-ircc2 spell, only to get the dreaded “No such device” error. But don’t lose hope! It’s just that the driver can’t find your chip – so you need to specify it manually.
So we go for scavenger hunt searching for the lost chip :-)
modinfo smsc-ircc2 will show us what parameters the driver accepts. We are going to specify them by hand, but how?
In order to find required parameters, you have to visit
/sys/bus/acpi and search for a string starting with SMCF.
Or do it Unix way, and invoke
grep FIR /sys/bus/acpi/devices/*/path and it will show you which device is marked as FIR controller. On Ruri (Acer Aspire 5112 WLMi laptop) it yields this:
ruri / # grep FIR /sys/bus/acpi/devices/*/path
ruri / #
It shows us that an ACPI device identified by string “SMCF020:00” is the controller we are looking for. Now it’s time to get it’s parameters.
SMC IR controllers use the same identifier on ACPI bus and PnP bus – so we use the identifier we got in last step to find right device:
ruri / # grep -i 'smcf020' /sys/bus/pnp/devices/*/id
ruri / #
Having found the right device in the tree (in this case, “/sys/bus/pnp/devices/00:0a/”) we read it’s resources from
ruri / # cat /sys/bus/pnp/devices/00\:0a/resources
state = active
ruri / #
As we see, we have the IRQ number, dma channel number and addresses of IO space (or ports). Now we have everything needed. Load the module again, supplying it with manual parameters about your irda controller.
- Put first IO space here, only first address (0x2f8-0x2ff becomes 0x2f8)
- Same as above
- Enter the beginning address of the second IO space
- IRQ number
- DMA channel number
ruri / # modprobe smsc-ircc2 ircc_cfg=0x2f8 ircc_sir=0x2f8 ircc_fir=0x228 ircc_irq=3 ircc_dma=3
You should see now in your logs something like this:
ruri ~ # dmesg|tail
[ 9096.388391] Overriding FIR address 0x0228
[ 9096.388397] Overriding SIR address 0x02f8
[ 9096.388421] SMsC IrDA Controller found
[ 9096.388422] IrCC version 2.0, firport 0x228, sirport 0x2f8 dma=3, irq=3
[ 9096.388520] No transceiver found. Defaulting to Fast pin select
[ 9096.388680] IrDA: Registered device irda0
ruri ~ #
Add your manual options to your distro’s module settings (google for it) and you should beable to use your irda tools normally.