HOWTO Get SMC FastIR IRDA to work under linux

Requirements:

  • 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 :-)

First, invoking 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
/sys/bus/acpi/devices/SMCF020:00/path:\_SB_.PCI0.LPC0.SIO_.FIR_
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
/sys/bus/pnp/devices/00:0a/id:SMCf020
ruri / #

Having found the right device in the tree (in this case, “/sys/bus/pnp/devices/00:0a/”) we read it’s resources from /resources:

ruri / # cat /sys/bus/pnp/devices/00\:0a/resources
state = active
io 0x2f8-0x2ff
io 0x228-0x22f
irq 3
dma 3
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.

ircc_cfg
Put first IO space here, only first address (0x2f8-0x2ff becomes 0x2f8)
ircc_sir
Same as above
ircc_fir
Enter the beginning address of the second IO space
ircc_irq
IRQ number
ircc_dma
DMA channel number

Example: 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.

Advertisements

4 Comments on “HOWTO Get SMC FastIR IRDA to work under linux”

  1. BigLouis87 says:

    Hi! First of all thanks for your guide, the only which helped me a bit…!
    Following your guide I obtained this:

    state = active
    io 0x2f8-0x2ff
    io 0x6f8-0x6ff
    irq 3
    dma 3

    very similar to your setup. But when I try to load smsc-ircc2 with these parameters, I obtain always the same response:

    FATAL: Error inserting smsc_ircc2 (/lib/modules/2.6.24-20-generic/kernel/drivers/net/irda/smsc-ircc2.ko): No such device

    Please help me!! :( I tried 1000000 guides&forums on the Net, but no one results useful for me…!

    Thanks a lot :)
    BigLouis87

  2. BigLouis87 says:

    …I forgive to say that my laptop is an Acer too, as ruri :D
    In detail it’s an Acer Aspire 5673WLMI
    Bye :)

  3. unya says:

    It seems that there were some changes in the driver in one of the recent kernels, which made it stop working (though it certainly is a better starting place than “It’s not supported” which was the response I got from googling it up before ;-) )

    Since I haven’t used irda recently, I wasn’t stressed to repair it, but I will look into it.

  4. Jeremy Murphy says:

    Thanks for a detailed and informative HOWTO! I was very disappointed when it didn’t work for me. :( I followed the instructions and realised that the resource values that I discovered were the same ones that were being used by default, so that didn’t help. (Admittedly I also could not find a path file containing “FIR”, but I did find an SMCF device.) Anyway, I noticed in the modinfo output that there is also an option to enable PNP detection (nopnp, which is on by default): I turned it on and… voila! And the weird thing is that dmesg shows that it used the same resource values anyway! Presumably, it’s something to do with how my kernel is configured. Hope this information helps someone else. Cheers.

    Jeremy


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s