My brand new Thinkpad X120e is working well with Ubuntu Natty. Now I want to get the tp_smapi module to work so I can control battery charge behavior. Unfortunately I get "no Thinkpad embedded controller" (below).

The thinkwiki tp_smapi page says in this case "you should upgrade your BIOS. Some early BIOS (like 1.x on the X31) don't handle the embedded controller". But in my case, dmidecode suggests I'm already using the almost-newest BIOS from IBM.

3 Answers
3

I was able to make this work by editing the source code of thinkpad_ec.c.

The code expects that when you run dmidecode -t 11 your output should mention "IBM ThinkPad Embedded Controller". However, the new Thinkpad X120e has a good embedded controller which is not mentioned under dmidecode -t 11. As a result, the code failed with the error "thinkpad_ec: no ThinkPad embedded controller!".

To sidestep this check, I added ThinkPad X120e to the current list of whitelisted ThinkPad models in thinkpad_ec.c, then rebuilt the module. It loaded successfully and I was able to set my battery's stop-charge-threshold in /sys/devices/platform/smapi/BAT0 as advertised.

If you are a Thinkpad X120e user and want to use tp_smapi module now, here's how I got past the module load failure:

As hwong557 mentions, add tp_smapi to /etc/modules so it will load automatically on boot.

If you are the tp_smapi module maintainer or other knowledgeable person who can get this fixed "right": Is this the "right" fix? Should Thinkpad X120e be permanently added to this whitelist, or is there another way that it should check for existence of the embedded controller? I hope either this change or some other fix for the problem will be added to the upstream source.