<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Runia</id>
	<title>ThinkWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.thinkwiki.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Runia"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/wiki/Special:Contributions/Runia"/>
	<updated>2026-04-30T09:21:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Talk:Tp_smapi&amp;diff=36466</id>
		<title>Talk:Tp smapi</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Talk:Tp_smapi&amp;diff=36466"/>
		<updated>2008-02-15T15:05:40Z</updated>

		<summary type="html">&lt;p&gt;Runia: add: comment to smapi/hdaps kernel oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Feedback ==&lt;br /&gt;
&lt;br /&gt;
Great, great work! Really! This completely rocks. I just stopped my battery from charging at 77% and restarted charging a bit later, no problems whatsoever. BTW, this is on kernel 2.6.14.3.&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 21:25, 5 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
None of the fuctions is working on my T40, kernel 2.6.14-mm2.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lammic|lammic]], 2005.12.05&lt;br /&gt;
&lt;br /&gt;
Works for me on a T41 running 2.6.12-10-686 (Ubuntu 5.10).&lt;br /&gt;
&lt;br /&gt;
--[[User:berndtnm|berndtnm]], 2005.12.06&lt;br /&gt;
&lt;br /&gt;
Including stop_charge_thresh? That one seems to be missing on the T42p.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 00:46, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
tp_smapi works just fine on an R52 with Ubuntu Breezy stock kernel.&lt;br /&gt;
&lt;br /&gt;
--[[User:Micampe|Micampe]] 12:52, 7 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
''To set the thresholds for starting and stopping battery charging (in percent of current capacity):''&lt;br /&gt;
&lt;br /&gt;
'''current''' really? That'd be weird, I'd expect it to be percent of '''total''' capacity.&lt;br /&gt;
&lt;br /&gt;
--[[User:Micampe|Micampe]] 14:39, 7 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Current full charge capacity&amp;quot;, as opposed to &amp;quot;current remaining capacity&amp;quot; or &amp;quot;designed full charge capacity&amp;quot;...&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 15:05, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Battery features don't work with my T41p. I can't check this with windows. Can anybody try these features?&lt;br /&gt;
&lt;br /&gt;
-- Nils, 7 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nils, does cdrom_speed work for you on the T41p? Could you provide the details requested in the README (dmesg etc.)?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:57, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
CDRom Speed seems to work. (I see no warnings, but I have to do a speed test.) Now, I've send all outputs to the email-address in the readme.&lt;br /&gt;
&lt;br /&gt;
-- Nils, 8 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
All the features except the stop_charge_thresh seem to work here on a t42p. &lt;br /&gt;
One note, the start_charge_thresh seems to really be stop_charge_thresh. Ie, If I set that to lower than my current battery %, it will never charge, &lt;br /&gt;
and if I set it to 100 the battery charges all the way. &lt;br /&gt;
&lt;br /&gt;
--[[User:Nirik|Nirik]] 16 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nirik, &amp;quot;all the features&amp;quot; as of which version? For example, do the force_discharge{1,2} in tp_smapi 0.12 also work for you? See the table in the article page. About start_charge, that's odd. Can you send me a log of what you did, what was the result a what was the dmesg output for each operation?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 14:16, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
System T40p:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# echo 1 &amp;gt; /sys/devices/platform/smapi/BAT0/force_discharge1&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# echo 1 &amp;gt; /sys/devices/platform/smapi/BAT0/force_discharge2&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# dmesg   &lt;br /&gt;
tp_smapi: req_in: BX=2118 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=8680 BX=2118 CX=100 DX=b2 DI=0 SI=0 ret=-38&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge1 of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: req_in: BX=2104 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=80 BX=2103 CX=100 DX=78 DI=0 SI=0 ret=0&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 0: bx=2103&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So it seems force_discharge1 is not supported at all. But force_discharge2? By the way, i think wiki is a _very_ good idea for collecting information, but not for discussion. I would prefer a maillinglist. We can use sourceforge.&lt;br /&gt;
&lt;br /&gt;
--[[User|StefanSchmidt]]&lt;br /&gt;
&lt;br /&gt;
force_discharge2 is indicating a real error condition (bx=2103 which has bit 0x02 on), but I have no idea what the error is or how to fix it. Sorry. If you can trigger this function under Windows and have SoftICE or equivalent, maybe it can be worked out.&lt;br /&gt;
&lt;br /&gt;
About the Wiki discussion, I'm not sure a mailing list is justified yet, but you can use the linux-thinkpad list or the e-mail address in the README. &lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:42, 16 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
OK, then i use linux-thinkpad to get more people involved. I'am away the next weeks, but i hope to find some time to hacking on tp_smapi.&lt;br /&gt;
&lt;br /&gt;
--[[User:StefanSchmidt]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Someone reported cd_speed works on T42 but on mine, it doesn't: this is 2378DXU&lt;br /&gt;
&lt;br /&gt;
--[[User:eBug]] 22:55, 17 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
eBug, how does it fail? If the file doesn't exist, it means you didn't enable PROVIDE_CD_SPEED (see the README). If it does exist, can you provide the dmesg output when you read an write to the file?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 11:53, 18 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To confirm:&lt;br /&gt;
tp_smapi 0.13 works with hdaps module loaded on T41 (2373-8RG). However, force_discharge*, inhibit_charge_minutes, start_charge_thresh, stop_charge_thresh don't seem to be implemented on this model.&lt;br /&gt;
&lt;br /&gt;
--[[User:LJSBRokken|LJSBrokken]] 21 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
tp_smapi version 0.13 with T23 (2647-3QG) (I have dual batteries)...&lt;br /&gt;
&lt;br /&gt;
None of the functions which make any changes work...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /sys/devices/platform/smapi &amp;amp;&amp;amp; cat BAT*/* &amp;gt; /dev/null&lt;br /&gt;
cat: BAT0/force_discharge1: Function not implemented&lt;br /&gt;
cat: BAT0/force_discharge2: Input/output error&lt;br /&gt;
cat: BAT0/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT0/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT0/stop_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge1: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge2: Input/output error&lt;br /&gt;
cat: BAT1/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT1/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/stop_charge_thresh: Function not implemented&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, all the battery status information is available, and functions appear for both BAT0 and BAT1, regardless of when the UltraBay battery was inserted or ejected- this is very useful, it is the only way I can monitor my UltraBay battery unless it was present on boot.&lt;br /&gt;
&lt;br /&gt;
--[[User:SystemParadox|SystemParadox]] 21:51, 4 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
SystemParadox, what's the dmesg output produced by &amp;quot;cat BAT0/force_discharge2&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 22:02, 4 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
After the upgrade to 0.14 (with kernel 2.6.15, using the patch) I can't use inhibit_charge and start/stop_charge_thresh any longer (getting an input/output error), the dmesg debug output when {{cmd|cat|}}-ing those three files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: tp_smapi 0.14 loading...&lt;br /&gt;
tp_smapi: successfully loaded (smapi_port=0xb2).&lt;br /&gt;
tp_smapi: req_in: BX=2114 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=ea210080 BX=ec192114 CX=c18d0700 DX=f7cc00b2 DI=f7f50000 SI=c18d0000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Unknown error code&lt;br /&gt;
tp_smapi: req_in: BX=2116 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=c03b0080 BX=c18d2116 CX=c0160328 DX=ec7600b2 DI=ec760000 SI=a0810000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Unknown error code&lt;br /&gt;
tp_smapi: req_in: BX=211a CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=c03b0080 BX=c18d211a CX=c016032c DX=eb4500b2 DI=eb450000 SI=241e0000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Unknown error code&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 08:12, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Oops, the transition to 32-bit SMAPI calls was broken. Fixed in 0.15. Thanks for the quick report!&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:10, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Yep, 0.15 works again. Quick response, bravo! :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 12:23, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
On a T22, nothing seems to work with 0.16.&lt;br /&gt;
&lt;br /&gt;
[[http://www.rafb.net/paste/results/fcUUDs49.html|dmesg output]] when doing cat *&lt;br /&gt;
&lt;br /&gt;
I am using an Ultrabay2000 battery, so it would be really usefull to be able to control that&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Not even the extended battery status? That does work on T23. About the control features, I believe they're not available on the T23; did you have any kind of (dis)charge control under WindowS?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:59, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I don't really know what 'extended battery' status means, but here an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat current_*                                                     /sys/devices/platform/smapi/BAT1&lt;br /&gt;
cat: current_avg: Input/output error&lt;br /&gt;
cat: current_now: Input/output error&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is what happens when i cat any file in this directory and also in ../BAT1 :(&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Thu Jan 12 22:07:26 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Yes, that's what I meant. What's the {{cmdroot|dmesg}} output generated by these commands?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 00:27, 13 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thinker: I attached some link to my first comment but it seems to be down and the link was wrong anyway.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Fri Jan 13 14:35:57 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Thanks; but there's not much we can do. Maybe the T22 uses a different interface, or doesn't have that feature.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 23:23, 15 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thinker: Is there anything I can do to check if the interface is different? Changing 0x1610 to some random number?&lt;br /&gt;
&lt;br /&gt;
Is there a chance to get it by try and error?&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Mon Jan 16 19:10:12 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
0x1610 is the number of an IO port it writes to, so changing it to a random number will pretty much guarantee a system crash...&lt;br /&gt;
&lt;br /&gt;
The only way I can think of for figuring out the T22 interface is to see what the Windows software does.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 19:47, 16 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I have a R40 (2722-B3G), and several things don't work with 0.16 on linux 2.6.15.1:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't know about Windows, haven't booted it for weeks nor used it for years...&lt;br /&gt;
&lt;br /&gt;
--[[User:Wonka|Wonka]] 19:00, 19 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Wonka: do the other features (i.e., extended battery status) work on your R40?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:30, 20 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
--[[User:lisch|lisch]] 16:14, 11 April 2006 (CDT)&lt;br /&gt;
&lt;br /&gt;
On my X32, with two batteries, I get just what I expect. Looks good:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ cat BAT?/* &amp;gt; /dev/null&lt;br /&gt;
cat: BAT0/force_discharge: Function not implemented&lt;br /&gt;
cat: BAT0/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT0/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT0/stop_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge: Function not implemented&lt;br /&gt;
cat: BAT1/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT1/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/stop_charge_thresh: Function not implemented&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Changing the CD speed when the CD is being accessed will hang your computer==&lt;br /&gt;
&lt;br /&gt;
I don't have this problem on my T40p. CDROM is mounted and file on CD is opened. Change speed do '''not''' hang my system.&lt;br /&gt;
&lt;br /&gt;
-- Stefan Schmidt&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
An open file looks fine if you're not reading/writing at that point. But my T43 does hangs on this:&lt;br /&gt;
 # dd if=/dev/scd0 of=/dev/null &amp;amp;&lt;br /&gt;
 # echo 1 &amp;gt; /sys/devices/platform/smapi/cdrom_speed&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:41, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
OK, sorry. I was to fast. My system hangs on this commands, too. :(&lt;br /&gt;
&lt;br /&gt;
-- Stefan Schmidt&lt;br /&gt;
&lt;br /&gt;
Works well. Great.&lt;br /&gt;
&lt;br /&gt;
T42 2373-8zh. Working :cdrom_speed and start_charge_thresh. Untest : inhibit_charge_minutes.&lt;br /&gt;
&lt;br /&gt;
-- Haifeng Chen&lt;br /&gt;
&lt;br /&gt;
cdrom_speed works on my T40.&lt;br /&gt;
&lt;br /&gt;
-- [[User:Lammic|lammic]], 2005.12.09&lt;br /&gt;
&lt;br /&gt;
== Kernel Patch? ==&lt;br /&gt;
&lt;br /&gt;
Hello Thinker,&lt;br /&gt;
&lt;br /&gt;
would it be possible to provide the SMAPI support as kernel patch as well? Something along the lines of: (0.12 against 2.6.15-rc5)&lt;br /&gt;
&lt;br /&gt;
''(deleted, see below for how to create a patch file)''&lt;br /&gt;
&lt;br /&gt;
Deleted the tp_smapi.c file at the end, out of obvious reasons, and I'm not sure about the placement in the ACPI section, OTOH there it would be found easily next to ibm_acpi.&lt;br /&gt;
&lt;br /&gt;
Providing a patch would help when recompiling the kernel often, I hate recompiling external modules every time (even got me a kernel-upgrade script to do most of it automatically). But of course it's up to you. :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 09:52, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I'll be glad to add this, but I don't want to go through additional manual steps in the release process (there are already quite a few). Can you add a &amp;quot;make patch&amp;quot; functionality to the Makefile, or something of the sort, to automatically generate a full patch (including tp_smapi.c) against current kernel sources?&lt;br /&gt;
&lt;br /&gt;
Also, this shouldn't be under drivers/acpi, since it doesn't use ACPI at all (that's why I didn't make it a patch to ibm_acpi). I think the right place is drivers/firmware, like the dell_rbu driver for Dell laptops.&lt;br /&gt;
&lt;br /&gt;
BTW, the convention for kernel patches is to start them once level higher:&lt;br /&gt;
  diff -Nurp kernel-2.6.14-vanilla kernel-2.6.14-patched&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:12, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Of course it's from the wrong level, as usual I was just lazy/inattentive. And at one point I'll remember who likes what patch format, promise. ;)&lt;br /&gt;
&lt;br /&gt;
A patch target as in &amp;quot;create a new file holding a correct diff to current kernel source&amp;quot; would be rather difficult, since line numbers might change etc., but applying the patch should be straighforward with a bit of sed. Of course I could just do that, create a patch with the diff command and then apply the new patch file in reverse. ;)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 18:36, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it does that on a local copy (no changes the original kernel tree) and cleans up after itself, that's fine with me. :-)&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 18:50, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Ok, here's a shell script that creates the patch, feel free to use it under the terms of the GPL. For example call it from your Makefile with the patch target: (I didn't want to put all the script into the Makefile, since the rules about escaping in Makefiles, well, escape me ;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
KDIR=/lib/modules/$(uname -r)/build&lt;br /&gt;
FDIR=drivers/firmware&lt;br /&gt;
OPWD=$(pwd)&lt;br /&gt;
&lt;br /&gt;
TMPDIR=$(mktemp -d)&lt;br /&gt;
cd $TMPDIR&lt;br /&gt;
&lt;br /&gt;
mkdir -p a/$FDIR&lt;br /&gt;
cp $KDIR/$FDIR/{Kconfig,Makefile} a/$FDIR&lt;br /&gt;
cp -r a b&lt;br /&gt;
sed -i -e '/endmenu/i\&lt;br /&gt;
config IBM_SMAPI\&lt;br /&gt;
        tristate &amp;quot;IBM ThinkPad SMAPI Support&amp;quot;\&lt;br /&gt;
        depends on X86\&lt;br /&gt;
        ---help---\&lt;br /&gt;
        This adds SMAPI support on IBM ThinkPads, mostly used for battery\&lt;br /&gt;
        charge control. For more information about this driver see\&lt;br /&gt;
        &amp;lt;http://www.thinkwiki.org/wiki/SMAPI_support_for_Linux&amp;gt; .\&lt;br /&gt;
\&lt;br /&gt;
        If you have an IBM ThinkPad laptop, say Y or M here.\&lt;br /&gt;
' b/$FDIR/Kconfig&lt;br /&gt;
sed -i -e '$a\&lt;br /&gt;
obj-$(CONFIG_IBM_SMAPI)            += tp_smapi.o' b/$FDIR/Makefile&lt;br /&gt;
cp $OPWD/tp_smapi.c b/$FDIR&lt;br /&gt;
diff -Nurp a b &amp;gt; $OPWD/tp_smapi-$(uname -r).patch&lt;br /&gt;
rm -r a b&lt;br /&gt;
cd $OPWD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BTW, [http://qbnz.com/highlighter/ GeSHi]-based syntax-highlighting would be great...&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 19:28, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Ah, neat sed foo. How about [http://tpctl.sourceforge.net/tmp/Makefile this] escapade, then? &lt;br /&gt;
&lt;br /&gt;
What's the sed spell needed to replace the Makefile's&lt;br /&gt;
 VER  := 0.13&lt;br /&gt;
with auto-parsing of&lt;br /&gt;
 #define TP_VERSION &amp;quot;0.13&amp;quot;&lt;br /&gt;
from tp_smapi.c?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:37, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Hmm, something like&lt;br /&gt;
 VERFROMC=$(sed -ne 's/^#define TP_VERSION &amp;quot;\(.*\)&amp;quot;/\1/gp' tp_smapi.c)&lt;br /&gt;
 sed -i -e &amp;quot;s/^VER := .*$/VER := $VERFROMC/&amp;quot; Makefile&lt;br /&gt;
should do (untested, from the top of my head, maybe the temporary variable isn't even necessary?). And neat Makefile wizardry, at one point I'll learn the syntax.&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 20:44, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Makefile escaping is horrible, keep avoiding it... Anyway, the updated [http://tpctl.sourceforge.net/tmp/Makefile make patch] seems to do the right thing.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:36, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Small documentation request: just needed to create a patch for the not-yet-installed 2.6.16-rc2, which is no problem with&lt;br /&gt;
 make KSRC=/path/to/linux-2.6.16-rc2 KVER=2.6.16-rc2 patch&lt;br /&gt;
but I guess it would be a good addition to the README file. :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 10:48, 8 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Right, added (to next release).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 13:40, 8 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Installation questions==&lt;br /&gt;
Amazing! I've loaded this module in my T43 which is running SuSE 10 with the kernel of 2.6.13-15. I have three points to share:&lt;br /&gt;
&lt;br /&gt;
1. The battery control part seems to work but has a minor problem. I set the stop_charge_threshold to 70, but the battery stops charging at 55%. Don't know why and how to fix it. :P&lt;br /&gt;
&lt;br /&gt;
2. I don't have the cd speed control function. Here is what I have under /sys/devices/platform/smapi/:&lt;br /&gt;
&lt;br /&gt;
./  ../  ac_connected  BAT0/  BAT1/  bus@  driver@  power/&lt;br /&gt;
&lt;br /&gt;
3. SuSE 10 doesn't have the necessary C files under .../drivers/hwmon/, I copied them from a 2.6.14.5 kernel source. Maybe it causes the two problems above. :(&lt;br /&gt;
&lt;br /&gt;
When I have time, I'll install the new kernel to see if the problems are gone and report the result.&lt;br /&gt;
&lt;br /&gt;
--[[User:68.51.153.96|68.51.153.96]] 04:31, 2 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
1. It should stop charging at 70, but will only ''start'' charging when remaining capacity has dipped below &amp;lt;tt&amp;gt;start_charge_thresh&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2. See the note about PROVIDE_CD_SPEED.&lt;br /&gt;
&lt;br /&gt;
3. That's should be needed only for patching the HDAPS driver in order to make it compatible with tp_smapi. If your kernel (which version is it?) doens't inlude the HDAPS driver anyway, you don't need to patch....&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 09:28, 2 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks Thinker.&lt;br /&gt;
&lt;br /&gt;
1. I discharged and recharged the battery again. This time, it stops at 68% percent, which is pretty good.&lt;br /&gt;
&lt;br /&gt;
2. I missed the NOTE in README, for I just followed this wiki. :P&lt;br /&gt;
&lt;br /&gt;
3. My kernel version is 2.6.13-15.&lt;br /&gt;
&lt;br /&gt;
By the way, I just got this T43 whose model number is 266896U. I feel that the noise of the fan is much louder than my previous T21. I think it is so since it has a CPU with bigger power but am wondering if other T43 has the same big noise?&lt;br /&gt;
&lt;br /&gt;
--[[User:Tyne|Tyne]] 00:14, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The note about PROVIDE_CD_SPEED is also in the Wiki...&lt;br /&gt;
&lt;br /&gt;
About the T43 fan noise: yes, this is a very common (and annoying) problem. See [[Problem_with_fan_noise]] and our [[ACPI fan control script]], and send Lenovo a complaint in hope they'll fix this at the firmware level.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 08:48, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
I spent hours, trying to compile this on ubuntu edgy without success. It starts with warnings about missing files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@t40:/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31# make install&lt;br /&gt;
make -C /lib/modules/2.6.17-11-386/source M=/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31 O=/lib/modules/2.6.17-11-386/build modules&lt;br /&gt;
make[1]: Betrete Verzeichnis '/usr/src/linux-source-2.6.17'&lt;br /&gt;
/usr/src/linux-source-2.6.17/Makefile:450: .config: No such file or directory&lt;br /&gt;
&lt;br /&gt;
  WARNING: Symbol version dump /lib/modules/2.6.17-11-386/build/Module.symvers&lt;br /&gt;
           is missing; modules will have no dependencies and modversions.&lt;br /&gt;
&lt;br /&gt;
  CC [M]  /home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.o&lt;br /&gt;
cc1: error: include/linux/autoconf.h: No such file or directory&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then many thousand lines later it finally stops:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:357: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c: In function â€˜thinkpad_ec_invalidateâ€™:&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:378: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c: In function â€˜thinkpad_ec_initâ€™:&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:460: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
make[3]: *** [/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.o] Fehler 1&lt;br /&gt;
make[2]: *** [_module_/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31] Fehler 2&lt;br /&gt;
make[1]: *** [modules] Fehler 2&lt;br /&gt;
make[1]: Verlasse Verzeichnis '/usr/src/linux-source-2.6.17'&lt;br /&gt;
make: *** [modules] Fehler 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There must be something fundamentally wrong with the makefile. I have for example never seen that a symlink has to point from /lib/modules/someversion/somewhere to /usr/src/linux. I have installed other modules in the past and they all worked with installed linux-headers package. I didn't ever have to download 40MB kernel source, unpack it, configure it to have a .config and compile the whole kernel just to have 2 or three of the other files needed. This cannot be the correct way to install a driver.&lt;br /&gt;
&lt;br /&gt;
[[User:7bit|7bit]] 07:42, 27 March 2007 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Formatting ==&lt;br /&gt;
&lt;br /&gt;
Wyrfel, that was some heavy editing you did... I agree with most changes (including the saner color choice). I did like those HINT floats, though - they keep the hints from interrupting the flow of text too much, and this particular text needs any help it can get.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:04, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
Hei Thinker,&lt;br /&gt;
&lt;br /&gt;
I'll look into it again. I felt that the floating HINTs were tearing the text apart too much. Maybe we could fix it by placing the clear marks somewhere else.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 18:46, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Dual battery operation with tp_smapi ==&lt;br /&gt;
&lt;br /&gt;
It looks like it is working quite fine with tp_smapi-0.13 and 2.6.15 (it may also work with other versions, but those are the ones I have running right now).&lt;br /&gt;
&lt;br /&gt;
The juicy details:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cd /sys/devices/platform/smapi/}}&lt;br /&gt;
{{cmdroot|cat ac_connected}}&lt;br /&gt;
&lt;br /&gt;
{{cmdresult|0}}&lt;br /&gt;
{{cmdroot|cat BAT{0,1}/state}}&lt;br /&gt;
{{cmdresult|discharging}}&lt;br /&gt;
{{cmdresult|idle}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|echo 1 &amp;gt; BAT1/force_discharge1}}&lt;br /&gt;
{{cmdroot|cat BAT{0,1}/state}}&lt;br /&gt;
{{cmdresult|idle}}&lt;br /&gt;
{{cmdresult|discharging}}&lt;br /&gt;
&lt;br /&gt;
Checking capacity values shows that the corrent battery is being depleted.&lt;br /&gt;
&lt;br /&gt;
And remember, before you yank the CD/DVD drive out, issue:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cat eject &amp;gt; /proc/acpi/ibm/bay}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Great! Which ThinkPad model is it? Could you also {{cmdroot|cat /sys/devices/platform/smapi/BAT{0,1}/force_discharge2}} and report the dmesg output (after {{cmdroot|make load}} or {{cmdroot|1=modprobe tp_smapi debug=1}})?&lt;br /&gt;
&lt;br /&gt;
About the eject command, I think it should be possible to do that automatically when the Ultrabay handle is ejected, via &amp;lt;tt&amp;gt;acpid&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 15:45, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
It's a T43 (2669). cat'ing force_discharge2 gives me an I/O error and I see&lt;br /&gt;
&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 0: bx=2103&lt;br /&gt;
&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 1: bx=2103&lt;br /&gt;
&lt;br /&gt;
I find these errors irrelevant from the user's point of view, though. &lt;br /&gt;
&lt;br /&gt;
Indeed, it should be possible to automatise the &amp;quot;eject&amp;quot; command. I should also be noted that once a force_discharge1 is set, it will NOT unset automatically, event when the AC is plugged back in. An obvious fix is to fiddle with the appropriate ACPI event to force_discharge1 back to 0 for all batteries once the AC is attached.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks, this eliminates the last situation I imagined &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; might work. The next tp_smapi version will remove &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; and rename &amp;lt;tt&amp;gt;force_discharge1&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;force_discharge&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you write those ACPI scripts, it would be great if you put them on the Wiki.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:31, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Well, I still do not preclude the fact that &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; may be useful for something else on other models.&lt;br /&gt;
&lt;br /&gt;
The ACPI scripts (as well as an installation guide) is underway. It may take a while, though.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
See the new article: [[Using an Ultrabay battery]].&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:05, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Hei Thinker,&lt;br /&gt;
&lt;br /&gt;
i just renamed the new page. Will adjust your links later on. Keeping the redirect page until that's done. Please set any new links you create to the new page (the pages of the individual UltraBay batteries should contain a pointer).&lt;br /&gt;
&lt;br /&gt;
On a sidenote: I would like to split the SMAPI support under Linux page into a tp_smapi driver page, just listing the features, and a &amp;quot;How to use tp_smapi&amp;quot; page. I would also split the thinkpad/tpctl page off that again. Any objections?&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 20:42, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
ACK about the page rename (the old one did sound a bit out of line to my ear, but I couldn't spot why...).&lt;br /&gt;
&lt;br /&gt;
About the splitting tp_smapi vs. thinkpad/tpctl, no objection.&lt;br /&gt;
&lt;br /&gt;
About splitting tp_smapi: currently most of that section doubles as both a spec and a HOWTO, which I think is a convenient and concise way to describe things (hey, it must be right, the Perl docs do it!). I'm not sure there's much benefit in duplicating that. Perhaps we should wait for a critical mass of additional lore to accumulate?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:04, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
Ok, i agree on the latter.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 00:57, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Article name capitalization== &lt;br /&gt;
&lt;br /&gt;
Wikimedia autocapitalizes the article name upon submit. How do I concince Wikimedia that I really want a lowercase &amp;quot;t&amp;quot;? The underline is probably too much too ask...&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 11:03, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Impossible, according to [http://en.wikipedia.org/wiki/Wikipedia:Canonicalization Wikipedia:Canonicalization].&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:04, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Status Table==&lt;br /&gt;
For at least the T series i think that charge control was not supported prior to the T42, hardware/BIOS side. Perhaps &amp;quot;N/A&amp;quot; flags would be better here?&lt;br /&gt;
&lt;br /&gt;
I also created &amp;lt;nowiki&amp;gt;{{Isup}}&amp;lt;/nowiki&amp;gt; style templates for status, they just include images, like {{Isup}}.&lt;br /&gt;
Not emotional about it, just wanted to let you know in case you want to use them.&lt;br /&gt;
&lt;br /&gt;
Third and last...would it possibly be better to make the table headers more human readable like i.e. &amp;quot;lower charge threshold&amp;quot; or something like that instead of &amp;quot;start_charge_thresh&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 19:21, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
About &amp;quot;N/A&amp;quot;, sure, if we get reliable data about the hardware capabilities. Alas, most negative reports were just &amp;quot;it doesn't work&amp;quot;, and in some cases gave contradictory information (SMAPI interface says a function is unsupported but user says it works under Windows).&lt;br /&gt;
&lt;br /&gt;
About {{Iyes}} and friends, they're very cute, but I think think they're harder to parse visually and would add some clutter to an already dense table.&lt;br /&gt;
&lt;br /&gt;
The table headers are just the names of the control files - that's important to keep, sine it's the most natural lookup key. Adding friendly description would be great, if we can fit them in (not everyone has an SXGA+ display...). I tried and failed.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:38, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I have a T41p and the windows tools still don't offer me battery management, even though it's quite a while since the T42 came out.&lt;br /&gt;
&lt;br /&gt;
I'm ok with the rest.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 22:35, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the {{X40}}, I can report success using the stop_charge_thresh feature with BIOS v2.03 (1UETC8WW) and Embedded Controller Program v1.60 (1UHTB0WW).&lt;br /&gt;
&lt;br /&gt;
[[User:Peterco|Peterco]] 12:07, 28 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[User:roam|roam]] 13:43, 11 January 2008 (CET)&lt;br /&gt;
&lt;br /&gt;
I need invert=1 for hdaps. The additional invert parameters (2-7) didn't work for me with tp_smapi 0.33. They work with 0.34.&lt;br /&gt;
&lt;br /&gt;
== Z60t ==&lt;br /&gt;
&lt;br /&gt;
Tested on Z60t. No errors using cat. Setting thresholds works. Status and capacity queries work. --[[User:Alon|Alon]] 21:44, 4 May 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Problem setting thresholds with X40 ==&lt;br /&gt;
&lt;br /&gt;
My X40, kernel 2.6.16 and tp_smapi 0.20.  I try to set the thresholds to 40% and 90% using:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo 90 &amp;gt; stop_charge_thresh&lt;br /&gt;
# echo 40 &amp;gt; start_charge_thresh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which should work, and the kernel reports from dmesg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: successfully loaded (smapi_port=0xb2).&lt;br /&gt;
tp_smapi: battery 0: changed start threshold to 85(+1)&lt;br /&gt;
tp_smapi: battery 0: changed stop threshold to 90&lt;br /&gt;
tp_smapi: battery 0: changed start threshold to 39(+1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
but, on confirmation here is what happens:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat stop_charge_thresh&lt;br /&gt;
90&lt;br /&gt;
# cat start_charge_thresh&lt;br /&gt;
91&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Any clues as to why start doesn't keep?  Or why its always at 1 above stop_charge_thresh?&lt;br /&gt;
&lt;br /&gt;
--[[User:Xmm0|Xmm0]] 15:01, 17 May 2006 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Is it any different if you first set start_charge_thresh and then stop_charge_thresh? &lt;br /&gt;
&lt;br /&gt;
Can you please load tp_smapi with module option &amp;quot;debug=1&amp;quot; and report the dmesg output genereated by each command?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:31, 17 May 2006 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Battery daemon feedback requested ==&lt;br /&gt;
&lt;br /&gt;
I am writing a battery-management daemon to control charging and discharging BAT0 and BAT1 in accordance with usage patterns that extend Li-Ion and Li-Py battery life.&lt;br /&gt;
&lt;br /&gt;
By default, the machine fully discharges BAT1 first, and it is said that deep-cycling all the time dramatically shortens their lifetime.&lt;br /&gt;
&lt;br /&gt;
My Z61t is the test machine, and it is configured with two batteries, the stock 4-cell, and an &amp;quot;Advanced Ultrabay&amp;quot;, which about doubles the runtime of the machine.&lt;br /&gt;
&lt;br /&gt;
Currently there are two &amp;quot;modes&amp;quot; of the daemon:&lt;br /&gt;
&lt;br /&gt;
Discharging mode.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * look at the &amp;quot;remaining_percent&amp;quot; values for both batteries&lt;br /&gt;
 * if one is more than THRESHOLD percent less than the other one, &lt;br /&gt;
      force discharge from the battery with more capacity left&lt;br /&gt;
 (the current value for THRESHOLD is 10%)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I believe the preceeding will prevent either battery from being deep-cycled disproportionately.&lt;br /&gt;
&lt;br /&gt;
Charging mode.  I am less sure what the &amp;quot;right&amp;quot; algorithm is here.  The following is a proposal.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * look at the &amp;quot;remaining_percent&amp;quot; values for both batteries&lt;br /&gt;
 * if one is more than THRESHOLD percent less than the other one, &lt;br /&gt;
      force charging to the battery with less capacity left&lt;br /&gt;
 * honor pre-set values in stop_charge_thresh and start_charge_thresh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I would like to get feedback in the form of &amp;quot;better&amp;quot; algorithms or requests for this daemon.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 19:03, 12 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
It sounds like your algorithm will indeed minimize wear on both batteries. A side benefit is that charging will toggle between the batteries, which may help keep them cooler while charging and thus prolong their life. OTOH, if you plan to occasionally swap the UltraBay battery for other devices, you may want to fully charge the system battery (up to stop_charge_thresh) first.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 22:57, 12 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have noticed that when force_discharge is set and the batteries switch, the gnome battery monitoring applet gets totally confused about remaining runtime.  Besides being a nuisance, this could presumably cause premature emergency shutduwn.&lt;br /&gt;
&lt;br /&gt;
I have also noticed that the reported remaining runtimes vary greatly between acpi, the applet, and /proc/acpi/battery/*/state&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 21:46, 14 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
What do you mean by &amp;quot;acpi&amp;quot; vs. &amp;quot;/proc/acpi/battery/*/state&amp;quot;? &lt;br /&gt;
&lt;br /&gt;
The most accurate readout is probably {{path|/sys/devices/platform/smapi/BAT0/remaining_running_time}}, but I don't think any applet uses that yet.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:07, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
By acpi, I meant the output of the acpi (1) command.   I'll get some comparative numbers later and post them here.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 20:37, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Odd, my version of {{path|/usr/bin/acpi}} doesn't report remaining time, just percent (which is the same as {{path|/sys/devices/platform/smapi/BAT0/remaining_percent}}).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:32, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
I have been running batteryd for a while with good results.  I will upload it here shortly.&lt;br /&gt;
&lt;br /&gt;
I disabled the preferential charging mode, and only control discharging.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 23:15, 14 November 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
http://demigod.org/~zak/src/batteryd.cc&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 20:18, 5 December 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
Have you developed this further since then? I just got my first dual-battery-setup for my Z60m. Anyway, it says it doesn't support hotplugging the battery? What does this mean? Do things break if I change batteries or switch a DVD drive to the ultrabay slot while it's running? &lt;br /&gt;
&lt;br /&gt;
Anyway, I deciphered your source code enough that it basically seems to poll the stuff under /sys/devices/platform/BAT?/* every 10 seconds. Anyway, I don't see what's so tough about hotswapping - the BAT1 directory does not seem to vanish either by issuing echo 1 &amp;gt; /sys/devices/platform/bay.0/eject or just yanking it out. The /sys/devices/platform/BAT1/installed goes to zero though.&lt;br /&gt;
&lt;br /&gt;
Can you add a check to the condition if (b0-&amp;gt;on_ac == 0) ...change this to&lt;br /&gt;
&lt;br /&gt;
  if ((b0-&amp;gt;on_ac == 0) &amp;amp;&amp;amp; (b0-&amp;gt;installed == 1) &amp;amp;&amp;amp; (b1-&amp;gt;installed == 1))&lt;br /&gt;
&lt;br /&gt;
then the equal discharging logic would handle hotswapping too (ie. situations where you're running only on 1 battery instead of 2). &lt;br /&gt;
&lt;br /&gt;
I hope you keep on honing this.&lt;br /&gt;
&lt;br /&gt;
One of the few things I miss from Dell is that when operating with dual batteries, it discharges both of them evenly.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zarhan|Zarhan]] 18:31, 13 May 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Instructions for X60 with Bios 1.11 under Debian Etch ==&lt;br /&gt;
&lt;br /&gt;
Could someone please provide step-by-step instructions of how to make this work with Debian? What have I to do after  apt-get install kernel-patch-tpsmapi? Thank you!&lt;br /&gt;
&lt;br /&gt;
--[[User:PeterBursch|PeterBursch]] 21:39, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
== tp_smapi 0.30 with kernel 2.6.20? ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;T60:~/tp_smapi-0.30# uname -rm&lt;br /&gt;
2.6.20 x86_64&lt;br /&gt;
&lt;br /&gt;
T60:~/tp_smapi-0.30# make load&lt;br /&gt;
if lsmod | grep -q '^hdaps '; then rmmod hdaps; fi&lt;br /&gt;
if lsmod | grep -q '^tp_smapi '; then rmmod tp_smapi; fi&lt;br /&gt;
if lsmod | grep -q '^thinkpad_ec '; then rmmod thinkpad_ec; fi&lt;br /&gt;
if lsmod | grep -q '^tp_base '; then rmmod tp_base; fi  # old thinkpad_ec&lt;br /&gt;
make -C /lib/modules/2.6.20/source M=/root/tp_smapi-0.30 O=/lib/modules/2.6.20/build modules&lt;br /&gt;
make[1]: Entering directory `/usr/src/linux-2.6.20'&lt;br /&gt;
  CC [M]  /root/tp_smapi-0.30/thinkpad_ec.o&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:83: warning: type defaults to 'int' in declaration of 'DECLARE_MUTEX'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:83: warning: parameter names (without types) in function declaration&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_lock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: warning: implicit declaration of function 'down_interruptible'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: (Each undeclared identifier is reported only once&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: for each function it appears in.)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_try_lock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:109: warning: implicit declaration of function 'down_trylock'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:109: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_unlock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:122: warning: implicit declaration of function 'up'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:122: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
make[3]: *** [/root/tp_smapi-0.30/thinkpad_ec.o] Error 1&lt;br /&gt;
make[2]: *** [_module_/root/tp_smapi-0.30] Error 2&lt;br /&gt;
make[1]: *** [modules] Error 2&lt;br /&gt;
make[1]: Leaving directory `/usr/src/linux-2.6.20'&lt;br /&gt;
make: *** [modules] Error 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Works here with 2.6.21-rc1 (didn't try 2.6.20) without problems --[[User:Zhenech|Zhenech]] 14:32, 22 February 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
:I have this problem when compiling for x86_64 too. It seems to be limited to 64bit kernels though. I've notified the author of tp_smapi about it, so lets hope a solution is found soon. --[[User:Esmil|Esmil]] 20:08, 6 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
The author was happy about the report, but didn't have time too look at it right now, so I thought I'd give it my best shot. Apparently I should have done that sooner, cause this seems to fix it (for me at least):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff -Naur tp_smapi-0.30/hdaps.c tp_smapi-0.30-64bit_fix/hdaps.c&lt;br /&gt;
--- tp_smapi-0.30/hdaps.c       2006-09-03 12:13:34.000000000 +0200&lt;br /&gt;
+++ tp_smapi-0.30-64bit_fix/hdaps.c     2007-03-07 00:43:26.000000000 +0100&lt;br /&gt;
@@ -34,6 +34,7 @@&lt;br /&gt;
 #include &amp;lt;linux/timer.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/dmi.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/thinkpad_ec.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;linux/jiffies.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* Embedded controller accelerometer read command and its result: */&lt;br /&gt;
 static const struct thinkpad_ec_row ec_accel_args =&lt;br /&gt;
diff -Naur tp_smapi-0.30/thinkpad_ec.c tp_smapi-0.30-64bit_fix/thinkpad_ec.c&lt;br /&gt;
--- tp_smapi-0.30/thinkpad_ec.c 2006-09-02 21:46:18.000000000 +0200&lt;br /&gt;
+++ tp_smapi-0.30-64bit_fix/thinkpad_ec.c       2007-03-07 00:43:13.000000000 +0100&lt;br /&gt;
@@ -34,6 +34,7 @@&lt;br /&gt;
 #include &amp;lt;linux/delay.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/thinkpad_ec.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/jiffies.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;asm/semaphore.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;asm/io.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 #define TP_VERSION &amp;quot;0.30&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the above to {{path|64bit_fix.patch}}, enter the {{path|tp_smapi-0.30}} directory and type&lt;br /&gt;
:{{cmduser|patch -p1 &amp;lt; /path/to/64bit_fix.patch}}&lt;br /&gt;
Now cross your fingers and compile as normal.&lt;br /&gt;
--[[User:Esmil|Esmil]] 01:06, 7 March 2007 (CET)&lt;br /&gt;
: tp_smapi 0.31 fixes this issue --[[User:Esmil|Esmil]] 19:22, 8 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
== X60: tp_smapi 0.31 with kernel 2.6.20 issue ==&lt;br /&gt;
[[category:X60]]&lt;br /&gt;
1st of all: Thanks alot for your work. I do really appreciate this (tp_smapi/thinkwiki).&lt;br /&gt;
&lt;br /&gt;
2nd: On a Debian (testing) w/ vanilla 2.6.20+tp_smapi+hdaps (w/ modules loaded) the kernel panics (init oops) on reboot just before resetting the system. It has a minor impact, you need to press power-off for 5 secs to switch off the machine. Just FYI.&lt;br /&gt;
&lt;br /&gt;
--[[User:Runia|Runia]] 23:48, 16 April 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
Is this consistently reproducible? What's the oops message and stackdump (you can snap a digicam shot)? Does this happen when...&lt;br /&gt;
* rebooting with tp_smapi loaded but hdaps not loaded?&lt;br /&gt;
* rebooting with neither tp_smapi nor hdaps loaded?&lt;br /&gt;
* rebooting with vanilla hdaps loaded (instead of the tp_smapi version)?&lt;br /&gt;
* removing just these modules (&amp;quot;rmmod&amp;quot;) instead of rebooting?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 01:56, 17 April 2007 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Hey Thinker,&lt;br /&gt;
Sorry, failed to follow the thread. Didn't pay attention to that bug any more. Skipped use of smapi on next kernel release for some reason. IRC, the panic could be prevented running the kernel w/o hdaps loaded.. hdaps didn't work out correctly for me anyway..&lt;br /&gt;
&lt;br /&gt;
Cheers,&lt;br /&gt;
&lt;br /&gt;
--[[User:Runia|Runia]] 16:05, 15 February 2008 (CET)&lt;br /&gt;
&lt;br /&gt;
== battery start/stop thresholds saved after reboot? ==&lt;br /&gt;
&lt;br /&gt;
Hi&lt;br /&gt;
&lt;br /&gt;
Are the values in stop_charge_thresh and start_charge_thresh just used when Linux is running, or are they saved in the battery? Here after a reboot the values are reset to 96/100. I set these values to 40/85 shut the thinkpad down and charged the battery - sadly it did not use the 85% setting and charged the battery to 100%.&lt;br /&gt;
&lt;br /&gt;
--[[User:Burp|Burp]] 15:31, 13 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The thresholds are saved in the embedded controller, which keeps them as long as there is AC or battery power. If you take away both, the state is reset. If you use suspend-to-disk, tp_smapi will remember the threholds and restore them during resume; but you'll need to write your own init script to set the thresholds during normal reboot after full power loss.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:19, 13 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Under Ubuntu, you can set the thresholds under {{path| /etc/default/tpsmapi-utils}}.&lt;br /&gt;
&lt;br /&gt;
 START_CHARGE_THRESH_BAT0=40&lt;br /&gt;
 #START_CHARGE_THRESH_BAT1=40&lt;br /&gt;
 &lt;br /&gt;
 STOP_CHARGE_THRESH_BAT0=95&lt;br /&gt;
 #STOP_CHARGE_THRESH_BAT1=70&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If I set the value, plug in in the power cord to charge it after I have shut down the thinkpad, it will charge to 100%?&lt;br /&gt;
So I have to plug in the power cord while the thinkpad is running and then shut it down to make it work?&lt;br /&gt;
--[[User:Burp|Burp]] 17:45, 15 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Changes take effect immediately, and last as long as the machine has any power source (battery or AC).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 18:59, 15 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I've experienced the same problem. When I poweroff my X60 after setting the thresh-values and then reboot it, the values are set to 96/100. If I want the thresholds to be regarded I have to plug in the power cord when the thinkpad is running and then shut it down. If I turn it off before connect it to AC, the values are ignored. &lt;br /&gt;
So, are the values only saved in standby-mode? This isn't clear for me, and I think I'm not alone with it ;)&lt;br /&gt;
&lt;br /&gt;
--[[User:Alexb|Alexb]] 20:56, 15 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
The values are not '''saved''' anywhere.  They are set on the EC, and as long as the EC is kept powered on and not rebooted, they are retained.  Sleep cycles and reboots on the main machine do not affect the EC.  An EC firmware upgrade reboots the EC.  Powering off the ThinkPad while it is on battery also powers down the EC.  The ThinkPad does not power down the EC while on AC (it has to be powered up to charge the batteries).&lt;br /&gt;
&lt;br /&gt;
I hope that answered all your doubts...&lt;br /&gt;
&lt;br /&gt;
--[[User:Hmh|hmh]] 04:45, 28 March 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
On my x61s, these values are remembered after powering off the ThinkPad while it is on battery. I didn't try to remove the battery. But it looks like the x61s behaves as Thinker described, not as Hmh did.&lt;br /&gt;
&lt;br /&gt;
--[[User:Jannic|Jannic]] 13:58, 3 November 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
Curious. That would mean the x61s does not power off the EC even while on battery and powered off, or that it is storing the SMAPI thresholds away in CMOS.  Care to test it?  If you want to check that theory, just hexdump /dev/nvram, change a threshold, than hexdump it again...&lt;br /&gt;
&lt;br /&gt;
--[[User:Hmh|hmh]] 12:09, 11 November 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
Seems like it's the former choice: I didn't see any nvram changes after changing the thresholds. Shutting down the system while on battery does not reset thresholds. Shutting down while on battery and then removing the battery does reset them to start_charge_threshold=96, stop_charge_threshold=100, though. I guess they put the EC in some low-power sleep mode while the notebook is turned off and on battery. The specs linked from [[Embedded_Controller_Chips]] list sleep mode currents below 5µA, which is probably negligible compared to self-discharge of Li-Ion batteries.&lt;br /&gt;
&lt;br /&gt;
--[[User:Jannic|Jannic]] 14:36, 12 November 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
== stop_charge_thresh on t42p ==&lt;br /&gt;
&lt;br /&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
'cat /sys/devices/platform/smapi/BAT0/stop_charge_thres' does not work. I get:&lt;br /&gt;
'Function not implemented'. Under windows the ibm tool shows me both thresholds. I am using tp_smapi version 0.31 with kernel 2.6.20 (ubuntu feisty).&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Same problem, I want to know what I can do to help figure out why this works in windows and not with tp_smapi.&amp;lt;br&amp;gt;I am running tp_smapi 0.32 on 2.6.20 Ubuntu Feisty (7.04)&amp;lt;br&amp;gt;Here is the debug output from tp_smapi.&amp;lt;br&amp;gt;&lt;br /&gt;
{{cmdroot|echo 30 &amp;gt; /sys/devices/platform/smapi/BAT0/start_charge_thresh}}&amp;lt;br&amp;gt;&lt;br /&gt;
{{cmdroot|dmseg}}&lt;br /&gt;
&amp;lt;pre&amp;gt;[68311.752000] smapi smapi: smapi_request: req_in: BX=211a CX=100 DI=0 SI=0&lt;br /&gt;
[68311.812000] smapi smapi: smapi_request: req_out: AX=8680 BX=211a CX=100 DX=b2 DI=0 SI=0 r=-38&lt;br /&gt;
[68311.812000] smapi smapi: smapi_request: SMAPI error: Function is not supported by SMAPI BIOS (func=211a)&lt;br /&gt;
[68311.812000] smapi smapi: __get_real_thresh: cannot get stop_thresh of bat=0: Function is not supported by SMAPI BIOS&lt;br /&gt;
[68311.812000] smapi smapi: smapi_request: req_in: BX=2116 CX=100 DI=0 SI=0&lt;br /&gt;
[68311.868000] smapi smapi: smapi_request: req_out: AX=80 BX=2116 CX=31d DX=b2 DI=0 SI=0 r=0&lt;br /&gt;
[68311.868000] smapi smapi: smapi_request: req_in: BX=2117 CX=11d DI=0 SI=0&lt;br /&gt;
[68311.924000] smapi smapi: smapi_request: req_out: AX=80 BX=2117 CX=11d DX=b2 DI=0 SI=0 r=0&lt;br /&gt;
[68311.924000] smapi smapi: set_real_thresh: set start to 29 for bat=0&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{cmdroot|echo 85 &amp;gt; /sys/devices/platform/smapi/BAT0/stop_charge_thresh}}&amp;lt;br&amp;gt;&lt;br /&gt;
{{cmdroot|dmesg}}&lt;br /&gt;
&amp;lt;pre&amp;gt;[68385.652000] smapi smapi: smapi_request: req_in: BX=2116 CX=100 DI=0 SI=0&lt;br /&gt;
[68385.708000] smapi smapi: smapi_request: req_out: AX=80 BX=2116 CX=31d DX=b2 DI=0 SI=0 r=0&lt;br /&gt;
[68385.708000] smapi smapi: smapi_request: req_in: BX=211a CX=100 DI=0 SI=0&lt;br /&gt;
[68385.764000] smapi smapi: smapi_request: req_out: AX=8680 BX=211a CX=100 DX=b2 DI=0 SI=0 r=-38&lt;br /&gt;
[68385.764000] smapi smapi: smapi_request: SMAPI error: Function is not supported by SMAPI BIOS (func=211a)&lt;br /&gt;
[68385.764000] smapi smapi: __get_real_thresh: cannot get stop_thresh of bat=0: Function is not supported by SMAPI BIOS&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:Airbornespent|Airbornespent]] 16:18, 13 August 2007 (UTC)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Looks like the T42(p) is using a different SMAPI interface for the stop threshold. For example, it could be using the same interface as inhibit_charge_minutes_interface, and monitoring the charge levels manually. Maybe you can use a debugger (e.g., SoftICE) to find out what SMAPI calls are made when you change the thresholds under Windows.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:40, 13 August 2007 (UTC)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
What BIOS and EC version? If a T42/p is doing this, all the T4X but the two T43 types should also suffer the same problem...  Not to mention a bunch of R5x models, etc (BIOS TP-1R).&lt;br /&gt;
&lt;br /&gt;
--[[User:Hmh|hmh]] 23:17, 13 August 2007 (UTC)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This is copy and pasted from the DMI info I put on the DMI list page yesterday:&lt;br /&gt;
 1RETDPWW (3.21 ) 	 06/02/2006 	 Handle 0x0029, DMI type 11, 5 byte String 1: IBM ThinkPad Embedded Controller -[1RHT71WW-3.04 ]-&lt;br /&gt;
&lt;br /&gt;
I just noticed that the T40 through the T42p use this EC model. The T43s are different. No one with a T40-T42 has claimed success with the stop_charge_thresh on the tp_smapi status table.&lt;br /&gt;
&lt;br /&gt;
I will try to get windows on a harddrive and pop it in my t42p to use softICE or whatever debuggers soon.&lt;br /&gt;
&lt;br /&gt;
--[[User:Airbornespent|Airbornespent]] 15:39, 15 August 2007 (UTC)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I've installed windows, I can again confirm that the start and stop thresholds work with the maximiser. I couldn't seem to find softICE but I got a debugger called syser. I have no clue what I should be looking for though, a certain set of CPU calls, addresses, etc? Any advice would be great. If you are more familiar with softICE I will find and install that.&lt;br /&gt;
&lt;br /&gt;
I just had an idea though. Maybe I can set the thresholds to known values in windows, and then reboot to linux without removing the AC, then the thresholds would be saved on the EC. Is there then a way I can dump the settings in linux and if I do this with several known thresholds that might be enough information to figure this out?&lt;br /&gt;
&lt;br /&gt;
--[[User:Airbornespent|Airbornespent]] 19:48, 15 August 2007 (UTC)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You need to trace the SMAPI calls made when the thresholds are changed. You can look at tp_smapi.c or the vanilla kernel drivers/char/mwave/smapi.c to see how SMAPI work. Basically, the parameters are loaded into registers, with the SMAPI function code in register EBX. Then, a byte is written to IO ports 0xB2 and 0x4F. The write to port 0xB2 invokes the BIOS SMAPI code in SMM mode. So the first thing to check is what SMAPI functions are called, i.e., the value of EBX before each wrote to port 0xB2. You can see some of the known codes in the SMAPI_* constants near the top of smapi.c.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:57, 15 August 2007 (UTC)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Does smapi interface include communication with eeprom? ==&lt;br /&gt;
&lt;br /&gt;
There exists a windows program (which I haven't tracked down yet) which will reset the eeprom in the battery to clear an error.  Could the smapi interface do the same?&lt;br /&gt;
&lt;br /&gt;
Or are there other ways to do this?  I have a relatively new battery (&amp;lt; 10 cycles) with all my tests showing the cells are fine, but since it reports &amp;quot;damage&amp;quot; to the thinkpad, it won't charge it.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
No. Can you provide a link to that Windows program and (more important) information about how it works?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 02:17, 25 June 2007 (UTC)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Acc plus v1.3 [http://www.microsys.ro/accplus.htm] communicates over SMBus via a parallel port adapter.  It says it can reset the eeprom via direct connection to the chip.  But version 1.4 claims to be able to reset the chip via SMBus.  I haven't verified this claim because only v1.3 is available for download.  But I figured anything that can be done via the parallel port adapter ought to be able to be done natively by the thinkpad.&lt;br /&gt;
&lt;br /&gt;
The Smart Battery Workshop also claims to be able to reset the eeprom.  This is the program that is hard to track down because all the links you find are broken.  I finally found it by searching for &amp;quot;smart battery workshop&amp;quot; on download.com [http://download.com].  They use those random urls so I can't post a direct link.&lt;br /&gt;
&lt;br /&gt;
In summary: mostly these programs are just a way to communicate with the battery over SMBus using a parallel port.  But there's the tantalizing claims of being able to reset the chip too....&lt;br /&gt;
&lt;br /&gt;
--[[User:Kdnelson|Kdnelson]] 03:14, 3 August 2007 (UTC)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If I read this correctly, both AccPlus and Smart Battery Workshop require you to take out the battery and communicate with it via a parallel-to-SMBus adapter. This is out of scope for tp_smapi. AccSmart probably uses the Smart Battery interface through the laptop's internal SMBus bus; this is already supported by Linux's smart battery drivers, but doesn't work on ThinkPads since we don't know of any way the CPU can directly access the SMBus.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 13:56, 3 August 2007 (UTC)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== kernel 2.6.24 compatibility ==&lt;br /&gt;
&lt;br /&gt;
Version 0.32 of tp_smapi seems to be incompatible with the prereleases of 2.6.24. Does anybody know if there are updated patches available?&lt;br /&gt;
&lt;br /&gt;
--[[User:Jannic|Jannic]] 13:13, 1 November 2007 (UTC)&lt;br /&gt;
&lt;br /&gt;
Update: It were the renames of BIT() to BIT_MASK in commit 7b19ada2ed3c1eccb9fe94d74b05e1428224663d which did not&lt;br /&gt;
apply cleanly to my tp_smapi patched tree. This looks like a minor change which should be fixable easily.&lt;br /&gt;
&lt;br /&gt;
--[[User:Jannic|Jannic]] 13:58, 3 November 2007 (UTC)&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Windows_Keys&amp;diff=29365</id>
		<title>Windows Keys</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Windows_Keys&amp;diff=29365"/>
		<updated>2007-04-16T22:07:51Z</updated>

		<summary type="html">&lt;p&gt;Runia: add: hint to get right keycode&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top;padding-right:20px;width:10px;&amp;quot; |&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot; |&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;&amp;quot;&amp;gt;&lt;br /&gt;
In 2005 Lenovo introduced Windows keys on new ThinkPad keyboards. The unfortunate side-effect of this, is that all the keys on the spacebar row are now very small, making it much more likely to hit the wrong key by accident.&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
== Linux support ==&lt;br /&gt;
{{Todo|?}}&lt;br /&gt;
&lt;br /&gt;
=== Simulating Windows keys ===&lt;br /&gt;
If your model does not have these keys, you can [[How to get special keys to work|map special keys]] to the {{key|Windows}} and {{key|Menu}}.&lt;br /&gt;
&lt;br /&gt;
For example, to make the {{key|Fn}} key behave as a {{key|Menu}} key (except keys ''combination'' don't work), add the following to {{path|~/.Xmodmap}} and run {{cmd|xmodmap ~/.Xmodmap|}}:&lt;br /&gt;
 keycode 227 = Menu&lt;br /&gt;
&lt;br /&gt;
Hint: examine correct keycode using ''xev''. Here with a recent (2007-04) {{X60}} it is 115 and 117, left and right resp.&lt;br /&gt;
&lt;br /&gt;
== Windows support ==&lt;br /&gt;
The keys are natively supported in Windows.&lt;br /&gt;
=== Simulating Windows keys ===&lt;br /&gt;
For {{Windows}}, it is possible to use the [http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-44185 Keyboard customizer utility] to remap certain keys to act as windows and menu keys. The keyboard customizer utility also performs some additional functions, such as assigning shortcut keys on an external keyboard.&lt;br /&gt;
&lt;br /&gt;
==Models featuring this Technology==&lt;br /&gt;
*ThinkPad {{T60}}, {{T60p}}&lt;br /&gt;
*ThinkPad {{X60}}, {{X60s}}&lt;br /&gt;
*ThinkPad {{Z60m}}, {{Z60t}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Glossary]]&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=User:Runia&amp;diff=29364</id>
		<title>User:Runia</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=User:Runia&amp;diff=29364"/>
		<updated>2007-04-16T22:00:56Z</updated>

		<summary type="html">&lt;p&gt;Runia: add: lnk to tf&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Have a look at [http://think-future.com/ my page in the net].&lt;br /&gt;
&lt;br /&gt;
Feel free to drop me a message. :-)&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=How_to_get_the_internal_SD_card_working&amp;diff=29363</id>
		<title>How to get the internal SD card working</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=How_to_get_the_internal_SD_card_working&amp;diff=29363"/>
		<updated>2007-04-16T21:59:30Z</updated>

		<summary type="html">&lt;p&gt;Runia: chg: stress that starting from 2.6.17-rc1 no patch required&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter=&lt;br /&gt;
&lt;br /&gt;
1. First of it all you need a working kernel 2.6 source.&lt;br /&gt;
&lt;br /&gt;
2. Get the patches at http://mmc.drzeus.cx/wiki/Linux/Drivers/sdhci all the *.bin. &lt;br /&gt;
&lt;br /&gt;
=&amp;gt; Note that with kernel versions &amp;gt;= 2.6.17-rc1, the driver is included in the kernel, and patching is unnecessary.&lt;br /&gt;
&lt;br /&gt;
3. Patch your kernel&lt;br /&gt;
&lt;br /&gt;
  cd /usr/src/linux&lt;br /&gt;
  patch -p1 &amp;lt; sdhci-0001.bin&lt;br /&gt;
  patch -p1 &amp;lt; pci-sdhc-0001.bin&lt;br /&gt;
  patch -p1 &amp;lt; mmc-respopcode-0001.bin&lt;br /&gt;
&lt;br /&gt;
4. reconfigure your kernel with menuconfig&lt;br /&gt;
&lt;br /&gt;
  make menuconfig&lt;br /&gt;
&lt;br /&gt;
5. activate &amp;quot;Device Drivers&amp;quot; -&amp;gt; &amp;quot;MMC/SD Card support&amp;quot; &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;*&amp;gt; MMC support&lt;br /&gt;
  &amp;lt;*&amp;gt;   MMC block device driver&lt;br /&gt;
  &amp;lt;M&amp;gt;   Secure Digital Host Controller Interface support  (EXPERIMENTAL)&lt;br /&gt;
&lt;br /&gt;
6. recompile your kernel &amp;amp; reboot&lt;br /&gt;
&lt;br /&gt;
  make clean &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make modules_install.. dont forget to copy your new kernel. ;)&lt;br /&gt;
&lt;br /&gt;
7. Modprobe your new kernel module:&lt;br /&gt;
&lt;br /&gt;
  modprobe sdhci&lt;br /&gt;
&lt;br /&gt;
8. Mount your SD card&lt;br /&gt;
&lt;br /&gt;
  mount /dev/mmcblk0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
9. RocknRoll&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Ubuntu 6.10 'edgy eft': ==&lt;br /&gt;
To get the card reader working on edgy:&lt;br /&gt;
&lt;br /&gt;
Add the module 'tifm_sd' to /etc/modules and restart. Now this module gets loaded on sys bootup and a card is detected when inserted. The card reader is found as /dev/mmcblk0 and mounted automatically on card insert.&lt;br /&gt;
&lt;br /&gt;
'''Step-by-step:'''&lt;br /&gt;
&lt;br /&gt;
1. Make a backup of your 'modules' in case something goes wrong:&lt;br /&gt;
  {{cmduser|sudo cp /etc/modules /etc/modules.backup}}&lt;br /&gt;
2. Open the file with gedit:&lt;br /&gt;
  {{cmduser|sudo gedit /etc/modules}}&lt;br /&gt;
3. Add the following entry to the end of the file:&lt;br /&gt;
  tifm_sd&lt;br /&gt;
4. Save and close the file. On the next boot, the sd-card reader works.&lt;br /&gt;
&lt;br /&gt;
As mentioned below, this is already reported as a bug: [https://launchpad.net/distros/ubuntu/+bug/53268 BUG #53268]&lt;br /&gt;
&lt;br /&gt;
== Update for FC5 running the newest 2.6.17 kernel: ==&lt;br /&gt;
&lt;br /&gt;
1. modprobe mmc_block&lt;br /&gt;
&lt;br /&gt;
2. modprobe sdhci&lt;br /&gt;
&lt;br /&gt;
3. mount /dev/mmcblk0p1 /mnt&lt;br /&gt;
&lt;br /&gt;
4. RocknRoll &lt;br /&gt;
&lt;br /&gt;
Tested on my X41 with 04:00.1 Class 0805: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 13)&lt;br /&gt;
&lt;br /&gt;
=== Automated module loading ===&lt;br /&gt;
&lt;br /&gt;
I'm using ASPLinux release 11 (Seliger) based on FC4 and kernel 2.6.17-1.2142asp.&lt;br /&gt;
&lt;br /&gt;
* 1. I created the script &amp;lt;code&amp;gt;/etc/sysconfig/modules/sd.modules&amp;lt;/code&amp;gt; to load modules on boot. Don't forget to chmod it 775.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
&lt;br /&gt;
start () {&lt;br /&gt;
        for i in mmc_core mmc_block sdhci; do&lt;br /&gt;
                /sbin/modprobe $i &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
        done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
stop () {&lt;br /&gt;
        for i in sdhci mmc_block mmc_core; do&lt;br /&gt;
                /sbin/rmmod $i &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;br /&gt;
        done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
restart() {&lt;br /&gt;
        stop&lt;br /&gt;
        start&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
case $1 in&lt;br /&gt;
        start)&lt;br /&gt;
                start&lt;br /&gt;
        ;;&lt;br /&gt;
        stop)&lt;br /&gt;
                stop&lt;br /&gt;
        ;;&lt;br /&gt;
        restart)&lt;br /&gt;
                echo -n &amp;quot;Reloading SD modules&amp;quot;&lt;br /&gt;
                restart&lt;br /&gt;
                echo &amp;quot;.. DONE&amp;quot;&lt;br /&gt;
        ;;&lt;br /&gt;
        *)&lt;br /&gt;
        start&lt;br /&gt;
esac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* 2. This script will run after reboot. When you insert a card the automount system in KDE or Gnome will catch the medium on the fly. I found that it only works if the medium is inserted at boot time due to a '''BUG''' :-(. That's why my script is longer then it has to be...&lt;br /&gt;
&lt;br /&gt;
'''BUG''' Currently the bug exists in automounting an SD card. The SD card is mounted properly when the card is inserted at boot time (or at time when modules is loaded). Otherwise it is not mounted ([https://launchpad.net/distros/ubuntu/+bug/53268 BUG #53268]). The temporary  workaround is to remove &amp;amp;&amp;amp; insert the module while the medium is in the reader (&amp;lt;code&amp;gt;/etc/sysconfig/modules/sd.modules restart&amp;lt;/code&amp;gt;). Note that you have to be root to perform this.&lt;br /&gt;
&lt;br /&gt;
Tested on my Z60t with 14:00.2 Class 0805: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 17)&lt;br /&gt;
&lt;br /&gt;
=Texas Instruments 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD)=&lt;br /&gt;
&lt;br /&gt;
To get the TI 5in1 Card Reader (like it is built in the {{Z61m}}) to work, you need a recent kernel (I use 2.6.19 on {{Debian}} Sid here, should work with 2.6.18 too) with some special options enabled:&lt;br /&gt;
&lt;br /&gt;
{{kernelconf|CONFIG_TIFM_CORE|[M]|TI Flash Media interface support (EXPERIMENTAL)|Misc devices|Device Drivers||}}&lt;br /&gt;
&lt;br /&gt;
{{kernelconf|CONFIG_TIFM_7XX1|[M]|TI Flash Media PCI74xx/PCI76xx host adapter support (EXPERIMENTAL)|Misc devices|Device Drivers||}}&lt;br /&gt;
&lt;br /&gt;
{{kernelconf|CONFIG_MMC|[M]|MMC support|MMC/SD Card support|Device Drivers||}}&lt;br /&gt;
&lt;br /&gt;
{{kernelconf|CONFIG_MMC_BLOCK|[M]|MMC block device driver|MMC/SD Card support|Device Drivers||}}&lt;br /&gt;
&lt;br /&gt;
{{kernelconf|CONFIG_MMC_TIFM_SD|[M]|TI Flash Media MMC/SD Interface support  (EXPERIMENTAL)|MMC/SD Card support|Device Drivers||}}&lt;br /&gt;
&lt;br /&gt;
After rebuilding your kernel, you should get some new modules: tifm_core, tifm_7xx1, mmc_core, mmc_block, tifm_sd. The first two will get autoloaded on boot, if you use some kind of hardware-autodetection, the others won't, so edit your {{path|/etc/modules}} (or however the file where the modules to load on boot are listed is called by your distribution) and add these modules there.&lt;br /&gt;
&lt;br /&gt;
After a reboot, or after you've loaded the modules by-hand with modprobe, you can put a SD-Card into the slot and see the light blink once. You should see something like this in your {{cmduser|dmesg}} output:&lt;br /&gt;
&lt;br /&gt;
  tifm_7xx1: sd card detected in socket 1&lt;br /&gt;
  mmcblk0: mmc0:b368 SMI   999424KiB&lt;br /&gt;
   mmcblk0: p1&lt;br /&gt;
  mmcblk0: error 4 sending stop command&lt;br /&gt;
  end_request: I/O error, dev mmcblk0, sector 1998840&lt;br /&gt;
  Buffer I/O error on device mmcblk0, logical block 249855}}&lt;br /&gt;
&lt;br /&gt;
Don't care about the errors, my card is still working.&lt;br /&gt;
Now you can mount the card with {{cmdroot|mount /dev/mmcblk0p1 /somewhere}} and work with it.&lt;br /&gt;
&lt;br /&gt;
{{NOTE|This works only for SD cards at the moment, the driver isn't able to handle MMC/MS/MS PRO/xD yet.}}&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=SD_Card_slot&amp;diff=29362</id>
		<title>SD Card slot</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=SD_Card_slot&amp;diff=29362"/>
		<updated>2007-04-16T21:52:03Z</updated>

		<summary type="html">&lt;p&gt;Runia: /* Linux support */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;&amp;quot;&amp;gt;&lt;br /&gt;
The SD Card slot (Secure Digital) is found on select ThinkPads and Docking stations.&lt;br /&gt;
&lt;br /&gt;
In addition to SD Cards, SD Card slots can also accept the older MMC (MultiMedia Card).&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
* [[Wikipedia:Secure Digital card|Wikipedia article on SD Cards]]&lt;br /&gt;
* [[Wikipedia:Multimedia Card|Wikipedia article on MMC Cards]]&lt;br /&gt;
&lt;br /&gt;
==PCI-based SD Card slot==&lt;br /&gt;
This implementation is called &amp;quot;SD Card with IO support&amp;quot;, and supports in addition to regular SD memory cards also special SDIO cards (e.g. Bluetooth, WiFi, etc).&lt;br /&gt;
&lt;br /&gt;
=== Linux support ===&lt;br /&gt;
lspci reports it as a Ricoh device with PCI ID 1180:0822 (X Series, Z60m, Z60t), or 1180:0841 (Z Series).&lt;br /&gt;
&lt;br /&gt;
The [http://mmc.drzeus.cx/wiki/Linux/Drivers/sdhci sdhci project] has developed a driver that supports these and other SD controller chips. The driver has been reported to work on ThinkPad {{X40}}, {{X41}}, {{Z60m}}, {{Z60t}} and {{X60}} models, and has been available in mainline kernel since 2.6.17-rc1. See also &amp;quot;[[How to get the internal SD-CARD working]]&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Models featuring this Technology ===&lt;br /&gt;
* ThinkPad {{X40}}, {{X41}}, {{X41T}}&lt;br /&gt;
* ThinkPad {{X60}}, {{X60s}}&lt;br /&gt;
* ThinkPad {{Z60m}}, {{Z60t}}&lt;br /&gt;
&lt;br /&gt;
==USB based SD Card slot==&lt;br /&gt;
This implementation only supports SD Memory cards.&lt;br /&gt;
&lt;br /&gt;
=== Linux support ===&lt;br /&gt;
Should be supported by the Linux USB Storage drivers (usb-storage).&lt;br /&gt;
&lt;br /&gt;
=== Models featuring this Technology ===&lt;br /&gt;
* [[ThinkPad Advanced Dock]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Components]]&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Talk:Tp_smapi&amp;diff=29361</id>
		<title>Talk:Tp smapi</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Talk:Tp_smapi&amp;diff=29361"/>
		<updated>2007-04-16T21:50:29Z</updated>

		<summary type="html">&lt;p&gt;Runia: add: cat:X60&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Feedback ==&lt;br /&gt;
&lt;br /&gt;
Great, great work! Really! This completely rocks. I just stopped my battery from charging at 77% and restarted charging a bit later, no problems whatsoever. BTW, this is on kernel 2.6.14.3.&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 21:25, 5 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
None of the fuctions is working on my T40, kernel 2.6.14-mm2.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lammic|lammic]], 2005.12.05&lt;br /&gt;
&lt;br /&gt;
Works for me on a T41 running 2.6.12-10-686 (Ubuntu 5.10).&lt;br /&gt;
&lt;br /&gt;
--[[User:berndtnm|berndtnm]], 2005.12.06&lt;br /&gt;
&lt;br /&gt;
Including stop_charge_thresh? That one seems to be missing on the T42p.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 00:46, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
tp_smapi works just fine on an R52 with Ubuntu Breezy stock kernel.&lt;br /&gt;
&lt;br /&gt;
--[[User:Micampe|Micampe]] 12:52, 7 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
''To set the thresholds for starting and stopping battery charging (in percent of current capacity):''&lt;br /&gt;
&lt;br /&gt;
'''current''' really? That'd be weird, I'd expect it to be percent of '''total''' capacity.&lt;br /&gt;
&lt;br /&gt;
--[[User:Micampe|Micampe]] 14:39, 7 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Current full charge capacity&amp;quot;, as opposed to &amp;quot;current remaining capacity&amp;quot; or &amp;quot;designed full charge capacity&amp;quot;...&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 15:05, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Battery features don't work with my T41p. I can't check this with windows. Can anybody try these features?&lt;br /&gt;
&lt;br /&gt;
-- Nils, 7 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nils, does cdrom_speed work for you on the T41p? Could you provide the details requested in the README (dmesg etc.)?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:57, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
CDRom Speed seems to work. (I see no warnings, but I have to do a speed test.) Now, I've send all outputs to the email-address in the readme.&lt;br /&gt;
&lt;br /&gt;
-- Nils, 8 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
All the features except the stop_charge_thresh seem to work here on a t42p. &lt;br /&gt;
One note, the start_charge_thresh seems to really be stop_charge_thresh. Ie, If I set that to lower than my current battery %, it will never charge, &lt;br /&gt;
and if I set it to 100 the battery charges all the way. &lt;br /&gt;
&lt;br /&gt;
--[[User:Nirik|Nirik]] 16 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nirik, &amp;quot;all the features&amp;quot; as of which version? For example, do the force_discharge{1,2} in tp_smapi 0.12 also work for you? See the table in the article page. About start_charge, that's odd. Can you send me a log of what you did, what was the result a what was the dmesg output for each operation?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 14:16, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
System T40p:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# echo 1 &amp;gt; /sys/devices/platform/smapi/BAT0/force_discharge1&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# echo 1 &amp;gt; /sys/devices/platform/smapi/BAT0/force_discharge2&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# dmesg   &lt;br /&gt;
tp_smapi: req_in: BX=2118 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=8680 BX=2118 CX=100 DX=b2 DI=0 SI=0 ret=-38&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge1 of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: req_in: BX=2104 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=80 BX=2103 CX=100 DX=78 DI=0 SI=0 ret=0&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 0: bx=2103&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So it seems force_discharge1 is not supported at all. But force_discharge2? By the way, i think wiki is a _very_ good idea for collecting information, but not for discussion. I would prefer a maillinglist. We can use sourceforge.&lt;br /&gt;
&lt;br /&gt;
--[[User|StefanSchmidt]]&lt;br /&gt;
&lt;br /&gt;
force_discharge2 is indicating a real error condition (bx=2103 which has bit 0x02 on), but I have no idea what the error is or how to fix it. Sorry. If you can trigger this function under Windows and have SoftICE or equivalent, maybe it can be worked out.&lt;br /&gt;
&lt;br /&gt;
About the Wiki discussion, I'm not sure a mailing list is justified yet, but you can use the linux-thinkpad list or the e-mail address in the README. &lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:42, 16 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
OK, then i use linux-thinkpad to get more people involved. I'am away the next weeks, but i hope to find some time to hacking on tp_smapi.&lt;br /&gt;
&lt;br /&gt;
--[[User:StefanSchmidt]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Someone reported cd_speed works on T42 but on mine, it doesn't: this is 2378DXU&lt;br /&gt;
&lt;br /&gt;
--[[User:eBug]] 22:55, 17 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
eBug, how does it fail? If the file doesn't exist, it means you didn't enable PROVIDE_CD_SPEED (see the README). If it does exist, can you provide the dmesg output when you read an write to the file?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 11:53, 18 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To confirm:&lt;br /&gt;
tp_smapi 0.13 works with hdaps module loaded on T41 (2373-8RG). However, force_discharge*, inhibit_charge_minutes, start_charge_thresh, stop_charge_thresh don't seem to be implemented on this model.&lt;br /&gt;
&lt;br /&gt;
--[[User:LJSBRokken|LJSBrokken]] 21 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
tp_smapi version 0.13 with T23 (2647-3QG) (I have dual batteries)...&lt;br /&gt;
&lt;br /&gt;
None of the functions which make any changes work...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /sys/devices/platform/smapi &amp;amp;&amp;amp; cat BAT*/* &amp;gt; /dev/null&lt;br /&gt;
cat: BAT0/force_discharge1: Function not implemented&lt;br /&gt;
cat: BAT0/force_discharge2: Input/output error&lt;br /&gt;
cat: BAT0/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT0/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT0/stop_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge1: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge2: Input/output error&lt;br /&gt;
cat: BAT1/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT1/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/stop_charge_thresh: Function not implemented&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, all the battery status information is available, and functions appear for both BAT0 and BAT1, regardless of when the UltraBay battery was inserted or ejected- this is very useful, it is the only way I can monitor my UltraBay battery unless it was present on boot.&lt;br /&gt;
&lt;br /&gt;
--[[User:SystemParadox|SystemParadox]] 21:51, 4 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
SystemParadox, what's the dmesg output produced by &amp;quot;cat BAT0/force_discharge2&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 22:02, 4 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
After the upgrade to 0.14 (with kernel 2.6.15, using the patch) I can't use inhibit_charge and start/stop_charge_thresh any longer (getting an input/output error), the dmesg debug output when {{cmd|cat|}}-ing those three files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: tp_smapi 0.14 loading...&lt;br /&gt;
tp_smapi: successfully loaded (smapi_port=0xb2).&lt;br /&gt;
tp_smapi: req_in: BX=2114 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=ea210080 BX=ec192114 CX=c18d0700 DX=f7cc00b2 DI=f7f50000 SI=c18d0000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Unknown error code&lt;br /&gt;
tp_smapi: req_in: BX=2116 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=c03b0080 BX=c18d2116 CX=c0160328 DX=ec7600b2 DI=ec760000 SI=a0810000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Unknown error code&lt;br /&gt;
tp_smapi: req_in: BX=211a CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=c03b0080 BX=c18d211a CX=c016032c DX=eb4500b2 DI=eb450000 SI=241e0000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Unknown error code&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 08:12, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Oops, the transition to 32-bit SMAPI calls was broken. Fixed in 0.15. Thanks for the quick report!&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:10, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Yep, 0.15 works again. Quick response, bravo! :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 12:23, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
On a T22, nothing seems to work with 0.16.&lt;br /&gt;
&lt;br /&gt;
[[http://www.rafb.net/paste/results/fcUUDs49.html|dmesg output]] when doing cat *&lt;br /&gt;
&lt;br /&gt;
I am using an Ultrabay2000 battery, so it would be really usefull to be able to control that&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Not even the extended battery status? That does work on T23. About the control features, I believe they're not available on the T23; did you have any kind of (dis)charge control under WindowS?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:59, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I don't really know what 'extended battery' status means, but here an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat current_*                                                     /sys/devices/platform/smapi/BAT1&lt;br /&gt;
cat: current_avg: Input/output error&lt;br /&gt;
cat: current_now: Input/output error&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is what happens when i cat any file in this directory and also in ../BAT1 :(&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Thu Jan 12 22:07:26 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Yes, that's what I meant. What's the {{cmdroot|dmesg}} output generated by these commands?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 00:27, 13 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thinker: I attached some link to my first comment but it seems to be down and the link was wrong anyway.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Fri Jan 13 14:35:57 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Thanks; but there's not much we can do. Maybe the T22 uses a different interface, or doesn't have that feature.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 23:23, 15 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thinker: Is there anything I can do to check if the interface is different? Changing 0x1610 to some random number?&lt;br /&gt;
&lt;br /&gt;
Is there a chance to get it by try and error?&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Mon Jan 16 19:10:12 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
0x1610 is the number of an IO port it writes to, so changing it to a random number will pretty much guarantee a system crash...&lt;br /&gt;
&lt;br /&gt;
The only way I can think of for figuring out the T22 interface is to see what the Windows software does.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 19:47, 16 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I have a R40 (2722-B3G), and several things don't work with 0.16 on linux 2.6.15.1:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't know about Windows, haven't booted it for weeks nor used it for years...&lt;br /&gt;
&lt;br /&gt;
--[[User:Wonka|Wonka]] 19:00, 19 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Wonka: do the other features (i.e., extended battery status) work on your R40?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:30, 20 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
--[[User:lisch|lisch]] 16:14, 11 April 2006 (CDT)&lt;br /&gt;
&lt;br /&gt;
On my X32, with two batteries, I get just what I expect. Looks good:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ cat BAT?/* &amp;gt; /dev/null&lt;br /&gt;
cat: BAT0/force_discharge: Function not implemented&lt;br /&gt;
cat: BAT0/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT0/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT0/stop_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge: Function not implemented&lt;br /&gt;
cat: BAT1/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT1/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/stop_charge_thresh: Function not implemented&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Changing the CD speed when the CD is being accessed will hang your computer==&lt;br /&gt;
&lt;br /&gt;
I don't have this problem on my T40p. CDROM is mounted and file on CD is opened. Change speed do '''not''' hang my system.&lt;br /&gt;
&lt;br /&gt;
-- Stefan Schmidt&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
An open file looks fine if you're not reading/writing at that point. But my T43 does hangs on this:&lt;br /&gt;
 # dd if=/dev/scd0 of=/dev/null &amp;amp;&lt;br /&gt;
 # echo 1 &amp;gt; /sys/devices/platform/smapi/cdrom_speed&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:41, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
OK, sorry. I was to fast. My system hangs on this commands, too. :(&lt;br /&gt;
&lt;br /&gt;
-- Stefan Schmidt&lt;br /&gt;
&lt;br /&gt;
Works well. Great.&lt;br /&gt;
&lt;br /&gt;
T42 2373-8zh. Working :cdrom_speed and start_charge_thresh. Untest : inhibit_charge_minutes.&lt;br /&gt;
&lt;br /&gt;
-- Haifeng Chen&lt;br /&gt;
&lt;br /&gt;
cdrom_speed works on my T40.&lt;br /&gt;
&lt;br /&gt;
-- [[User:Lammic|lammic]], 2005.12.09&lt;br /&gt;
&lt;br /&gt;
== Kernel Patch? ==&lt;br /&gt;
&lt;br /&gt;
Hello Thinker,&lt;br /&gt;
&lt;br /&gt;
would it be possible to provide the SMAPI support as kernel patch as well? Something along the lines of: (0.12 against 2.6.15-rc5)&lt;br /&gt;
&lt;br /&gt;
''(deleted, see below for how to create a patch file)''&lt;br /&gt;
&lt;br /&gt;
Deleted the tp_smapi.c file at the end, out of obvious reasons, and I'm not sure about the placement in the ACPI section, OTOH there it would be found easily next to ibm_acpi.&lt;br /&gt;
&lt;br /&gt;
Providing a patch would help when recompiling the kernel often, I hate recompiling external modules every time (even got me a kernel-upgrade script to do most of it automatically). But of course it's up to you. :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 09:52, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I'll be glad to add this, but I don't want to go through additional manual steps in the release process (there are already quite a few). Can you add a &amp;quot;make patch&amp;quot; functionality to the Makefile, or something of the sort, to automatically generate a full patch (including tp_smapi.c) against current kernel sources?&lt;br /&gt;
&lt;br /&gt;
Also, this shouldn't be under drivers/acpi, since it doesn't use ACPI at all (that's why I didn't make it a patch to ibm_acpi). I think the right place is drivers/firmware, like the dell_rbu driver for Dell laptops.&lt;br /&gt;
&lt;br /&gt;
BTW, the convention for kernel patches is to start them once level higher:&lt;br /&gt;
  diff -Nurp kernel-2.6.14-vanilla kernel-2.6.14-patched&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:12, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Of course it's from the wrong level, as usual I was just lazy/inattentive. And at one point I'll remember who likes what patch format, promise. ;)&lt;br /&gt;
&lt;br /&gt;
A patch target as in &amp;quot;create a new file holding a correct diff to current kernel source&amp;quot; would be rather difficult, since line numbers might change etc., but applying the patch should be straighforward with a bit of sed. Of course I could just do that, create a patch with the diff command and then apply the new patch file in reverse. ;)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 18:36, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it does that on a local copy (no changes the original kernel tree) and cleans up after itself, that's fine with me. :-)&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 18:50, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Ok, here's a shell script that creates the patch, feel free to use it under the terms of the GPL. For example call it from your Makefile with the patch target: (I didn't want to put all the script into the Makefile, since the rules about escaping in Makefiles, well, escape me ;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
KDIR=/lib/modules/$(uname -r)/build&lt;br /&gt;
FDIR=drivers/firmware&lt;br /&gt;
OPWD=$(pwd)&lt;br /&gt;
&lt;br /&gt;
TMPDIR=$(mktemp -d)&lt;br /&gt;
cd $TMPDIR&lt;br /&gt;
&lt;br /&gt;
mkdir -p a/$FDIR&lt;br /&gt;
cp $KDIR/$FDIR/{Kconfig,Makefile} a/$FDIR&lt;br /&gt;
cp -r a b&lt;br /&gt;
sed -i -e '/endmenu/i\&lt;br /&gt;
config IBM_SMAPI\&lt;br /&gt;
        tristate &amp;quot;IBM ThinkPad SMAPI Support&amp;quot;\&lt;br /&gt;
        depends on X86\&lt;br /&gt;
        ---help---\&lt;br /&gt;
        This adds SMAPI support on IBM ThinkPads, mostly used for battery\&lt;br /&gt;
        charge control. For more information about this driver see\&lt;br /&gt;
        &amp;lt;http://www.thinkwiki.org/wiki/SMAPI_support_for_Linux&amp;gt; .\&lt;br /&gt;
\&lt;br /&gt;
        If you have an IBM ThinkPad laptop, say Y or M here.\&lt;br /&gt;
' b/$FDIR/Kconfig&lt;br /&gt;
sed -i -e '$a\&lt;br /&gt;
obj-$(CONFIG_IBM_SMAPI)            += tp_smapi.o' b/$FDIR/Makefile&lt;br /&gt;
cp $OPWD/tp_smapi.c b/$FDIR&lt;br /&gt;
diff -Nurp a b &amp;gt; $OPWD/tp_smapi-$(uname -r).patch&lt;br /&gt;
rm -r a b&lt;br /&gt;
cd $OPWD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BTW, [http://qbnz.com/highlighter/ GeSHi]-based syntax-highlighting would be great...&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 19:28, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Ah, neat sed foo. How about [http://tpctl.sourceforge.net/tmp/Makefile this] escapade, then? &lt;br /&gt;
&lt;br /&gt;
What's the sed spell needed to replace the Makefile's&lt;br /&gt;
 VER  := 0.13&lt;br /&gt;
with auto-parsing of&lt;br /&gt;
 #define TP_VERSION &amp;quot;0.13&amp;quot;&lt;br /&gt;
from tp_smapi.c?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:37, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Hmm, something like&lt;br /&gt;
 VERFROMC=$(sed -ne 's/^#define TP_VERSION &amp;quot;\(.*\)&amp;quot;/\1/gp' tp_smapi.c)&lt;br /&gt;
 sed -i -e &amp;quot;s/^VER := .*$/VER := $VERFROMC/&amp;quot; Makefile&lt;br /&gt;
should do (untested, from the top of my head, maybe the temporary variable isn't even necessary?). And neat Makefile wizardry, at one point I'll learn the syntax.&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 20:44, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Makefile escaping is horrible, keep avoiding it... Anyway, the updated [http://tpctl.sourceforge.net/tmp/Makefile make patch] seems to do the right thing.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:36, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Small documentation request: just needed to create a patch for the not-yet-installed 2.6.16-rc2, which is no problem with&lt;br /&gt;
 make KSRC=/path/to/linux-2.6.16-rc2 KVER=2.6.16-rc2 patch&lt;br /&gt;
but I guess it would be a good addition to the README file. :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 10:48, 8 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Right, added (to next release).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 13:40, 8 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Installation questions==&lt;br /&gt;
Amazing! I've loaded this module in my T43 which is running SuSE 10 with the kernel of 2.6.13-15. I have three points to share:&lt;br /&gt;
&lt;br /&gt;
1. The battery control part seems to work but has a minor problem. I set the stop_charge_threshold to 70, but the battery stops charging at 55%. Don't know why and how to fix it. :P&lt;br /&gt;
&lt;br /&gt;
2. I don't have the cd speed control function. Here is what I have under /sys/devices/platform/smapi/:&lt;br /&gt;
&lt;br /&gt;
./  ../  ac_connected  BAT0/  BAT1/  bus@  driver@  power/&lt;br /&gt;
&lt;br /&gt;
3. SuSE 10 doesn't have the necessary C files under .../drivers/hwmon/, I copied them from a 2.6.14.5 kernel source. Maybe it causes the two problems above. :(&lt;br /&gt;
&lt;br /&gt;
When I have time, I'll install the new kernel to see if the problems are gone and report the result.&lt;br /&gt;
&lt;br /&gt;
--[[User:68.51.153.96|68.51.153.96]] 04:31, 2 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
1. It should stop charging at 70, but will only ''start'' charging when remaining capacity has dipped below &amp;lt;tt&amp;gt;start_charge_thresh&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2. See the note about PROVIDE_CD_SPEED.&lt;br /&gt;
&lt;br /&gt;
3. That's should be needed only for patching the HDAPS driver in order to make it compatible with tp_smapi. If your kernel (which version is it?) doens't inlude the HDAPS driver anyway, you don't need to patch....&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 09:28, 2 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks Thinker.&lt;br /&gt;
&lt;br /&gt;
1. I discharged and recharged the battery again. This time, it stops at 68% percent, which is pretty good.&lt;br /&gt;
&lt;br /&gt;
2. I missed the NOTE in README, for I just followed this wiki. :P&lt;br /&gt;
&lt;br /&gt;
3. My kernel version is 2.6.13-15.&lt;br /&gt;
&lt;br /&gt;
By the way, I just got this T43 whose model number is 266896U. I feel that the noise of the fan is much louder than my previous T21. I think it is so since it has a CPU with bigger power but am wondering if other T43 has the same big noise?&lt;br /&gt;
&lt;br /&gt;
--[[User:Tyne|Tyne]] 00:14, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The note about PROVIDE_CD_SPEED is also in the Wiki...&lt;br /&gt;
&lt;br /&gt;
About the T43 fan noise: yes, this is a very common (and annoying) problem. See [[Problem_with_fan_noise]] and our [[ACPI fan control script]], and send Lenovo a complaint in hope they'll fix this at the firmware level.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 08:48, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
I spent hours, trying to compile this on ubuntu edgy without success. It starts with warnings about missing files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@t40:/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31# make install&lt;br /&gt;
make -C /lib/modules/2.6.17-11-386/source M=/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31 O=/lib/modules/2.6.17-11-386/build modules&lt;br /&gt;
make[1]: Betrete Verzeichnis '/usr/src/linux-source-2.6.17'&lt;br /&gt;
/usr/src/linux-source-2.6.17/Makefile:450: .config: No such file or directory&lt;br /&gt;
&lt;br /&gt;
  WARNING: Symbol version dump /lib/modules/2.6.17-11-386/build/Module.symvers&lt;br /&gt;
           is missing; modules will have no dependencies and modversions.&lt;br /&gt;
&lt;br /&gt;
  CC [M]  /home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.o&lt;br /&gt;
cc1: error: include/linux/autoconf.h: No such file or directory&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then many thousand lines later it finally stops:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:357: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c: In function â€˜thinkpad_ec_invalidateâ€™:&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:378: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c: In function â€˜thinkpad_ec_initâ€™:&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:460: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
make[3]: *** [/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.o] Fehler 1&lt;br /&gt;
make[2]: *** [_module_/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31] Fehler 2&lt;br /&gt;
make[1]: *** [modules] Fehler 2&lt;br /&gt;
make[1]: Verlasse Verzeichnis '/usr/src/linux-source-2.6.17'&lt;br /&gt;
make: *** [modules] Fehler 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There must be something fundamentally wrong with the makefile. I have for example never seen that a symlink has to point from /lib/modules/someversion/somewhere to /usr/src/linux. I have installed other modules in the past and they all worked with installed linux-headers package. I didn't ever have to download 40MB kernel source, unpack it, configure it to have a .config and compile the whole kernel just to have 2 or three of the other files needed. This cannot be the correct way to install a driver.&lt;br /&gt;
&lt;br /&gt;
[[User:7bit|7bit]] 07:42, 27 March 2007 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Formatting ==&lt;br /&gt;
&lt;br /&gt;
Wyrfel, that was some heavy editing you did... I agree with most changes (including the saner color choice). I did like those HINT floats, though - they keep the hints from interrupting the flow of text too much, and this particular text needs any help it can get.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:04, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
Hei Thinker,&lt;br /&gt;
&lt;br /&gt;
I'll look into it again. I felt that the floating HINTs were tearing the text apart too much. Maybe we could fix it by placing the clear marks somewhere else.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 18:46, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Dual battery operation with tp_smapi ==&lt;br /&gt;
&lt;br /&gt;
It looks like it is working quite fine with tp_smapi-0.13 and 2.6.15 (it may also work with other versions, but those are the ones I have running right now).&lt;br /&gt;
&lt;br /&gt;
The juicy details:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cd /sys/devices/platform/smapi/}}&lt;br /&gt;
{{cmdroot|cat ac_connected}}&lt;br /&gt;
&lt;br /&gt;
{{cmdresult|0}}&lt;br /&gt;
{{cmdroot|cat BAT{0,1}/state}}&lt;br /&gt;
{{cmdresult|discharging}}&lt;br /&gt;
{{cmdresult|idle}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|echo 1 &amp;gt; BAT1/force_discharge1}}&lt;br /&gt;
{{cmdroot|cat BAT{0,1}/state}}&lt;br /&gt;
{{cmdresult|idle}}&lt;br /&gt;
{{cmdresult|discharging}}&lt;br /&gt;
&lt;br /&gt;
Checking capacity values shows that the corrent battery is being depleted.&lt;br /&gt;
&lt;br /&gt;
And remember, before you yank the CD/DVD drive out, issue:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cat eject &amp;gt; /proc/acpi/ibm/bay}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Great! Which ThinkPad model is it? Could you also {{cmdroot|cat /sys/devices/platform/smapi/BAT{0,1}/force_discharge2}} and report the dmesg output (after {{cmdroot|make load}} or {{cmdroot|1=modprobe tp_smapi debug=1}})?&lt;br /&gt;
&lt;br /&gt;
About the eject command, I think it should be possible to do that automatically when the Ultrabay handle is ejected, via &amp;lt;tt&amp;gt;acpid&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 15:45, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
It's a T43 (2669). cat'ing force_discharge2 gives me an I/O error and I see&lt;br /&gt;
&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 0: bx=2103&lt;br /&gt;
&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 1: bx=2103&lt;br /&gt;
&lt;br /&gt;
I find these errors irrelevant from the user's point of view, though. &lt;br /&gt;
&lt;br /&gt;
Indeed, it should be possible to automatise the &amp;quot;eject&amp;quot; command. I should also be noted that once a force_discharge1 is set, it will NOT unset automatically, event when the AC is plugged back in. An obvious fix is to fiddle with the appropriate ACPI event to force_discharge1 back to 0 for all batteries once the AC is attached.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks, this eliminates the last situation I imagined &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; might work. The next tp_smapi version will remove &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; and rename &amp;lt;tt&amp;gt;force_discharge1&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;force_discharge&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you write those ACPI scripts, it would be great if you put them on the Wiki.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:31, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Well, I still do not preclude the fact that &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; may be useful for something else on other models.&lt;br /&gt;
&lt;br /&gt;
The ACPI scripts (as well as an installation guide) is underway. It may take a while, though.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
See the new article: [[Using an Ultrabay battery]].&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:05, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Hei Thinker,&lt;br /&gt;
&lt;br /&gt;
i just renamed the new page. Will adjust your links later on. Keeping the redirect page until that's done. Please set any new links you create to the new page (the pages of the individual UltraBay batteries should contain a pointer).&lt;br /&gt;
&lt;br /&gt;
On a sidenote: I would like to split the SMAPI support under Linux page into a tp_smapi driver page, just listing the features, and a &amp;quot;How to use tp_smapi&amp;quot; page. I would also split the thinkpad/tpctl page off that again. Any objections?&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 20:42, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
ACK about the page rename (the old one did sound a bit out of line to my ear, but I couldn't spot why...).&lt;br /&gt;
&lt;br /&gt;
About the splitting tp_smapi vs. thinkpad/tpctl, no objection.&lt;br /&gt;
&lt;br /&gt;
About splitting tp_smapi: currently most of that section doubles as both a spec and a HOWTO, which I think is a convenient and concise way to describe things (hey, it must be right, the Perl docs do it!). I'm not sure there's much benefit in duplicating that. Perhaps we should wait for a critical mass of additional lore to accumulate?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:04, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
Ok, i agree on the latter.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 00:57, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Article name capitalization== &lt;br /&gt;
&lt;br /&gt;
Wikimedia autocapitalizes the article name upon submit. How do I concince Wikimedia that I really want a lowercase &amp;quot;t&amp;quot;? The underline is probably too much too ask...&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 11:03, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Impossible, according to [http://en.wikipedia.org/wiki/Wikipedia:Canonicalization Wikipedia:Canonicalization].&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:04, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Status Table==&lt;br /&gt;
For at least the T series i think that charge control was not supported prior to the T42, hardware/BIOS side. Perhaps &amp;quot;N/A&amp;quot; flags would be better here?&lt;br /&gt;
&lt;br /&gt;
I also created &amp;lt;nowiki&amp;gt;{{Isup}}&amp;lt;/nowiki&amp;gt; style templates for status, they just include images, like {{Isup}}.&lt;br /&gt;
Not emotional about it, just wanted to let you know in case you want to use them.&lt;br /&gt;
&lt;br /&gt;
Third and last...would it possibly be better to make the table headers more human readable like i.e. &amp;quot;lower charge threshold&amp;quot; or something like that instead of &amp;quot;start_charge_thresh&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 19:21, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
About &amp;quot;N/A&amp;quot;, sure, if we get reliable data about the hardware capabilities. Alas, most negative reports were just &amp;quot;it doesn't work&amp;quot;, and in some cases gave contradictory information (SMAPI interface says a function is unsupported but user says it works under Windows).&lt;br /&gt;
&lt;br /&gt;
About {{Iyes}} and friends, they're very cute, but I think think they're harder to parse visually and would add some clutter to an already dense table.&lt;br /&gt;
&lt;br /&gt;
The table headers are just the names of the control files - that's important to keep, sine it's the most natural lookup key. Adding friendly description would be great, if we can fit them in (not everyone has an SXGA+ display...). I tried and failed.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:38, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I have a T41p and the windows tools still don't offer me battery management, even though it's quite a while since the T42 came out.&lt;br /&gt;
&lt;br /&gt;
I'm ok with the rest.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 22:35, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the {{X40}}, I can report success using the stop_charge_thresh feature with BIOS v2.03 (1UETC8WW) and Embedded Controller Program v1.60 (1UHTB0WW).&lt;br /&gt;
&lt;br /&gt;
[[User:Peterco|Peterco]] 12:07, 28 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Z60t ==&lt;br /&gt;
&lt;br /&gt;
Tested on Z60t. No errors using cat. Setting thresholds works. Status and capacity queries work. --[[User:Alon|Alon]] 21:44, 4 May 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Problem setting thresholds with X40 ==&lt;br /&gt;
&lt;br /&gt;
My X40, kernel 2.6.16 and tp_smapi 0.20.  I try to set the thresholds to 40% and 90% using:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo 90 &amp;gt; stop_charge_thresh&lt;br /&gt;
# echo 40 &amp;gt; start_charge_thresh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which should work, and the kernel reports from dmesg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: successfully loaded (smapi_port=0xb2).&lt;br /&gt;
tp_smapi: battery 0: changed start threshold to 85(+1)&lt;br /&gt;
tp_smapi: battery 0: changed stop threshold to 90&lt;br /&gt;
tp_smapi: battery 0: changed start threshold to 39(+1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
but, on confirmation here is what happens:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat stop_charge_thresh&lt;br /&gt;
90&lt;br /&gt;
# cat start_charge_thresh&lt;br /&gt;
91&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Any clues as to why start doesn't keep?  Or why its always at 1 above stop_charge_thresh?&lt;br /&gt;
&lt;br /&gt;
--[[User:Xmm0|Xmm0]] 15:01, 17 May 2006 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Is it any different if you first set start_charge_thresh and then stop_charge_thresh? &lt;br /&gt;
&lt;br /&gt;
Can you please load tp_smapi with module option &amp;quot;debug=1&amp;quot; and report the dmesg output genereated by each command?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:31, 17 May 2006 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Battery daemon feedback requested ==&lt;br /&gt;
&lt;br /&gt;
I am writing a battery-management daemon to control charging and discharging BAT0 and BAT1 in accordance with usage patterns that extend Li-Ion and Li-Py battery life.&lt;br /&gt;
&lt;br /&gt;
By default, the machine fully discharges BAT1 first, and it is said that deep-cycling all the time dramatically shortens their lifetime.&lt;br /&gt;
&lt;br /&gt;
My Z61t is the test machine, and it is configured with two batteries, the stock 4-cell, and an &amp;quot;Advanced Ultrabay&amp;quot;, which about doubles the runtime of the machine.&lt;br /&gt;
&lt;br /&gt;
Currently there are two &amp;quot;modes&amp;quot; of the daemon:&lt;br /&gt;
&lt;br /&gt;
Discharging mode.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * look at the &amp;quot;remaining_percent&amp;quot; values for both batteries&lt;br /&gt;
 * if one is more than THRESHOLD percent less than the other one, &lt;br /&gt;
      force discharge from the battery with more capacity left&lt;br /&gt;
 (the current value for THRESHOLD is 10%)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I believe the preceeding will prevent either battery from being deep-cycled disproportionately.&lt;br /&gt;
&lt;br /&gt;
Charging mode.  I am less sure what the &amp;quot;right&amp;quot; algorithm is here.  The following is a proposal.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * look at the &amp;quot;remaining_percent&amp;quot; values for both batteries&lt;br /&gt;
 * if one is more than THRESHOLD percent less than the other one, &lt;br /&gt;
      force charging to the battery with less capacity left&lt;br /&gt;
 * honor pre-set values in stop_charge_thresh and start_charge_thresh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I would like to get feedback in the form of &amp;quot;better&amp;quot; algorithms or requests for this daemon.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 19:03, 12 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
It sounds like your algorithm will indeed minimize wear on both batteries. A side benefit is that charging will toggle between the batteries, which may help keep them cooler while charging and thus prolong their life. OTOH, if you plan to occasionally swap the UltraBay battery for other devices, you may want to fully charge the system battery (up to stop_charge_thresh) first.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 22:57, 12 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have noticed that when force_discharge is set and the batteries switch, the gnome battery monitoring applet gets totally confused about remaining runtime.  Besides being a nuisance, this could presumably cause premature emergency shutduwn.&lt;br /&gt;
&lt;br /&gt;
I have also noticed that the reported remaining runtimes vary greatly between acpi, the applet, and /proc/acpi/battery/*/state&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 21:46, 14 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
What do you mean by &amp;quot;acpi&amp;quot; vs. &amp;quot;/proc/acpi/battery/*/state&amp;quot;? &lt;br /&gt;
&lt;br /&gt;
The most accurate readout is probably {{path|/sys/devices/platform/smapi/BAT0/remaining_running_time}}, but I don't think any applet uses that yet.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:07, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
By acpi, I meant the output of the acpi (1) command.   I'll get some comparative numbers later and post them here.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 20:37, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Odd, my version of {{path|/usr/bin/acpi}} doesn't report remaining time, just percent (which is the same as {{path|/sys/devices/platform/smapi/BAT0/remaining_percent}}).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:32, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
I have been running batteryd for a while with good results.  I will upload it here shortly.&lt;br /&gt;
&lt;br /&gt;
I disabled the preferential charging mode, and only control discharging.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 23:15, 14 November 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
http://demigod.org/~zak/src/batteryd.cc&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 20:18, 5 December 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
== Instructions for X60 with Bios 1.11 under Debian Etch ==&lt;br /&gt;
&lt;br /&gt;
Could someone please provide step-by-step instructions of how to make this work with Debian? What have I to do after  apt-get install kernel-patch-tpsmapi? Thank you!&lt;br /&gt;
&lt;br /&gt;
--[[User:PeterBursch|PeterBursch]] 21:39, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
== tp_smapi 0.30 with kernel 2.6.20? ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;T60:~/tp_smapi-0.30# uname -rm&lt;br /&gt;
2.6.20 x86_64&lt;br /&gt;
&lt;br /&gt;
T60:~/tp_smapi-0.30# make load&lt;br /&gt;
if lsmod | grep -q '^hdaps '; then rmmod hdaps; fi&lt;br /&gt;
if lsmod | grep -q '^tp_smapi '; then rmmod tp_smapi; fi&lt;br /&gt;
if lsmod | grep -q '^thinkpad_ec '; then rmmod thinkpad_ec; fi&lt;br /&gt;
if lsmod | grep -q '^tp_base '; then rmmod tp_base; fi  # old thinkpad_ec&lt;br /&gt;
make -C /lib/modules/2.6.20/source M=/root/tp_smapi-0.30 O=/lib/modules/2.6.20/build modules&lt;br /&gt;
make[1]: Entering directory `/usr/src/linux-2.6.20'&lt;br /&gt;
  CC [M]  /root/tp_smapi-0.30/thinkpad_ec.o&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:83: warning: type defaults to 'int' in declaration of 'DECLARE_MUTEX'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:83: warning: parameter names (without types) in function declaration&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_lock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: warning: implicit declaration of function 'down_interruptible'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: (Each undeclared identifier is reported only once&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: for each function it appears in.)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_try_lock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:109: warning: implicit declaration of function 'down_trylock'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:109: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_unlock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:122: warning: implicit declaration of function 'up'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:122: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
make[3]: *** [/root/tp_smapi-0.30/thinkpad_ec.o] Error 1&lt;br /&gt;
make[2]: *** [_module_/root/tp_smapi-0.30] Error 2&lt;br /&gt;
make[1]: *** [modules] Error 2&lt;br /&gt;
make[1]: Leaving directory `/usr/src/linux-2.6.20'&lt;br /&gt;
make: *** [modules] Error 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Works here with 2.6.21-rc1 (didn't try 2.6.20) without problems --[[User:Zhenech|Zhenech]] 14:32, 22 February 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
:I have this problem when compiling for x86_64 too. It seems to be limited to 64bit kernels though. I've notified the author of tp_smapi about it, so lets hope a solution is found soon. --[[User:Esmil|Esmil]] 20:08, 6 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
The author was happy about the report, but didn't have time too look at it right now, so I thought I'd give it my best shot. Apparently I should have done that sooner, cause this seems to fix it (for me at least):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff -Naur tp_smapi-0.30/hdaps.c tp_smapi-0.30-64bit_fix/hdaps.c&lt;br /&gt;
--- tp_smapi-0.30/hdaps.c       2006-09-03 12:13:34.000000000 +0200&lt;br /&gt;
+++ tp_smapi-0.30-64bit_fix/hdaps.c     2007-03-07 00:43:26.000000000 +0100&lt;br /&gt;
@@ -34,6 +34,7 @@&lt;br /&gt;
 #include &amp;lt;linux/timer.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/dmi.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/thinkpad_ec.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;linux/jiffies.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* Embedded controller accelerometer read command and its result: */&lt;br /&gt;
 static const struct thinkpad_ec_row ec_accel_args =&lt;br /&gt;
diff -Naur tp_smapi-0.30/thinkpad_ec.c tp_smapi-0.30-64bit_fix/thinkpad_ec.c&lt;br /&gt;
--- tp_smapi-0.30/thinkpad_ec.c 2006-09-02 21:46:18.000000000 +0200&lt;br /&gt;
+++ tp_smapi-0.30-64bit_fix/thinkpad_ec.c       2007-03-07 00:43:13.000000000 +0100&lt;br /&gt;
@@ -34,6 +34,7 @@&lt;br /&gt;
 #include &amp;lt;linux/delay.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/thinkpad_ec.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/jiffies.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;asm/semaphore.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;asm/io.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 #define TP_VERSION &amp;quot;0.30&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the above to {{path|64bit_fix.patch}}, enter the {{path|tp_smapi-0.30}} directory and type&lt;br /&gt;
:{{cmduser|patch -p1 &amp;lt; /path/to/64bit_fix.patch}}&lt;br /&gt;
Now cross your fingers and compile as normal.&lt;br /&gt;
--[[User:Esmil|Esmil]] 01:06, 7 March 2007 (CET)&lt;br /&gt;
: tp_smapi 0.31 fixes this issue --[[User:Esmil|Esmil]] 19:22, 8 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
== X60: tp_smapi 0.31 with kernel 2.6.20 issue ==&lt;br /&gt;
[[category:X60]]&lt;br /&gt;
1st of all: Thanks alot for your work. I do really appreciate this (tp_smapi/thinkwiki).&lt;br /&gt;
&lt;br /&gt;
2nd: On a Debian (testing) w/ vanilla 2.6.20+tp_smapi+hdaps (w/ modules loaded) the kernel panics (init oops) on reboot just before resetting the system. It has a minor impact, you need to press power-off for 5 secs to switch off the machine. Just FYI.&lt;br /&gt;
&lt;br /&gt;
--[[User:Runia|Runia]] 23:48, 16 April 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
== battery start/stop thresholds saved after reboot? ==&lt;br /&gt;
&lt;br /&gt;
Hi&lt;br /&gt;
&lt;br /&gt;
Are the values in stop_charge_thresh and start_charge_thresh just used when Linux is running, or are they saved in the battery? Here after a reboot the values are reset to 96/100. I set these values to 40/85 shut the thinkpad down and charged the battery - sadly it did not use the 85% setting and charged the battery to 100%.&lt;br /&gt;
&lt;br /&gt;
--[[User:Burp|Burp]] 15:31, 13 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The thresholds are saved in the embedded controller, which keeps them as long as there is AC or battery power. If you take away both, the state is reset. If you use suspend-to-disk, tp_smapi will remember the threholds and restore them during resume; but you'll need to write your own init script to set the thresholds during normal reboot after full power loss.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:19, 13 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Under Ubuntu, you can set the thresholds under {{path| /etc/default/tpsmapi-utils}}.&lt;br /&gt;
&lt;br /&gt;
 START_CHARGE_THRESH_BAT0=40&lt;br /&gt;
 #START_CHARGE_THRESH_BAT1=40&lt;br /&gt;
 &lt;br /&gt;
 STOP_CHARGE_THRESH_BAT0=95&lt;br /&gt;
 #STOP_CHARGE_THRESH_BAT1=70&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If I set the value, plug in in the power cord to charge it after I have shut down the thinkpad, it will charge to 100%?&lt;br /&gt;
So I have to plug in the power cord while the thinkpad is running and then shut it down to make it work?&lt;br /&gt;
--[[User:Burp|Burp]] 17:45, 15 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Changes take effect immediately, and last as long as the machine has any power source (battery or AC).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 18:59, 15 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I've experienced the same problem. When I poweroff my X60 after setting the thresh-values and then reboot it, the values are set to 96/100. If I want the thresholds to be regarded I have to plug in the power cord when the thinkpad is running and then shut it down. If I turn it off before connect it to AC, the values are ignored. &lt;br /&gt;
So, are the values only saved in standby-mode? This isn't clear for me, and I think I'm not alone with it ;)&lt;br /&gt;
&lt;br /&gt;
--[[User:Alexb|Alexb]] 20:56, 15 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
The values are not '''saved''' anywhere.  They are set on the EC, and as long as the EC is kept powered on and not rebooted, they are retained.  Sleep cycles and reboots on the main machine do not affect the EC.  An EC firmware upgrade reboots the EC.  Powering off the ThinkPad while it is on battery also powers down the EC.  The ThinkPad does not power down the EC while on AC (it has to be powered up to charge the batteries).&lt;br /&gt;
&lt;br /&gt;
I hope that answered all your doubts...&lt;br /&gt;
&lt;br /&gt;
--[[User:Hmh|hmh]] 04:45, 28 March 2007 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== stop_charge_thres on t42p ==&lt;br /&gt;
&lt;br /&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
'cat /sys/devices/platform/smapi/BAT0/stop_charge_thres' does not work. I get:&lt;br /&gt;
'Function not implemented'. Under windows the ibm tool shows me both thresholds. I am using tp_smapi version 0.31 with kernel 2.6.20 (ubuntu feisty).&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Talk:Tp_smapi&amp;diff=29360</id>
		<title>Talk:Tp smapi</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Talk:Tp_smapi&amp;diff=29360"/>
		<updated>2007-04-16T21:48:02Z</updated>

		<summary type="html">&lt;p&gt;Runia: add: sig&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Feedback ==&lt;br /&gt;
&lt;br /&gt;
Great, great work! Really! This completely rocks. I just stopped my battery from charging at 77% and restarted charging a bit later, no problems whatsoever. BTW, this is on kernel 2.6.14.3.&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 21:25, 5 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
None of the fuctions is working on my T40, kernel 2.6.14-mm2.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lammic|lammic]], 2005.12.05&lt;br /&gt;
&lt;br /&gt;
Works for me on a T41 running 2.6.12-10-686 (Ubuntu 5.10).&lt;br /&gt;
&lt;br /&gt;
--[[User:berndtnm|berndtnm]], 2005.12.06&lt;br /&gt;
&lt;br /&gt;
Including stop_charge_thresh? That one seems to be missing on the T42p.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 00:46, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
tp_smapi works just fine on an R52 with Ubuntu Breezy stock kernel.&lt;br /&gt;
&lt;br /&gt;
--[[User:Micampe|Micampe]] 12:52, 7 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
''To set the thresholds for starting and stopping battery charging (in percent of current capacity):''&lt;br /&gt;
&lt;br /&gt;
'''current''' really? That'd be weird, I'd expect it to be percent of '''total''' capacity.&lt;br /&gt;
&lt;br /&gt;
--[[User:Micampe|Micampe]] 14:39, 7 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Current full charge capacity&amp;quot;, as opposed to &amp;quot;current remaining capacity&amp;quot; or &amp;quot;designed full charge capacity&amp;quot;...&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 15:05, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Battery features don't work with my T41p. I can't check this with windows. Can anybody try these features?&lt;br /&gt;
&lt;br /&gt;
-- Nils, 7 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nils, does cdrom_speed work for you on the T41p? Could you provide the details requested in the README (dmesg etc.)?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:57, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
CDRom Speed seems to work. (I see no warnings, but I have to do a speed test.) Now, I've send all outputs to the email-address in the readme.&lt;br /&gt;
&lt;br /&gt;
-- Nils, 8 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
All the features except the stop_charge_thresh seem to work here on a t42p. &lt;br /&gt;
One note, the start_charge_thresh seems to really be stop_charge_thresh. Ie, If I set that to lower than my current battery %, it will never charge, &lt;br /&gt;
and if I set it to 100 the battery charges all the way. &lt;br /&gt;
&lt;br /&gt;
--[[User:Nirik|Nirik]] 16 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nirik, &amp;quot;all the features&amp;quot; as of which version? For example, do the force_discharge{1,2} in tp_smapi 0.12 also work for you? See the table in the article page. About start_charge, that's odd. Can you send me a log of what you did, what was the result a what was the dmesg output for each operation?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 14:16, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
System T40p:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# echo 1 &amp;gt; /sys/devices/platform/smapi/BAT0/force_discharge1&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# echo 1 &amp;gt; /sys/devices/platform/smapi/BAT0/force_discharge2&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# dmesg   &lt;br /&gt;
tp_smapi: req_in: BX=2118 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=8680 BX=2118 CX=100 DX=b2 DI=0 SI=0 ret=-38&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge1 of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: req_in: BX=2104 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=80 BX=2103 CX=100 DX=78 DI=0 SI=0 ret=0&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 0: bx=2103&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So it seems force_discharge1 is not supported at all. But force_discharge2? By the way, i think wiki is a _very_ good idea for collecting information, but not for discussion. I would prefer a maillinglist. We can use sourceforge.&lt;br /&gt;
&lt;br /&gt;
--[[User|StefanSchmidt]]&lt;br /&gt;
&lt;br /&gt;
force_discharge2 is indicating a real error condition (bx=2103 which has bit 0x02 on), but I have no idea what the error is or how to fix it. Sorry. If you can trigger this function under Windows and have SoftICE or equivalent, maybe it can be worked out.&lt;br /&gt;
&lt;br /&gt;
About the Wiki discussion, I'm not sure a mailing list is justified yet, but you can use the linux-thinkpad list or the e-mail address in the README. &lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:42, 16 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
OK, then i use linux-thinkpad to get more people involved. I'am away the next weeks, but i hope to find some time to hacking on tp_smapi.&lt;br /&gt;
&lt;br /&gt;
--[[User:StefanSchmidt]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Someone reported cd_speed works on T42 but on mine, it doesn't: this is 2378DXU&lt;br /&gt;
&lt;br /&gt;
--[[User:eBug]] 22:55, 17 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
eBug, how does it fail? If the file doesn't exist, it means you didn't enable PROVIDE_CD_SPEED (see the README). If it does exist, can you provide the dmesg output when you read an write to the file?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 11:53, 18 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To confirm:&lt;br /&gt;
tp_smapi 0.13 works with hdaps module loaded on T41 (2373-8RG). However, force_discharge*, inhibit_charge_minutes, start_charge_thresh, stop_charge_thresh don't seem to be implemented on this model.&lt;br /&gt;
&lt;br /&gt;
--[[User:LJSBRokken|LJSBrokken]] 21 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
tp_smapi version 0.13 with T23 (2647-3QG) (I have dual batteries)...&lt;br /&gt;
&lt;br /&gt;
None of the functions which make any changes work...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /sys/devices/platform/smapi &amp;amp;&amp;amp; cat BAT*/* &amp;gt; /dev/null&lt;br /&gt;
cat: BAT0/force_discharge1: Function not implemented&lt;br /&gt;
cat: BAT0/force_discharge2: Input/output error&lt;br /&gt;
cat: BAT0/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT0/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT0/stop_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge1: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge2: Input/output error&lt;br /&gt;
cat: BAT1/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT1/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/stop_charge_thresh: Function not implemented&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, all the battery status information is available, and functions appear for both BAT0 and BAT1, regardless of when the UltraBay battery was inserted or ejected- this is very useful, it is the only way I can monitor my UltraBay battery unless it was present on boot.&lt;br /&gt;
&lt;br /&gt;
--[[User:SystemParadox|SystemParadox]] 21:51, 4 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
SystemParadox, what's the dmesg output produced by &amp;quot;cat BAT0/force_discharge2&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 22:02, 4 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
After the upgrade to 0.14 (with kernel 2.6.15, using the patch) I can't use inhibit_charge and start/stop_charge_thresh any longer (getting an input/output error), the dmesg debug output when {{cmd|cat|}}-ing those three files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: tp_smapi 0.14 loading...&lt;br /&gt;
tp_smapi: successfully loaded (smapi_port=0xb2).&lt;br /&gt;
tp_smapi: req_in: BX=2114 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=ea210080 BX=ec192114 CX=c18d0700 DX=f7cc00b2 DI=f7f50000 SI=c18d0000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Unknown error code&lt;br /&gt;
tp_smapi: req_in: BX=2116 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=c03b0080 BX=c18d2116 CX=c0160328 DX=ec7600b2 DI=ec760000 SI=a0810000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Unknown error code&lt;br /&gt;
tp_smapi: req_in: BX=211a CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=c03b0080 BX=c18d211a CX=c016032c DX=eb4500b2 DI=eb450000 SI=241e0000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Unknown error code&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 08:12, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Oops, the transition to 32-bit SMAPI calls was broken. Fixed in 0.15. Thanks for the quick report!&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:10, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Yep, 0.15 works again. Quick response, bravo! :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 12:23, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
On a T22, nothing seems to work with 0.16.&lt;br /&gt;
&lt;br /&gt;
[[http://www.rafb.net/paste/results/fcUUDs49.html|dmesg output]] when doing cat *&lt;br /&gt;
&lt;br /&gt;
I am using an Ultrabay2000 battery, so it would be really usefull to be able to control that&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Not even the extended battery status? That does work on T23. About the control features, I believe they're not available on the T23; did you have any kind of (dis)charge control under WindowS?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:59, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I don't really know what 'extended battery' status means, but here an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat current_*                                                     /sys/devices/platform/smapi/BAT1&lt;br /&gt;
cat: current_avg: Input/output error&lt;br /&gt;
cat: current_now: Input/output error&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is what happens when i cat any file in this directory and also in ../BAT1 :(&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Thu Jan 12 22:07:26 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Yes, that's what I meant. What's the {{cmdroot|dmesg}} output generated by these commands?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 00:27, 13 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thinker: I attached some link to my first comment but it seems to be down and the link was wrong anyway.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Fri Jan 13 14:35:57 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Thanks; but there's not much we can do. Maybe the T22 uses a different interface, or doesn't have that feature.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 23:23, 15 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thinker: Is there anything I can do to check if the interface is different? Changing 0x1610 to some random number?&lt;br /&gt;
&lt;br /&gt;
Is there a chance to get it by try and error?&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Mon Jan 16 19:10:12 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
0x1610 is the number of an IO port it writes to, so changing it to a random number will pretty much guarantee a system crash...&lt;br /&gt;
&lt;br /&gt;
The only way I can think of for figuring out the T22 interface is to see what the Windows software does.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 19:47, 16 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I have a R40 (2722-B3G), and several things don't work with 0.16 on linux 2.6.15.1:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't know about Windows, haven't booted it for weeks nor used it for years...&lt;br /&gt;
&lt;br /&gt;
--[[User:Wonka|Wonka]] 19:00, 19 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Wonka: do the other features (i.e., extended battery status) work on your R40?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:30, 20 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
--[[User:lisch|lisch]] 16:14, 11 April 2006 (CDT)&lt;br /&gt;
&lt;br /&gt;
On my X32, with two batteries, I get just what I expect. Looks good:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ cat BAT?/* &amp;gt; /dev/null&lt;br /&gt;
cat: BAT0/force_discharge: Function not implemented&lt;br /&gt;
cat: BAT0/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT0/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT0/stop_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge: Function not implemented&lt;br /&gt;
cat: BAT1/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT1/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/stop_charge_thresh: Function not implemented&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Changing the CD speed when the CD is being accessed will hang your computer==&lt;br /&gt;
&lt;br /&gt;
I don't have this problem on my T40p. CDROM is mounted and file on CD is opened. Change speed do '''not''' hang my system.&lt;br /&gt;
&lt;br /&gt;
-- Stefan Schmidt&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
An open file looks fine if you're not reading/writing at that point. But my T43 does hangs on this:&lt;br /&gt;
 # dd if=/dev/scd0 of=/dev/null &amp;amp;&lt;br /&gt;
 # echo 1 &amp;gt; /sys/devices/platform/smapi/cdrom_speed&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:41, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
OK, sorry. I was to fast. My system hangs on this commands, too. :(&lt;br /&gt;
&lt;br /&gt;
-- Stefan Schmidt&lt;br /&gt;
&lt;br /&gt;
Works well. Great.&lt;br /&gt;
&lt;br /&gt;
T42 2373-8zh. Working :cdrom_speed and start_charge_thresh. Untest : inhibit_charge_minutes.&lt;br /&gt;
&lt;br /&gt;
-- Haifeng Chen&lt;br /&gt;
&lt;br /&gt;
cdrom_speed works on my T40.&lt;br /&gt;
&lt;br /&gt;
-- [[User:Lammic|lammic]], 2005.12.09&lt;br /&gt;
&lt;br /&gt;
== Kernel Patch? ==&lt;br /&gt;
&lt;br /&gt;
Hello Thinker,&lt;br /&gt;
&lt;br /&gt;
would it be possible to provide the SMAPI support as kernel patch as well? Something along the lines of: (0.12 against 2.6.15-rc5)&lt;br /&gt;
&lt;br /&gt;
''(deleted, see below for how to create a patch file)''&lt;br /&gt;
&lt;br /&gt;
Deleted the tp_smapi.c file at the end, out of obvious reasons, and I'm not sure about the placement in the ACPI section, OTOH there it would be found easily next to ibm_acpi.&lt;br /&gt;
&lt;br /&gt;
Providing a patch would help when recompiling the kernel often, I hate recompiling external modules every time (even got me a kernel-upgrade script to do most of it automatically). But of course it's up to you. :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 09:52, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I'll be glad to add this, but I don't want to go through additional manual steps in the release process (there are already quite a few). Can you add a &amp;quot;make patch&amp;quot; functionality to the Makefile, or something of the sort, to automatically generate a full patch (including tp_smapi.c) against current kernel sources?&lt;br /&gt;
&lt;br /&gt;
Also, this shouldn't be under drivers/acpi, since it doesn't use ACPI at all (that's why I didn't make it a patch to ibm_acpi). I think the right place is drivers/firmware, like the dell_rbu driver for Dell laptops.&lt;br /&gt;
&lt;br /&gt;
BTW, the convention for kernel patches is to start them once level higher:&lt;br /&gt;
  diff -Nurp kernel-2.6.14-vanilla kernel-2.6.14-patched&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:12, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Of course it's from the wrong level, as usual I was just lazy/inattentive. And at one point I'll remember who likes what patch format, promise. ;)&lt;br /&gt;
&lt;br /&gt;
A patch target as in &amp;quot;create a new file holding a correct diff to current kernel source&amp;quot; would be rather difficult, since line numbers might change etc., but applying the patch should be straighforward with a bit of sed. Of course I could just do that, create a patch with the diff command and then apply the new patch file in reverse. ;)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 18:36, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it does that on a local copy (no changes the original kernel tree) and cleans up after itself, that's fine with me. :-)&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 18:50, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Ok, here's a shell script that creates the patch, feel free to use it under the terms of the GPL. For example call it from your Makefile with the patch target: (I didn't want to put all the script into the Makefile, since the rules about escaping in Makefiles, well, escape me ;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
KDIR=/lib/modules/$(uname -r)/build&lt;br /&gt;
FDIR=drivers/firmware&lt;br /&gt;
OPWD=$(pwd)&lt;br /&gt;
&lt;br /&gt;
TMPDIR=$(mktemp -d)&lt;br /&gt;
cd $TMPDIR&lt;br /&gt;
&lt;br /&gt;
mkdir -p a/$FDIR&lt;br /&gt;
cp $KDIR/$FDIR/{Kconfig,Makefile} a/$FDIR&lt;br /&gt;
cp -r a b&lt;br /&gt;
sed -i -e '/endmenu/i\&lt;br /&gt;
config IBM_SMAPI\&lt;br /&gt;
        tristate &amp;quot;IBM ThinkPad SMAPI Support&amp;quot;\&lt;br /&gt;
        depends on X86\&lt;br /&gt;
        ---help---\&lt;br /&gt;
        This adds SMAPI support on IBM ThinkPads, mostly used for battery\&lt;br /&gt;
        charge control. For more information about this driver see\&lt;br /&gt;
        &amp;lt;http://www.thinkwiki.org/wiki/SMAPI_support_for_Linux&amp;gt; .\&lt;br /&gt;
\&lt;br /&gt;
        If you have an IBM ThinkPad laptop, say Y or M here.\&lt;br /&gt;
' b/$FDIR/Kconfig&lt;br /&gt;
sed -i -e '$a\&lt;br /&gt;
obj-$(CONFIG_IBM_SMAPI)            += tp_smapi.o' b/$FDIR/Makefile&lt;br /&gt;
cp $OPWD/tp_smapi.c b/$FDIR&lt;br /&gt;
diff -Nurp a b &amp;gt; $OPWD/tp_smapi-$(uname -r).patch&lt;br /&gt;
rm -r a b&lt;br /&gt;
cd $OPWD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BTW, [http://qbnz.com/highlighter/ GeSHi]-based syntax-highlighting would be great...&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 19:28, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Ah, neat sed foo. How about [http://tpctl.sourceforge.net/tmp/Makefile this] escapade, then? &lt;br /&gt;
&lt;br /&gt;
What's the sed spell needed to replace the Makefile's&lt;br /&gt;
 VER  := 0.13&lt;br /&gt;
with auto-parsing of&lt;br /&gt;
 #define TP_VERSION &amp;quot;0.13&amp;quot;&lt;br /&gt;
from tp_smapi.c?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:37, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Hmm, something like&lt;br /&gt;
 VERFROMC=$(sed -ne 's/^#define TP_VERSION &amp;quot;\(.*\)&amp;quot;/\1/gp' tp_smapi.c)&lt;br /&gt;
 sed -i -e &amp;quot;s/^VER := .*$/VER := $VERFROMC/&amp;quot; Makefile&lt;br /&gt;
should do (untested, from the top of my head, maybe the temporary variable isn't even necessary?). And neat Makefile wizardry, at one point I'll learn the syntax.&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 20:44, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Makefile escaping is horrible, keep avoiding it... Anyway, the updated [http://tpctl.sourceforge.net/tmp/Makefile make patch] seems to do the right thing.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:36, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Small documentation request: just needed to create a patch for the not-yet-installed 2.6.16-rc2, which is no problem with&lt;br /&gt;
 make KSRC=/path/to/linux-2.6.16-rc2 KVER=2.6.16-rc2 patch&lt;br /&gt;
but I guess it would be a good addition to the README file. :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 10:48, 8 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Right, added (to next release).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 13:40, 8 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Installation questions==&lt;br /&gt;
Amazing! I've loaded this module in my T43 which is running SuSE 10 with the kernel of 2.6.13-15. I have three points to share:&lt;br /&gt;
&lt;br /&gt;
1. The battery control part seems to work but has a minor problem. I set the stop_charge_threshold to 70, but the battery stops charging at 55%. Don't know why and how to fix it. :P&lt;br /&gt;
&lt;br /&gt;
2. I don't have the cd speed control function. Here is what I have under /sys/devices/platform/smapi/:&lt;br /&gt;
&lt;br /&gt;
./  ../  ac_connected  BAT0/  BAT1/  bus@  driver@  power/&lt;br /&gt;
&lt;br /&gt;
3. SuSE 10 doesn't have the necessary C files under .../drivers/hwmon/, I copied them from a 2.6.14.5 kernel source. Maybe it causes the two problems above. :(&lt;br /&gt;
&lt;br /&gt;
When I have time, I'll install the new kernel to see if the problems are gone and report the result.&lt;br /&gt;
&lt;br /&gt;
--[[User:68.51.153.96|68.51.153.96]] 04:31, 2 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
1. It should stop charging at 70, but will only ''start'' charging when remaining capacity has dipped below &amp;lt;tt&amp;gt;start_charge_thresh&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2. See the note about PROVIDE_CD_SPEED.&lt;br /&gt;
&lt;br /&gt;
3. That's should be needed only for patching the HDAPS driver in order to make it compatible with tp_smapi. If your kernel (which version is it?) doens't inlude the HDAPS driver anyway, you don't need to patch....&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 09:28, 2 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks Thinker.&lt;br /&gt;
&lt;br /&gt;
1. I discharged and recharged the battery again. This time, it stops at 68% percent, which is pretty good.&lt;br /&gt;
&lt;br /&gt;
2. I missed the NOTE in README, for I just followed this wiki. :P&lt;br /&gt;
&lt;br /&gt;
3. My kernel version is 2.6.13-15.&lt;br /&gt;
&lt;br /&gt;
By the way, I just got this T43 whose model number is 266896U. I feel that the noise of the fan is much louder than my previous T21. I think it is so since it has a CPU with bigger power but am wondering if other T43 has the same big noise?&lt;br /&gt;
&lt;br /&gt;
--[[User:Tyne|Tyne]] 00:14, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The note about PROVIDE_CD_SPEED is also in the Wiki...&lt;br /&gt;
&lt;br /&gt;
About the T43 fan noise: yes, this is a very common (and annoying) problem. See [[Problem_with_fan_noise]] and our [[ACPI fan control script]], and send Lenovo a complaint in hope they'll fix this at the firmware level.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 08:48, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
I spent hours, trying to compile this on ubuntu edgy without success. It starts with warnings about missing files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@t40:/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31# make install&lt;br /&gt;
make -C /lib/modules/2.6.17-11-386/source M=/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31 O=/lib/modules/2.6.17-11-386/build modules&lt;br /&gt;
make[1]: Betrete Verzeichnis '/usr/src/linux-source-2.6.17'&lt;br /&gt;
/usr/src/linux-source-2.6.17/Makefile:450: .config: No such file or directory&lt;br /&gt;
&lt;br /&gt;
  WARNING: Symbol version dump /lib/modules/2.6.17-11-386/build/Module.symvers&lt;br /&gt;
           is missing; modules will have no dependencies and modversions.&lt;br /&gt;
&lt;br /&gt;
  CC [M]  /home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.o&lt;br /&gt;
cc1: error: include/linux/autoconf.h: No such file or directory&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then many thousand lines later it finally stops:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:357: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c: In function â€˜thinkpad_ec_invalidateâ€™:&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:378: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c: In function â€˜thinkpad_ec_initâ€™:&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:460: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
make[3]: *** [/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.o] Fehler 1&lt;br /&gt;
make[2]: *** [_module_/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31] Fehler 2&lt;br /&gt;
make[1]: *** [modules] Fehler 2&lt;br /&gt;
make[1]: Verlasse Verzeichnis '/usr/src/linux-source-2.6.17'&lt;br /&gt;
make: *** [modules] Fehler 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There must be something fundamentally wrong with the makefile. I have for example never seen that a symlink has to point from /lib/modules/someversion/somewhere to /usr/src/linux. I have installed other modules in the past and they all worked with installed linux-headers package. I didn't ever have to download 40MB kernel source, unpack it, configure it to have a .config and compile the whole kernel just to have 2 or three of the other files needed. This cannot be the correct way to install a driver.&lt;br /&gt;
&lt;br /&gt;
[[User:7bit|7bit]] 07:42, 27 March 2007 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Formatting ==&lt;br /&gt;
&lt;br /&gt;
Wyrfel, that was some heavy editing you did... I agree with most changes (including the saner color choice). I did like those HINT floats, though - they keep the hints from interrupting the flow of text too much, and this particular text needs any help it can get.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:04, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
Hei Thinker,&lt;br /&gt;
&lt;br /&gt;
I'll look into it again. I felt that the floating HINTs were tearing the text apart too much. Maybe we could fix it by placing the clear marks somewhere else.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 18:46, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Dual battery operation with tp_smapi ==&lt;br /&gt;
&lt;br /&gt;
It looks like it is working quite fine with tp_smapi-0.13 and 2.6.15 (it may also work with other versions, but those are the ones I have running right now).&lt;br /&gt;
&lt;br /&gt;
The juicy details:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cd /sys/devices/platform/smapi/}}&lt;br /&gt;
{{cmdroot|cat ac_connected}}&lt;br /&gt;
&lt;br /&gt;
{{cmdresult|0}}&lt;br /&gt;
{{cmdroot|cat BAT{0,1}/state}}&lt;br /&gt;
{{cmdresult|discharging}}&lt;br /&gt;
{{cmdresult|idle}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|echo 1 &amp;gt; BAT1/force_discharge1}}&lt;br /&gt;
{{cmdroot|cat BAT{0,1}/state}}&lt;br /&gt;
{{cmdresult|idle}}&lt;br /&gt;
{{cmdresult|discharging}}&lt;br /&gt;
&lt;br /&gt;
Checking capacity values shows that the corrent battery is being depleted.&lt;br /&gt;
&lt;br /&gt;
And remember, before you yank the CD/DVD drive out, issue:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cat eject &amp;gt; /proc/acpi/ibm/bay}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Great! Which ThinkPad model is it? Could you also {{cmdroot|cat /sys/devices/platform/smapi/BAT{0,1}/force_discharge2}} and report the dmesg output (after {{cmdroot|make load}} or {{cmdroot|1=modprobe tp_smapi debug=1}})?&lt;br /&gt;
&lt;br /&gt;
About the eject command, I think it should be possible to do that automatically when the Ultrabay handle is ejected, via &amp;lt;tt&amp;gt;acpid&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 15:45, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
It's a T43 (2669). cat'ing force_discharge2 gives me an I/O error and I see&lt;br /&gt;
&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 0: bx=2103&lt;br /&gt;
&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 1: bx=2103&lt;br /&gt;
&lt;br /&gt;
I find these errors irrelevant from the user's point of view, though. &lt;br /&gt;
&lt;br /&gt;
Indeed, it should be possible to automatise the &amp;quot;eject&amp;quot; command. I should also be noted that once a force_discharge1 is set, it will NOT unset automatically, event when the AC is plugged back in. An obvious fix is to fiddle with the appropriate ACPI event to force_discharge1 back to 0 for all batteries once the AC is attached.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks, this eliminates the last situation I imagined &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; might work. The next tp_smapi version will remove &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; and rename &amp;lt;tt&amp;gt;force_discharge1&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;force_discharge&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you write those ACPI scripts, it would be great if you put them on the Wiki.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:31, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Well, I still do not preclude the fact that &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; may be useful for something else on other models.&lt;br /&gt;
&lt;br /&gt;
The ACPI scripts (as well as an installation guide) is underway. It may take a while, though.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
See the new article: [[Using an Ultrabay battery]].&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:05, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Hei Thinker,&lt;br /&gt;
&lt;br /&gt;
i just renamed the new page. Will adjust your links later on. Keeping the redirect page until that's done. Please set any new links you create to the new page (the pages of the individual UltraBay batteries should contain a pointer).&lt;br /&gt;
&lt;br /&gt;
On a sidenote: I would like to split the SMAPI support under Linux page into a tp_smapi driver page, just listing the features, and a &amp;quot;How to use tp_smapi&amp;quot; page. I would also split the thinkpad/tpctl page off that again. Any objections?&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 20:42, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
ACK about the page rename (the old one did sound a bit out of line to my ear, but I couldn't spot why...).&lt;br /&gt;
&lt;br /&gt;
About the splitting tp_smapi vs. thinkpad/tpctl, no objection.&lt;br /&gt;
&lt;br /&gt;
About splitting tp_smapi: currently most of that section doubles as both a spec and a HOWTO, which I think is a convenient and concise way to describe things (hey, it must be right, the Perl docs do it!). I'm not sure there's much benefit in duplicating that. Perhaps we should wait for a critical mass of additional lore to accumulate?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:04, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
Ok, i agree on the latter.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 00:57, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Article name capitalization== &lt;br /&gt;
&lt;br /&gt;
Wikimedia autocapitalizes the article name upon submit. How do I concince Wikimedia that I really want a lowercase &amp;quot;t&amp;quot;? The underline is probably too much too ask...&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 11:03, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Impossible, according to [http://en.wikipedia.org/wiki/Wikipedia:Canonicalization Wikipedia:Canonicalization].&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:04, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Status Table==&lt;br /&gt;
For at least the T series i think that charge control was not supported prior to the T42, hardware/BIOS side. Perhaps &amp;quot;N/A&amp;quot; flags would be better here?&lt;br /&gt;
&lt;br /&gt;
I also created &amp;lt;nowiki&amp;gt;{{Isup}}&amp;lt;/nowiki&amp;gt; style templates for status, they just include images, like {{Isup}}.&lt;br /&gt;
Not emotional about it, just wanted to let you know in case you want to use them.&lt;br /&gt;
&lt;br /&gt;
Third and last...would it possibly be better to make the table headers more human readable like i.e. &amp;quot;lower charge threshold&amp;quot; or something like that instead of &amp;quot;start_charge_thresh&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 19:21, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
About &amp;quot;N/A&amp;quot;, sure, if we get reliable data about the hardware capabilities. Alas, most negative reports were just &amp;quot;it doesn't work&amp;quot;, and in some cases gave contradictory information (SMAPI interface says a function is unsupported but user says it works under Windows).&lt;br /&gt;
&lt;br /&gt;
About {{Iyes}} and friends, they're very cute, but I think think they're harder to parse visually and would add some clutter to an already dense table.&lt;br /&gt;
&lt;br /&gt;
The table headers are just the names of the control files - that's important to keep, sine it's the most natural lookup key. Adding friendly description would be great, if we can fit them in (not everyone has an SXGA+ display...). I tried and failed.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:38, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I have a T41p and the windows tools still don't offer me battery management, even though it's quite a while since the T42 came out.&lt;br /&gt;
&lt;br /&gt;
I'm ok with the rest.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 22:35, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the {{X40}}, I can report success using the stop_charge_thresh feature with BIOS v2.03 (1UETC8WW) and Embedded Controller Program v1.60 (1UHTB0WW).&lt;br /&gt;
&lt;br /&gt;
[[User:Peterco|Peterco]] 12:07, 28 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Z60t ==&lt;br /&gt;
&lt;br /&gt;
Tested on Z60t. No errors using cat. Setting thresholds works. Status and capacity queries work. --[[User:Alon|Alon]] 21:44, 4 May 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Problem setting thresholds with X40 ==&lt;br /&gt;
&lt;br /&gt;
My X40, kernel 2.6.16 and tp_smapi 0.20.  I try to set the thresholds to 40% and 90% using:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo 90 &amp;gt; stop_charge_thresh&lt;br /&gt;
# echo 40 &amp;gt; start_charge_thresh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which should work, and the kernel reports from dmesg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: successfully loaded (smapi_port=0xb2).&lt;br /&gt;
tp_smapi: battery 0: changed start threshold to 85(+1)&lt;br /&gt;
tp_smapi: battery 0: changed stop threshold to 90&lt;br /&gt;
tp_smapi: battery 0: changed start threshold to 39(+1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
but, on confirmation here is what happens:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat stop_charge_thresh&lt;br /&gt;
90&lt;br /&gt;
# cat start_charge_thresh&lt;br /&gt;
91&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Any clues as to why start doesn't keep?  Or why its always at 1 above stop_charge_thresh?&lt;br /&gt;
&lt;br /&gt;
--[[User:Xmm0|Xmm0]] 15:01, 17 May 2006 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Is it any different if you first set start_charge_thresh and then stop_charge_thresh? &lt;br /&gt;
&lt;br /&gt;
Can you please load tp_smapi with module option &amp;quot;debug=1&amp;quot; and report the dmesg output genereated by each command?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:31, 17 May 2006 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Battery daemon feedback requested ==&lt;br /&gt;
&lt;br /&gt;
I am writing a battery-management daemon to control charging and discharging BAT0 and BAT1 in accordance with usage patterns that extend Li-Ion and Li-Py battery life.&lt;br /&gt;
&lt;br /&gt;
By default, the machine fully discharges BAT1 first, and it is said that deep-cycling all the time dramatically shortens their lifetime.&lt;br /&gt;
&lt;br /&gt;
My Z61t is the test machine, and it is configured with two batteries, the stock 4-cell, and an &amp;quot;Advanced Ultrabay&amp;quot;, which about doubles the runtime of the machine.&lt;br /&gt;
&lt;br /&gt;
Currently there are two &amp;quot;modes&amp;quot; of the daemon:&lt;br /&gt;
&lt;br /&gt;
Discharging mode.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * look at the &amp;quot;remaining_percent&amp;quot; values for both batteries&lt;br /&gt;
 * if one is more than THRESHOLD percent less than the other one, &lt;br /&gt;
      force discharge from the battery with more capacity left&lt;br /&gt;
 (the current value for THRESHOLD is 10%)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I believe the preceeding will prevent either battery from being deep-cycled disproportionately.&lt;br /&gt;
&lt;br /&gt;
Charging mode.  I am less sure what the &amp;quot;right&amp;quot; algorithm is here.  The following is a proposal.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * look at the &amp;quot;remaining_percent&amp;quot; values for both batteries&lt;br /&gt;
 * if one is more than THRESHOLD percent less than the other one, &lt;br /&gt;
      force charging to the battery with less capacity left&lt;br /&gt;
 * honor pre-set values in stop_charge_thresh and start_charge_thresh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I would like to get feedback in the form of &amp;quot;better&amp;quot; algorithms or requests for this daemon.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 19:03, 12 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
It sounds like your algorithm will indeed minimize wear on both batteries. A side benefit is that charging will toggle between the batteries, which may help keep them cooler while charging and thus prolong their life. OTOH, if you plan to occasionally swap the UltraBay battery for other devices, you may want to fully charge the system battery (up to stop_charge_thresh) first.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 22:57, 12 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have noticed that when force_discharge is set and the batteries switch, the gnome battery monitoring applet gets totally confused about remaining runtime.  Besides being a nuisance, this could presumably cause premature emergency shutduwn.&lt;br /&gt;
&lt;br /&gt;
I have also noticed that the reported remaining runtimes vary greatly between acpi, the applet, and /proc/acpi/battery/*/state&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 21:46, 14 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
What do you mean by &amp;quot;acpi&amp;quot; vs. &amp;quot;/proc/acpi/battery/*/state&amp;quot;? &lt;br /&gt;
&lt;br /&gt;
The most accurate readout is probably {{path|/sys/devices/platform/smapi/BAT0/remaining_running_time}}, but I don't think any applet uses that yet.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:07, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
By acpi, I meant the output of the acpi (1) command.   I'll get some comparative numbers later and post them here.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 20:37, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Odd, my version of {{path|/usr/bin/acpi}} doesn't report remaining time, just percent (which is the same as {{path|/sys/devices/platform/smapi/BAT0/remaining_percent}}).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:32, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
I have been running batteryd for a while with good results.  I will upload it here shortly.&lt;br /&gt;
&lt;br /&gt;
I disabled the preferential charging mode, and only control discharging.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 23:15, 14 November 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
http://demigod.org/~zak/src/batteryd.cc&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 20:18, 5 December 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
== Instructions for X60 with Bios 1.11 under Debian Etch ==&lt;br /&gt;
&lt;br /&gt;
Could someone please provide step-by-step instructions of how to make this work with Debian? What have I to do after  apt-get install kernel-patch-tpsmapi? Thank you!&lt;br /&gt;
&lt;br /&gt;
--[[User:PeterBursch|PeterBursch]] 21:39, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
== tp_smapi 0.30 with kernel 2.6.20? ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;T60:~/tp_smapi-0.30# uname -rm&lt;br /&gt;
2.6.20 x86_64&lt;br /&gt;
&lt;br /&gt;
T60:~/tp_smapi-0.30# make load&lt;br /&gt;
if lsmod | grep -q '^hdaps '; then rmmod hdaps; fi&lt;br /&gt;
if lsmod | grep -q '^tp_smapi '; then rmmod tp_smapi; fi&lt;br /&gt;
if lsmod | grep -q '^thinkpad_ec '; then rmmod thinkpad_ec; fi&lt;br /&gt;
if lsmod | grep -q '^tp_base '; then rmmod tp_base; fi  # old thinkpad_ec&lt;br /&gt;
make -C /lib/modules/2.6.20/source M=/root/tp_smapi-0.30 O=/lib/modules/2.6.20/build modules&lt;br /&gt;
make[1]: Entering directory `/usr/src/linux-2.6.20'&lt;br /&gt;
  CC [M]  /root/tp_smapi-0.30/thinkpad_ec.o&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:83: warning: type defaults to 'int' in declaration of 'DECLARE_MUTEX'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:83: warning: parameter names (without types) in function declaration&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_lock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: warning: implicit declaration of function 'down_interruptible'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: (Each undeclared identifier is reported only once&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: for each function it appears in.)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_try_lock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:109: warning: implicit declaration of function 'down_trylock'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:109: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_unlock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:122: warning: implicit declaration of function 'up'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:122: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
make[3]: *** [/root/tp_smapi-0.30/thinkpad_ec.o] Error 1&lt;br /&gt;
make[2]: *** [_module_/root/tp_smapi-0.30] Error 2&lt;br /&gt;
make[1]: *** [modules] Error 2&lt;br /&gt;
make[1]: Leaving directory `/usr/src/linux-2.6.20'&lt;br /&gt;
make: *** [modules] Error 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Works here with 2.6.21-rc1 (didn't try 2.6.20) without problems --[[User:Zhenech|Zhenech]] 14:32, 22 February 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
:I have this problem when compiling for x86_64 too. It seems to be limited to 64bit kernels though. I've notified the author of tp_smapi about it, so lets hope a solution is found soon. --[[User:Esmil|Esmil]] 20:08, 6 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
The author was happy about the report, but didn't have time too look at it right now, so I thought I'd give it my best shot. Apparently I should have done that sooner, cause this seems to fix it (for me at least):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff -Naur tp_smapi-0.30/hdaps.c tp_smapi-0.30-64bit_fix/hdaps.c&lt;br /&gt;
--- tp_smapi-0.30/hdaps.c       2006-09-03 12:13:34.000000000 +0200&lt;br /&gt;
+++ tp_smapi-0.30-64bit_fix/hdaps.c     2007-03-07 00:43:26.000000000 +0100&lt;br /&gt;
@@ -34,6 +34,7 @@&lt;br /&gt;
 #include &amp;lt;linux/timer.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/dmi.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/thinkpad_ec.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;linux/jiffies.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* Embedded controller accelerometer read command and its result: */&lt;br /&gt;
 static const struct thinkpad_ec_row ec_accel_args =&lt;br /&gt;
diff -Naur tp_smapi-0.30/thinkpad_ec.c tp_smapi-0.30-64bit_fix/thinkpad_ec.c&lt;br /&gt;
--- tp_smapi-0.30/thinkpad_ec.c 2006-09-02 21:46:18.000000000 +0200&lt;br /&gt;
+++ tp_smapi-0.30-64bit_fix/thinkpad_ec.c       2007-03-07 00:43:13.000000000 +0100&lt;br /&gt;
@@ -34,6 +34,7 @@&lt;br /&gt;
 #include &amp;lt;linux/delay.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/thinkpad_ec.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/jiffies.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;asm/semaphore.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;asm/io.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 #define TP_VERSION &amp;quot;0.30&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the above to {{path|64bit_fix.patch}}, enter the {{path|tp_smapi-0.30}} directory and type&lt;br /&gt;
:{{cmduser|patch -p1 &amp;lt; /path/to/64bit_fix.patch}}&lt;br /&gt;
Now cross your fingers and compile as normal.&lt;br /&gt;
--[[User:Esmil|Esmil]] 01:06, 7 March 2007 (CET)&lt;br /&gt;
: tp_smapi 0.31 fixes this issue --[[User:Esmil|Esmil]] 19:22, 8 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
== X60: tp_smapi 0.31 with kernel 2.6.20 issue ==&lt;br /&gt;
1st of all: Thanks alot for your work. I do really appreciate this (tp_smapi/thinkwiki).&lt;br /&gt;
&lt;br /&gt;
2nd: On a Debian (testing) w/ vanilla 2.6.20+tp_smapi+hdaps (w/ modules loaded) the kernel panics (init oops) on reboot just before resetting the system. It has a minor impact, you need to press power-off for 5 secs to switch off the machine. Just FYI.&lt;br /&gt;
&lt;br /&gt;
--[[User:Runia|Runia]] 23:48, 16 April 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
== battery start/stop thresholds saved after reboot? ==&lt;br /&gt;
&lt;br /&gt;
Hi&lt;br /&gt;
&lt;br /&gt;
Are the values in stop_charge_thresh and start_charge_thresh just used when Linux is running, or are they saved in the battery? Here after a reboot the values are reset to 96/100. I set these values to 40/85 shut the thinkpad down and charged the battery - sadly it did not use the 85% setting and charged the battery to 100%.&lt;br /&gt;
&lt;br /&gt;
--[[User:Burp|Burp]] 15:31, 13 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The thresholds are saved in the embedded controller, which keeps them as long as there is AC or battery power. If you take away both, the state is reset. If you use suspend-to-disk, tp_smapi will remember the threholds and restore them during resume; but you'll need to write your own init script to set the thresholds during normal reboot after full power loss.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:19, 13 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Under Ubuntu, you can set the thresholds under {{path| /etc/default/tpsmapi-utils}}.&lt;br /&gt;
&lt;br /&gt;
 START_CHARGE_THRESH_BAT0=40&lt;br /&gt;
 #START_CHARGE_THRESH_BAT1=40&lt;br /&gt;
 &lt;br /&gt;
 STOP_CHARGE_THRESH_BAT0=95&lt;br /&gt;
 #STOP_CHARGE_THRESH_BAT1=70&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If I set the value, plug in in the power cord to charge it after I have shut down the thinkpad, it will charge to 100%?&lt;br /&gt;
So I have to plug in the power cord while the thinkpad is running and then shut it down to make it work?&lt;br /&gt;
--[[User:Burp|Burp]] 17:45, 15 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Changes take effect immediately, and last as long as the machine has any power source (battery or AC).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 18:59, 15 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I've experienced the same problem. When I poweroff my X60 after setting the thresh-values and then reboot it, the values are set to 96/100. If I want the thresholds to be regarded I have to plug in the power cord when the thinkpad is running and then shut it down. If I turn it off before connect it to AC, the values are ignored. &lt;br /&gt;
So, are the values only saved in standby-mode? This isn't clear for me, and I think I'm not alone with it ;)&lt;br /&gt;
&lt;br /&gt;
--[[User:Alexb|Alexb]] 20:56, 15 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
The values are not '''saved''' anywhere.  They are set on the EC, and as long as the EC is kept powered on and not rebooted, they are retained.  Sleep cycles and reboots on the main machine do not affect the EC.  An EC firmware upgrade reboots the EC.  Powering off the ThinkPad while it is on battery also powers down the EC.  The ThinkPad does not power down the EC while on AC (it has to be powered up to charge the batteries).&lt;br /&gt;
&lt;br /&gt;
I hope that answered all your doubts...&lt;br /&gt;
&lt;br /&gt;
--[[User:Hmh|hmh]] 04:45, 28 March 2007 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== stop_charge_thres on t42p ==&lt;br /&gt;
&lt;br /&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
'cat /sys/devices/platform/smapi/BAT0/stop_charge_thres' does not work. I get:&lt;br /&gt;
'Function not implemented'. Under windows the ibm tool shows me both thresholds. I am using tp_smapi version 0.31 with kernel 2.6.20 (ubuntu feisty).&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Talk:Tp_smapi&amp;diff=29359</id>
		<title>Talk:Tp smapi</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Talk:Tp_smapi&amp;diff=29359"/>
		<updated>2007-04-16T21:47:21Z</updated>

		<summary type="html">&lt;p&gt;Runia: add: X60 tp_smapi 2.6.20 issue&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Feedback ==&lt;br /&gt;
&lt;br /&gt;
Great, great work! Really! This completely rocks. I just stopped my battery from charging at 77% and restarted charging a bit later, no problems whatsoever. BTW, this is on kernel 2.6.14.3.&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 21:25, 5 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
None of the fuctions is working on my T40, kernel 2.6.14-mm2.&lt;br /&gt;
&lt;br /&gt;
--[[User:Lammic|lammic]], 2005.12.05&lt;br /&gt;
&lt;br /&gt;
Works for me on a T41 running 2.6.12-10-686 (Ubuntu 5.10).&lt;br /&gt;
&lt;br /&gt;
--[[User:berndtnm|berndtnm]], 2005.12.06&lt;br /&gt;
&lt;br /&gt;
Including stop_charge_thresh? That one seems to be missing on the T42p.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 00:46, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
tp_smapi works just fine on an R52 with Ubuntu Breezy stock kernel.&lt;br /&gt;
&lt;br /&gt;
--[[User:Micampe|Micampe]] 12:52, 7 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
''To set the thresholds for starting and stopping battery charging (in percent of current capacity):''&lt;br /&gt;
&lt;br /&gt;
'''current''' really? That'd be weird, I'd expect it to be percent of '''total''' capacity.&lt;br /&gt;
&lt;br /&gt;
--[[User:Micampe|Micampe]] 14:39, 7 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Current full charge capacity&amp;quot;, as opposed to &amp;quot;current remaining capacity&amp;quot; or &amp;quot;designed full charge capacity&amp;quot;...&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 15:05, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Battery features don't work with my T41p. I can't check this with windows. Can anybody try these features?&lt;br /&gt;
&lt;br /&gt;
-- Nils, 7 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nils, does cdrom_speed work for you on the T41p? Could you provide the details requested in the README (dmesg etc.)?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:57, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
CDRom Speed seems to work. (I see no warnings, but I have to do a speed test.) Now, I've send all outputs to the email-address in the readme.&lt;br /&gt;
&lt;br /&gt;
-- Nils, 8 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
All the features except the stop_charge_thresh seem to work here on a t42p. &lt;br /&gt;
One note, the start_charge_thresh seems to really be stop_charge_thresh. Ie, If I set that to lower than my current battery %, it will never charge, &lt;br /&gt;
and if I set it to 100 the battery charges all the way. &lt;br /&gt;
&lt;br /&gt;
--[[User:Nirik|Nirik]] 16 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nirik, &amp;quot;all the features&amp;quot; as of which version? For example, do the force_discharge{1,2} in tp_smapi 0.12 also work for you? See the table in the article page. About start_charge, that's odd. Can you send me a log of what you did, what was the result a what was the dmesg output for each operation?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 14:16, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
System T40p:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# echo 1 &amp;gt; /sys/devices/platform/smapi/BAT0/force_discharge1&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# echo 1 &amp;gt; /sys/devices/platform/smapi/BAT0/force_discharge2&lt;br /&gt;
fairlight:/sys/devices/platform/smapi/BAT0# dmesg   &lt;br /&gt;
tp_smapi: req_in: BX=2118 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=8680 BX=2118 CX=100 DX=b2 DI=0 SI=0 ret=-38&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge1 of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: req_in: BX=2104 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=80 BX=2103 CX=100 DX=78 DI=0 SI=0 ret=0&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 0: bx=2103&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So it seems force_discharge1 is not supported at all. But force_discharge2? By the way, i think wiki is a _very_ good idea for collecting information, but not for discussion. I would prefer a maillinglist. We can use sourceforge.&lt;br /&gt;
&lt;br /&gt;
--[[User|StefanSchmidt]]&lt;br /&gt;
&lt;br /&gt;
force_discharge2 is indicating a real error condition (bx=2103 which has bit 0x02 on), but I have no idea what the error is or how to fix it. Sorry. If you can trigger this function under Windows and have SoftICE or equivalent, maybe it can be worked out.&lt;br /&gt;
&lt;br /&gt;
About the Wiki discussion, I'm not sure a mailing list is justified yet, but you can use the linux-thinkpad list or the e-mail address in the README. &lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:42, 16 Dec 2005 (CET)&lt;br /&gt;
&lt;br /&gt;
OK, then i use linux-thinkpad to get more people involved. I'am away the next weeks, but i hope to find some time to hacking on tp_smapi.&lt;br /&gt;
&lt;br /&gt;
--[[User:StefanSchmidt]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Someone reported cd_speed works on T42 but on mine, it doesn't: this is 2378DXU&lt;br /&gt;
&lt;br /&gt;
--[[User:eBug]] 22:55, 17 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
eBug, how does it fail? If the file doesn't exist, it means you didn't enable PROVIDE_CD_SPEED (see the README). If it does exist, can you provide the dmesg output when you read an write to the file?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 11:53, 18 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
To confirm:&lt;br /&gt;
tp_smapi 0.13 works with hdaps module loaded on T41 (2373-8RG). However, force_discharge*, inhibit_charge_minutes, start_charge_thresh, stop_charge_thresh don't seem to be implemented on this model.&lt;br /&gt;
&lt;br /&gt;
--[[User:LJSBRokken|LJSBrokken]] 21 Dec 2005&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
tp_smapi version 0.13 with T23 (2647-3QG) (I have dual batteries)...&lt;br /&gt;
&lt;br /&gt;
None of the functions which make any changes work...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /sys/devices/platform/smapi &amp;amp;&amp;amp; cat BAT*/* &amp;gt; /dev/null&lt;br /&gt;
cat: BAT0/force_discharge1: Function not implemented&lt;br /&gt;
cat: BAT0/force_discharge2: Input/output error&lt;br /&gt;
cat: BAT0/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT0/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT0/stop_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge1: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge2: Input/output error&lt;br /&gt;
cat: BAT1/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT1/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/stop_charge_thresh: Function not implemented&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, all the battery status information is available, and functions appear for both BAT0 and BAT1, regardless of when the UltraBay battery was inserted or ejected- this is very useful, it is the only way I can monitor my UltraBay battery unless it was present on boot.&lt;br /&gt;
&lt;br /&gt;
--[[User:SystemParadox|SystemParadox]] 21:51, 4 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
SystemParadox, what's the dmesg output produced by &amp;quot;cat BAT0/force_discharge2&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 22:02, 4 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
After the upgrade to 0.14 (with kernel 2.6.15, using the patch) I can't use inhibit_charge and start/stop_charge_thresh any longer (getting an input/output error), the dmesg debug output when {{cmd|cat|}}-ing those three files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: tp_smapi 0.14 loading...&lt;br /&gt;
tp_smapi: successfully loaded (smapi_port=0xb2).&lt;br /&gt;
tp_smapi: req_in: BX=2114 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=ea210080 BX=ec192114 CX=c18d0700 DX=f7cc00b2 DI=f7f50000 SI=c18d0000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Unknown error code&lt;br /&gt;
tp_smapi: req_in: BX=2116 CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=c03b0080 BX=c18d2116 CX=c0160328 DX=ec7600b2 DI=ec760000 SI=a0810000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Unknown error code&lt;br /&gt;
tp_smapi: req_in: BX=211a CX=100 DI=0 SI=0&lt;br /&gt;
tp_smapi: req_out: AX=c03b0080 BX=c18d211a CX=c016032c DX=eb4500b2 DI=eb450000 SI=241e0000 ret=-5&lt;br /&gt;
tp_smapi: SMAPI error: Unknown error code (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Unknown error code&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 08:12, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Oops, the transition to 32-bit SMAPI calls was broken. Fixed in 0.15. Thanks for the quick report!&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:10, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Yep, 0.15 works again. Quick response, bravo! :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 12:23, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
On a T22, nothing seems to work with 0.16.&lt;br /&gt;
&lt;br /&gt;
[[http://www.rafb.net/paste/results/fcUUDs49.html|dmesg output]] when doing cat *&lt;br /&gt;
&lt;br /&gt;
I am using an Ultrabay2000 battery, so it would be really usefull to be able to control that&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Not even the extended battery status? That does work on T23. About the control features, I believe they're not available on the T23; did you have any kind of (dis)charge control under WindowS?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:59, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I don't really know what 'extended battery' status means, but here an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cat current_*                                                     /sys/devices/platform/smapi/BAT1&lt;br /&gt;
cat: current_avg: Input/output error&lt;br /&gt;
cat: current_now: Input/output error&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is what happens when i cat any file in this directory and also in ../BAT1 :(&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Thu Jan 12 22:07:26 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Yes, that's what I meant. What's the {{cmdroot|dmesg}} output generated by these commands?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 00:27, 13 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thinker: I attached some link to my first comment but it seems to be down and the link was wrong anyway.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
thinkpad controller read(%hx,%hx): failed writing to 0x1610&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Fri Jan 13 14:35:57 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Nusse: Thanks; but there's not much we can do. Maybe the T22 uses a different interface, or doesn't have that feature.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 23:23, 15 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thinker: Is there anything I can do to check if the interface is different? Changing 0x1610 to some random number?&lt;br /&gt;
&lt;br /&gt;
Is there a chance to get it by try and error?&lt;br /&gt;
&lt;br /&gt;
--[[User:nusse|nusse]] Mon Jan 16 19:10:12 CET 2006&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
0x1610 is the number of an IO port it writes to, so changing it to a random number will pretty much guarantee a system crash...&lt;br /&gt;
&lt;br /&gt;
The only way I can think of for figuring out the T22 interface is to see what the Windows software does.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 19:47, 16 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I have a R40 (2722-B3G), and several things don't work with 0.16 on linux 2.6.15.1:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2118)&lt;br /&gt;
tp_smapi: cannot get force_discharge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2114)&lt;br /&gt;
tp_smapi: cannot get inhibit charge of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=2116)&lt;br /&gt;
tp_smapi: cannot get start thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
tp_smapi: SMAPI error: Function is not supported by SMAPI BIOS (func=211a)&lt;br /&gt;
tp_smapi: cannot get stop thresh of battery 0: Function is not supported by SMAPI BIOS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don't know about Windows, haven't booted it for weeks nor used it for years...&lt;br /&gt;
&lt;br /&gt;
--[[User:Wonka|Wonka]] 19:00, 19 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Wonka: do the other features (i.e., extended battery status) work on your R40?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:30, 20 January 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
--[[User:lisch|lisch]] 16:14, 11 April 2006 (CDT)&lt;br /&gt;
&lt;br /&gt;
On my X32, with two batteries, I get just what I expect. Looks good:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ cat BAT?/* &amp;gt; /dev/null&lt;br /&gt;
cat: BAT0/force_discharge: Function not implemented&lt;br /&gt;
cat: BAT0/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT0/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT0/stop_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/force_discharge: Function not implemented&lt;br /&gt;
cat: BAT1/inhibit_charge_minutes: Function not implemented&lt;br /&gt;
cat: BAT1/start_charge_thresh: Function not implemented&lt;br /&gt;
cat: BAT1/stop_charge_thresh: Function not implemented&lt;br /&gt;
$&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Changing the CD speed when the CD is being accessed will hang your computer==&lt;br /&gt;
&lt;br /&gt;
I don't have this problem on my T40p. CDROM is mounted and file on CD is opened. Change speed do '''not''' hang my system.&lt;br /&gt;
&lt;br /&gt;
-- Stefan Schmidt&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
An open file looks fine if you're not reading/writing at that point. But my T43 does hangs on this:&lt;br /&gt;
 # dd if=/dev/scd0 of=/dev/null &amp;amp;&lt;br /&gt;
 # echo 1 &amp;gt; /sys/devices/platform/smapi/cdrom_speed&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:41, 7 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
OK, sorry. I was to fast. My system hangs on this commands, too. :(&lt;br /&gt;
&lt;br /&gt;
-- Stefan Schmidt&lt;br /&gt;
&lt;br /&gt;
Works well. Great.&lt;br /&gt;
&lt;br /&gt;
T42 2373-8zh. Working :cdrom_speed and start_charge_thresh. Untest : inhibit_charge_minutes.&lt;br /&gt;
&lt;br /&gt;
-- Haifeng Chen&lt;br /&gt;
&lt;br /&gt;
cdrom_speed works on my T40.&lt;br /&gt;
&lt;br /&gt;
-- [[User:Lammic|lammic]], 2005.12.09&lt;br /&gt;
&lt;br /&gt;
== Kernel Patch? ==&lt;br /&gt;
&lt;br /&gt;
Hello Thinker,&lt;br /&gt;
&lt;br /&gt;
would it be possible to provide the SMAPI support as kernel patch as well? Something along the lines of: (0.12 against 2.6.15-rc5)&lt;br /&gt;
&lt;br /&gt;
''(deleted, see below for how to create a patch file)''&lt;br /&gt;
&lt;br /&gt;
Deleted the tp_smapi.c file at the end, out of obvious reasons, and I'm not sure about the placement in the ACPI section, OTOH there it would be found easily next to ibm_acpi.&lt;br /&gt;
&lt;br /&gt;
Providing a patch would help when recompiling the kernel often, I hate recompiling external modules every time (even got me a kernel-upgrade script to do most of it automatically). But of course it's up to you. :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 09:52, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I'll be glad to add this, but I don't want to go through additional manual steps in the release process (there are already quite a few). Can you add a &amp;quot;make patch&amp;quot; functionality to the Makefile, or something of the sort, to automatically generate a full patch (including tp_smapi.c) against current kernel sources?&lt;br /&gt;
&lt;br /&gt;
Also, this shouldn't be under drivers/acpi, since it doesn't use ACPI at all (that's why I didn't make it a patch to ibm_acpi). I think the right place is drivers/firmware, like the dell_rbu driver for Dell laptops.&lt;br /&gt;
&lt;br /&gt;
BTW, the convention for kernel patches is to start them once level higher:&lt;br /&gt;
  diff -Nurp kernel-2.6.14-vanilla kernel-2.6.14-patched&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:12, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Of course it's from the wrong level, as usual I was just lazy/inattentive. And at one point I'll remember who likes what patch format, promise. ;)&lt;br /&gt;
&lt;br /&gt;
A patch target as in &amp;quot;create a new file holding a correct diff to current kernel source&amp;quot; would be rather difficult, since line numbers might change etc., but applying the patch should be straighforward with a bit of sed. Of course I could just do that, create a patch with the diff command and then apply the new patch file in reverse. ;)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 18:36, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If it does that on a local copy (no changes the original kernel tree) and cleans up after itself, that's fine with me. :-)&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 18:50, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Ok, here's a shell script that creates the patch, feel free to use it under the terms of the GPL. For example call it from your Makefile with the patch target: (I didn't want to put all the script into the Makefile, since the rules about escaping in Makefiles, well, escape me ;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
KDIR=/lib/modules/$(uname -r)/build&lt;br /&gt;
FDIR=drivers/firmware&lt;br /&gt;
OPWD=$(pwd)&lt;br /&gt;
&lt;br /&gt;
TMPDIR=$(mktemp -d)&lt;br /&gt;
cd $TMPDIR&lt;br /&gt;
&lt;br /&gt;
mkdir -p a/$FDIR&lt;br /&gt;
cp $KDIR/$FDIR/{Kconfig,Makefile} a/$FDIR&lt;br /&gt;
cp -r a b&lt;br /&gt;
sed -i -e '/endmenu/i\&lt;br /&gt;
config IBM_SMAPI\&lt;br /&gt;
        tristate &amp;quot;IBM ThinkPad SMAPI Support&amp;quot;\&lt;br /&gt;
        depends on X86\&lt;br /&gt;
        ---help---\&lt;br /&gt;
        This adds SMAPI support on IBM ThinkPads, mostly used for battery\&lt;br /&gt;
        charge control. For more information about this driver see\&lt;br /&gt;
        &amp;lt;http://www.thinkwiki.org/wiki/SMAPI_support_for_Linux&amp;gt; .\&lt;br /&gt;
\&lt;br /&gt;
        If you have an IBM ThinkPad laptop, say Y or M here.\&lt;br /&gt;
' b/$FDIR/Kconfig&lt;br /&gt;
sed -i -e '$a\&lt;br /&gt;
obj-$(CONFIG_IBM_SMAPI)            += tp_smapi.o' b/$FDIR/Makefile&lt;br /&gt;
cp $OPWD/tp_smapi.c b/$FDIR&lt;br /&gt;
diff -Nurp a b &amp;gt; $OPWD/tp_smapi-$(uname -r).patch&lt;br /&gt;
rm -r a b&lt;br /&gt;
cd $OPWD&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BTW, [http://qbnz.com/highlighter/ GeSHi]-based syntax-highlighting would be great...&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 19:28, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Ah, neat sed foo. How about [http://tpctl.sourceforge.net/tmp/Makefile this] escapade, then? &lt;br /&gt;
&lt;br /&gt;
What's the sed spell needed to replace the Makefile's&lt;br /&gt;
 VER  := 0.13&lt;br /&gt;
with auto-parsing of&lt;br /&gt;
 #define TP_VERSION &amp;quot;0.13&amp;quot;&lt;br /&gt;
from tp_smapi.c?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:37, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Hmm, something like&lt;br /&gt;
 VERFROMC=$(sed -ne 's/^#define TP_VERSION &amp;quot;\(.*\)&amp;quot;/\1/gp' tp_smapi.c)&lt;br /&gt;
 sed -i -e &amp;quot;s/^VER := .*$/VER := $VERFROMC/&amp;quot; Makefile&lt;br /&gt;
should do (untested, from the top of my head, maybe the temporary variable isn't even necessary?). And neat Makefile wizardry, at one point I'll learn the syntax.&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 20:44, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Makefile escaping is horrible, keep avoiding it... Anyway, the updated [http://tpctl.sourceforge.net/tmp/Makefile make patch] seems to do the right thing.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:36, 16 Dec 2005 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Small documentation request: just needed to create a patch for the not-yet-installed 2.6.16-rc2, which is no problem with&lt;br /&gt;
 make KSRC=/path/to/linux-2.6.16-rc2 KVER=2.6.16-rc2 patch&lt;br /&gt;
but I guess it would be a good addition to the README file. :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Spiney|spiney]] 10:48, 8 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Right, added (to next release).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 13:40, 8 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Installation questions==&lt;br /&gt;
Amazing! I've loaded this module in my T43 which is running SuSE 10 with the kernel of 2.6.13-15. I have three points to share:&lt;br /&gt;
&lt;br /&gt;
1. The battery control part seems to work but has a minor problem. I set the stop_charge_threshold to 70, but the battery stops charging at 55%. Don't know why and how to fix it. :P&lt;br /&gt;
&lt;br /&gt;
2. I don't have the cd speed control function. Here is what I have under /sys/devices/platform/smapi/:&lt;br /&gt;
&lt;br /&gt;
./  ../  ac_connected  BAT0/  BAT1/  bus@  driver@  power/&lt;br /&gt;
&lt;br /&gt;
3. SuSE 10 doesn't have the necessary C files under .../drivers/hwmon/, I copied them from a 2.6.14.5 kernel source. Maybe it causes the two problems above. :(&lt;br /&gt;
&lt;br /&gt;
When I have time, I'll install the new kernel to see if the problems are gone and report the result.&lt;br /&gt;
&lt;br /&gt;
--[[User:68.51.153.96|68.51.153.96]] 04:31, 2 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
1. It should stop charging at 70, but will only ''start'' charging when remaining capacity has dipped below &amp;lt;tt&amp;gt;start_charge_thresh&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
2. See the note about PROVIDE_CD_SPEED.&lt;br /&gt;
&lt;br /&gt;
3. That's should be needed only for patching the HDAPS driver in order to make it compatible with tp_smapi. If your kernel (which version is it?) doens't inlude the HDAPS driver anyway, you don't need to patch....&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 09:28, 2 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks Thinker.&lt;br /&gt;
&lt;br /&gt;
1. I discharged and recharged the battery again. This time, it stops at 68% percent, which is pretty good.&lt;br /&gt;
&lt;br /&gt;
2. I missed the NOTE in README, for I just followed this wiki. :P&lt;br /&gt;
&lt;br /&gt;
3. My kernel version is 2.6.13-15.&lt;br /&gt;
&lt;br /&gt;
By the way, I just got this T43 whose model number is 266896U. I feel that the noise of the fan is much louder than my previous T21. I think it is so since it has a CPU with bigger power but am wondering if other T43 has the same big noise?&lt;br /&gt;
&lt;br /&gt;
--[[User:Tyne|Tyne]] 00:14, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The note about PROVIDE_CD_SPEED is also in the Wiki...&lt;br /&gt;
&lt;br /&gt;
About the T43 fan noise: yes, this is a very common (and annoying) problem. See [[Problem_with_fan_noise]] and our [[ACPI fan control script]], and send Lenovo a complaint in hope they'll fix this at the firmware level.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 08:48, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
I spent hours, trying to compile this on ubuntu edgy without success. It starts with warnings about missing files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@t40:/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31# make install&lt;br /&gt;
make -C /lib/modules/2.6.17-11-386/source M=/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31 O=/lib/modules/2.6.17-11-386/build modules&lt;br /&gt;
make[1]: Betrete Verzeichnis '/usr/src/linux-source-2.6.17'&lt;br /&gt;
/usr/src/linux-source-2.6.17/Makefile:450: .config: No such file or directory&lt;br /&gt;
&lt;br /&gt;
  WARNING: Symbol version dump /lib/modules/2.6.17-11-386/build/Module.symvers&lt;br /&gt;
           is missing; modules will have no dependencies and modversions.&lt;br /&gt;
&lt;br /&gt;
  CC [M]  /home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.o&lt;br /&gt;
cc1: error: include/linux/autoconf.h: No such file or directory&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and then many thousand lines later it finally stops:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[...]&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:357: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c: In function â€˜thinkpad_ec_invalidateâ€™:&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:378: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c: In function â€˜thinkpad_ec_initâ€™:&lt;br /&gt;
/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.c:460: error: â€˜CONFIG_HZâ€™ undeclared (first use in this function)&lt;br /&gt;
make[3]: *** [/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31/thinkpad_ec.o] Fehler 1&lt;br /&gt;
make[2]: *** [_module_/home/bernd/Desktop/tp_smapi-0.31/tp_smapi-0.31] Fehler 2&lt;br /&gt;
make[1]: *** [modules] Fehler 2&lt;br /&gt;
make[1]: Verlasse Verzeichnis '/usr/src/linux-source-2.6.17'&lt;br /&gt;
make: *** [modules] Fehler 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There must be something fundamentally wrong with the makefile. I have for example never seen that a symlink has to point from /lib/modules/someversion/somewhere to /usr/src/linux. I have installed other modules in the past and they all worked with installed linux-headers package. I didn't ever have to download 40MB kernel source, unpack it, configure it to have a .config and compile the whole kernel just to have 2 or three of the other files needed. This cannot be the correct way to install a driver.&lt;br /&gt;
&lt;br /&gt;
[[User:7bit|7bit]] 07:42, 27 March 2007 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Formatting ==&lt;br /&gt;
&lt;br /&gt;
Wyrfel, that was some heavy editing you did... I agree with most changes (including the saner color choice). I did like those HINT floats, though - they keep the hints from interrupting the flow of text too much, and this particular text needs any help it can get.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:04, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
Hei Thinker,&lt;br /&gt;
&lt;br /&gt;
I'll look into it again. I felt that the floating HINTs were tearing the text apart too much. Maybe we could fix it by placing the clear marks somewhere else.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 18:46, 3 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Dual battery operation with tp_smapi ==&lt;br /&gt;
&lt;br /&gt;
It looks like it is working quite fine with tp_smapi-0.13 and 2.6.15 (it may also work with other versions, but those are the ones I have running right now).&lt;br /&gt;
&lt;br /&gt;
The juicy details:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cd /sys/devices/platform/smapi/}}&lt;br /&gt;
{{cmdroot|cat ac_connected}}&lt;br /&gt;
&lt;br /&gt;
{{cmdresult|0}}&lt;br /&gt;
{{cmdroot|cat BAT{0,1}/state}}&lt;br /&gt;
{{cmdresult|discharging}}&lt;br /&gt;
{{cmdresult|idle}}&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|echo 1 &amp;gt; BAT1/force_discharge1}}&lt;br /&gt;
{{cmdroot|cat BAT{0,1}/state}}&lt;br /&gt;
{{cmdresult|idle}}&lt;br /&gt;
{{cmdresult|discharging}}&lt;br /&gt;
&lt;br /&gt;
Checking capacity values shows that the corrent battery is being depleted.&lt;br /&gt;
&lt;br /&gt;
And remember, before you yank the CD/DVD drive out, issue:&lt;br /&gt;
&lt;br /&gt;
{{cmdroot|cat eject &amp;gt; /proc/acpi/ibm/bay}}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Great! Which ThinkPad model is it? Could you also {{cmdroot|cat /sys/devices/platform/smapi/BAT{0,1}/force_discharge2}} and report the dmesg output (after {{cmdroot|make load}} or {{cmdroot|1=modprobe tp_smapi debug=1}})?&lt;br /&gt;
&lt;br /&gt;
About the eject command, I think it should be possible to do that automatically when the Ultrabay handle is ejected, via &amp;lt;tt&amp;gt;acpid&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 15:45, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
It's a T43 (2669). cat'ing force_discharge2 gives me an I/O error and I see&lt;br /&gt;
&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 0: bx=2103&lt;br /&gt;
&lt;br /&gt;
tp_smapi: cannot get force_discharge2 of battery 1: bx=2103&lt;br /&gt;
&lt;br /&gt;
I find these errors irrelevant from the user's point of view, though. &lt;br /&gt;
&lt;br /&gt;
Indeed, it should be possible to automatise the &amp;quot;eject&amp;quot; command. I should also be noted that once a force_discharge1 is set, it will NOT unset automatically, event when the AC is plugged back in. An obvious fix is to fiddle with the appropriate ACPI event to force_discharge1 back to 0 for all batteries once the AC is attached.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Thanks, this eliminates the last situation I imagined &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; might work. The next tp_smapi version will remove &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; and rename &amp;lt;tt&amp;gt;force_discharge1&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;force_discharge&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you write those ACPI scripts, it would be great if you put them on the Wiki.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:31, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Well, I still do not preclude the fact that &amp;lt;tt&amp;gt;force_discharge2&amp;lt;/tt&amp;gt; may be useful for something else on other models.&lt;br /&gt;
&lt;br /&gt;
The ACPI scripts (as well as an installation guide) is underway. It may take a while, though.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
See the new article: [[Using an Ultrabay battery]].&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 17:05, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Hei Thinker,&lt;br /&gt;
&lt;br /&gt;
i just renamed the new page. Will adjust your links later on. Keeping the redirect page until that's done. Please set any new links you create to the new page (the pages of the individual UltraBay batteries should contain a pointer).&lt;br /&gt;
&lt;br /&gt;
On a sidenote: I would like to split the SMAPI support under Linux page into a tp_smapi driver page, just listing the features, and a &amp;quot;How to use tp_smapi&amp;quot; page. I would also split the thinkpad/tpctl page off that again. Any objections?&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 20:42, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
ACK about the page rename (the old one did sound a bit out of line to my ear, but I couldn't spot why...).&lt;br /&gt;
&lt;br /&gt;
About the splitting tp_smapi vs. thinkpad/tpctl, no objection.&lt;br /&gt;
&lt;br /&gt;
About splitting tp_smapi: currently most of that section doubles as both a spec and a HOWTO, which I think is a convenient and concise way to describe things (hey, it must be right, the Perl docs do it!). I'm not sure there's much benefit in duplicating that. Perhaps we should wait for a critical mass of additional lore to accumulate?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:04, 10 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
Ok, i agree on the latter.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 00:57, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Article name capitalization== &lt;br /&gt;
&lt;br /&gt;
Wikimedia autocapitalizes the article name upon submit. How do I concince Wikimedia that I really want a lowercase &amp;quot;t&amp;quot;? The underline is probably too much too ask...&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 11:03, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Impossible, according to [http://en.wikipedia.org/wiki/Wikipedia:Canonicalization Wikipedia:Canonicalization].&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:04, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Status Table==&lt;br /&gt;
For at least the T series i think that charge control was not supported prior to the T42, hardware/BIOS side. Perhaps &amp;quot;N/A&amp;quot; flags would be better here?&lt;br /&gt;
&lt;br /&gt;
I also created &amp;lt;nowiki&amp;gt;{{Isup}}&amp;lt;/nowiki&amp;gt; style templates for status, they just include images, like {{Isup}}.&lt;br /&gt;
Not emotional about it, just wanted to let you know in case you want to use them.&lt;br /&gt;
&lt;br /&gt;
Third and last...would it possibly be better to make the table headers more human readable like i.e. &amp;quot;lower charge threshold&amp;quot; or something like that instead of &amp;quot;start_charge_thresh&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 19:21, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
About &amp;quot;N/A&amp;quot;, sure, if we get reliable data about the hardware capabilities. Alas, most negative reports were just &amp;quot;it doesn't work&amp;quot;, and in some cases gave contradictory information (SMAPI interface says a function is unsupported but user says it works under Windows).&lt;br /&gt;
&lt;br /&gt;
About {{Iyes}} and friends, they're very cute, but I think think they're harder to parse visually and would add some clutter to an already dense table.&lt;br /&gt;
&lt;br /&gt;
The table headers are just the names of the control files - that's important to keep, sine it's the most natural lookup key. Adding friendly description would be great, if we can fit them in (not everyone has an SXGA+ display...). I tried and failed.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 20:38, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I have a T41p and the windows tools still don't offer me battery management, even though it's quite a while since the T42 came out.&lt;br /&gt;
&lt;br /&gt;
I'm ok with the rest.&lt;br /&gt;
&lt;br /&gt;
[[User:Wyrfel|Wyrfel]] 22:35, 11 Jan 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
For the {{X40}}, I can report success using the stop_charge_thresh feature with BIOS v2.03 (1UETC8WW) and Embedded Controller Program v1.60 (1UHTB0WW).&lt;br /&gt;
&lt;br /&gt;
[[User:Peterco|Peterco]] 12:07, 28 February 2006 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Z60t ==&lt;br /&gt;
&lt;br /&gt;
Tested on Z60t. No errors using cat. Setting thresholds works. Status and capacity queries work. --[[User:Alon|Alon]] 21:44, 4 May 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
== Problem setting thresholds with X40 ==&lt;br /&gt;
&lt;br /&gt;
My X40, kernel 2.6.16 and tp_smapi 0.20.  I try to set the thresholds to 40% and 90% using:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# echo 90 &amp;gt; stop_charge_thresh&lt;br /&gt;
# echo 40 &amp;gt; start_charge_thresh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which should work, and the kernel reports from dmesg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tp_smapi: successfully loaded (smapi_port=0xb2).&lt;br /&gt;
tp_smapi: battery 0: changed start threshold to 85(+1)&lt;br /&gt;
tp_smapi: battery 0: changed stop threshold to 90&lt;br /&gt;
tp_smapi: battery 0: changed start threshold to 39(+1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
but, on confirmation here is what happens:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat stop_charge_thresh&lt;br /&gt;
90&lt;br /&gt;
# cat start_charge_thresh&lt;br /&gt;
91&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Any clues as to why start doesn't keep?  Or why its always at 1 above stop_charge_thresh?&lt;br /&gt;
&lt;br /&gt;
--[[User:Xmm0|Xmm0]] 15:01, 17 May 2006 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Is it any different if you first set start_charge_thresh and then stop_charge_thresh? &lt;br /&gt;
&lt;br /&gt;
Can you please load tp_smapi with module option &amp;quot;debug=1&amp;quot; and report the dmesg output genereated by each command?&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:31, 17 May 2006 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Battery daemon feedback requested ==&lt;br /&gt;
&lt;br /&gt;
I am writing a battery-management daemon to control charging and discharging BAT0 and BAT1 in accordance with usage patterns that extend Li-Ion and Li-Py battery life.&lt;br /&gt;
&lt;br /&gt;
By default, the machine fully discharges BAT1 first, and it is said that deep-cycling all the time dramatically shortens their lifetime.&lt;br /&gt;
&lt;br /&gt;
My Z61t is the test machine, and it is configured with two batteries, the stock 4-cell, and an &amp;quot;Advanced Ultrabay&amp;quot;, which about doubles the runtime of the machine.&lt;br /&gt;
&lt;br /&gt;
Currently there are two &amp;quot;modes&amp;quot; of the daemon:&lt;br /&gt;
&lt;br /&gt;
Discharging mode.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * look at the &amp;quot;remaining_percent&amp;quot; values for both batteries&lt;br /&gt;
 * if one is more than THRESHOLD percent less than the other one, &lt;br /&gt;
      force discharge from the battery with more capacity left&lt;br /&gt;
 (the current value for THRESHOLD is 10%)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
I believe the preceeding will prevent either battery from being deep-cycled disproportionately.&lt;br /&gt;
&lt;br /&gt;
Charging mode.  I am less sure what the &amp;quot;right&amp;quot; algorithm is here.  The following is a proposal.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * look at the &amp;quot;remaining_percent&amp;quot; values for both batteries&lt;br /&gt;
 * if one is more than THRESHOLD percent less than the other one, &lt;br /&gt;
      force charging to the battery with less capacity left&lt;br /&gt;
 * honor pre-set values in stop_charge_thresh and start_charge_thresh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I would like to get feedback in the form of &amp;quot;better&amp;quot; algorithms or requests for this daemon.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 19:03, 12 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
It sounds like your algorithm will indeed minimize wear on both batteries. A side benefit is that charging will toggle between the batteries, which may help keep them cooler while charging and thus prolong their life. OTOH, if you plan to occasionally swap the UltraBay battery for other devices, you may want to fully charge the system battery (up to stop_charge_thresh) first.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 22:57, 12 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have noticed that when force_discharge is set and the batteries switch, the gnome battery monitoring applet gets totally confused about remaining runtime.  Besides being a nuisance, this could presumably cause premature emergency shutduwn.&lt;br /&gt;
&lt;br /&gt;
I have also noticed that the reported remaining runtimes vary greatly between acpi, the applet, and /proc/acpi/battery/*/state&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 21:46, 14 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
What do you mean by &amp;quot;acpi&amp;quot; vs. &amp;quot;/proc/acpi/battery/*/state&amp;quot;? &lt;br /&gt;
&lt;br /&gt;
The most accurate readout is probably {{path|/sys/devices/platform/smapi/BAT0/remaining_running_time}}, but I don't think any applet uses that yet.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 12:07, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
By acpi, I meant the output of the acpi (1) command.   I'll get some comparative numbers later and post them here.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 20:37, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Odd, my version of {{path|/usr/bin/acpi}} doesn't report remaining time, just percent (which is the same as {{path|/sys/devices/platform/smapi/BAT0/remaining_percent}}).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 21:32, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
I have been running batteryd for a while with good results.  I will upload it here shortly.&lt;br /&gt;
&lt;br /&gt;
I disabled the preferential charging mode, and only control discharging.&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 23:15, 14 November 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
http://demigod.org/~zak/src/batteryd.cc&lt;br /&gt;
&lt;br /&gt;
--[[User:Zak Smith|Zak]] 20:18, 5 December 2006 (CET)&lt;br /&gt;
&lt;br /&gt;
== Instructions for X60 with Bios 1.11 under Debian Etch ==&lt;br /&gt;
&lt;br /&gt;
Could someone please provide step-by-step instructions of how to make this work with Debian? What have I to do after  apt-get install kernel-patch-tpsmapi? Thank you!&lt;br /&gt;
&lt;br /&gt;
--[[User:PeterBursch|PeterBursch]] 21:39, 15 September 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
== tp_smapi 0.30 with kernel 2.6.20? ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;T60:~/tp_smapi-0.30# uname -rm&lt;br /&gt;
2.6.20 x86_64&lt;br /&gt;
&lt;br /&gt;
T60:~/tp_smapi-0.30# make load&lt;br /&gt;
if lsmod | grep -q '^hdaps '; then rmmod hdaps; fi&lt;br /&gt;
if lsmod | grep -q '^tp_smapi '; then rmmod tp_smapi; fi&lt;br /&gt;
if lsmod | grep -q '^thinkpad_ec '; then rmmod thinkpad_ec; fi&lt;br /&gt;
if lsmod | grep -q '^tp_base '; then rmmod tp_base; fi  # old thinkpad_ec&lt;br /&gt;
make -C /lib/modules/2.6.20/source M=/root/tp_smapi-0.30 O=/lib/modules/2.6.20/build modules&lt;br /&gt;
make[1]: Entering directory `/usr/src/linux-2.6.20'&lt;br /&gt;
  CC [M]  /root/tp_smapi-0.30/thinkpad_ec.o&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:83: warning: type defaults to 'int' in declaration of 'DECLARE_MUTEX'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:83: warning: parameter names (without types) in function declaration&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_lock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: warning: implicit declaration of function 'down_interruptible'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: (Each undeclared identifier is reported only once&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:94: error: for each function it appears in.)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_try_lock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:109: warning: implicit declaration of function 'down_trylock'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:109: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c: In function 'thinkpad_ec_unlock':&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:122: warning: implicit declaration of function 'up'&lt;br /&gt;
/root/tp_smapi-0.30/thinkpad_ec.c:122: error: 'thinkpad_ec_mutex' undeclared (first use in this function)&lt;br /&gt;
make[3]: *** [/root/tp_smapi-0.30/thinkpad_ec.o] Error 1&lt;br /&gt;
make[2]: *** [_module_/root/tp_smapi-0.30] Error 2&lt;br /&gt;
make[1]: *** [modules] Error 2&lt;br /&gt;
make[1]: Leaving directory `/usr/src/linux-2.6.20'&lt;br /&gt;
make: *** [modules] Error 2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Works here with 2.6.21-rc1 (didn't try 2.6.20) without problems --[[User:Zhenech|Zhenech]] 14:32, 22 February 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
:I have this problem when compiling for x86_64 too. It seems to be limited to 64bit kernels though. I've notified the author of tp_smapi about it, so lets hope a solution is found soon. --[[User:Esmil|Esmil]] 20:08, 6 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
The author was happy about the report, but didn't have time too look at it right now, so I thought I'd give it my best shot. Apparently I should have done that sooner, cause this seems to fix it (for me at least):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
diff -Naur tp_smapi-0.30/hdaps.c tp_smapi-0.30-64bit_fix/hdaps.c&lt;br /&gt;
--- tp_smapi-0.30/hdaps.c       2006-09-03 12:13:34.000000000 +0200&lt;br /&gt;
+++ tp_smapi-0.30-64bit_fix/hdaps.c     2007-03-07 00:43:26.000000000 +0100&lt;br /&gt;
@@ -34,6 +34,7 @@&lt;br /&gt;
 #include &amp;lt;linux/timer.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/dmi.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/thinkpad_ec.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;linux/jiffies.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /* Embedded controller accelerometer read command and its result: */&lt;br /&gt;
 static const struct thinkpad_ec_row ec_accel_args =&lt;br /&gt;
diff -Naur tp_smapi-0.30/thinkpad_ec.c tp_smapi-0.30-64bit_fix/thinkpad_ec.c&lt;br /&gt;
--- tp_smapi-0.30/thinkpad_ec.c 2006-09-02 21:46:18.000000000 +0200&lt;br /&gt;
+++ tp_smapi-0.30-64bit_fix/thinkpad_ec.c       2007-03-07 00:43:13.000000000 +0100&lt;br /&gt;
@@ -34,6 +34,7 @@&lt;br /&gt;
 #include &amp;lt;linux/delay.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/thinkpad_ec.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;linux/jiffies.h&amp;gt;&lt;br /&gt;
+#include &amp;lt;asm/semaphore.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;asm/io.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 #define TP_VERSION &amp;quot;0.30&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Copy the above to {{path|64bit_fix.patch}}, enter the {{path|tp_smapi-0.30}} directory and type&lt;br /&gt;
:{{cmduser|patch -p1 &amp;lt; /path/to/64bit_fix.patch}}&lt;br /&gt;
Now cross your fingers and compile as normal.&lt;br /&gt;
--[[User:Esmil|Esmil]] 01:06, 7 March 2007 (CET)&lt;br /&gt;
: tp_smapi 0.31 fixes this issue --[[User:Esmil|Esmil]] 19:22, 8 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
== X60: tp_smapi 0.31 with kernel 2.6.20 issue ==&lt;br /&gt;
1st of all: Thanks alot for your work. I do really appreciate this (tp_smapi/thinkwiki).&lt;br /&gt;
&lt;br /&gt;
2nd: On a Debian (testing) w/ vanilla 2.6.20+tp_smapi+hdaps (w/ modules loaded) the kernel panics (init oops) on reboot just before resetting the system. It has a minor impact, you need to press power-off for 5 secs to switch off the machine. Just FYI.&lt;br /&gt;
&lt;br /&gt;
== battery start/stop thresholds saved after reboot? ==&lt;br /&gt;
&lt;br /&gt;
Hi&lt;br /&gt;
&lt;br /&gt;
Are the values in stop_charge_thresh and start_charge_thresh just used when Linux is running, or are they saved in the battery? Here after a reboot the values are reset to 96/100. I set these values to 40/85 shut the thinkpad down and charged the battery - sadly it did not use the 85% setting and charged the battery to 100%.&lt;br /&gt;
&lt;br /&gt;
--[[User:Burp|Burp]] 15:31, 13 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
The thresholds are saved in the embedded controller, which keeps them as long as there is AC or battery power. If you take away both, the state is reset. If you use suspend-to-disk, tp_smapi will remember the threholds and restore them during resume; but you'll need to write your own init script to set the thresholds during normal reboot after full power loss.&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 16:19, 13 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Under Ubuntu, you can set the thresholds under {{path| /etc/default/tpsmapi-utils}}.&lt;br /&gt;
&lt;br /&gt;
 START_CHARGE_THRESH_BAT0=40&lt;br /&gt;
 #START_CHARGE_THRESH_BAT1=40&lt;br /&gt;
 &lt;br /&gt;
 STOP_CHARGE_THRESH_BAT0=95&lt;br /&gt;
 #STOP_CHARGE_THRESH_BAT1=70&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
If I set the value, plug in in the power cord to charge it after I have shut down the thinkpad, it will charge to 100%?&lt;br /&gt;
So I have to plug in the power cord while the thinkpad is running and then shut it down to make it work?&lt;br /&gt;
--[[User:Burp|Burp]] 17:45, 15 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Changes take effect immediately, and last as long as the machine has any power source (battery or AC).&lt;br /&gt;
&lt;br /&gt;
--[[User:Thinker|Thinker]] 18:59, 15 March 2007 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
I've experienced the same problem. When I poweroff my X60 after setting the thresh-values and then reboot it, the values are set to 96/100. If I want the thresholds to be regarded I have to plug in the power cord when the thinkpad is running and then shut it down. If I turn it off before connect it to AC, the values are ignored. &lt;br /&gt;
So, are the values only saved in standby-mode? This isn't clear for me, and I think I'm not alone with it ;)&lt;br /&gt;
&lt;br /&gt;
--[[User:Alexb|Alexb]] 20:56, 15 March 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
The values are not '''saved''' anywhere.  They are set on the EC, and as long as the EC is kept powered on and not rebooted, they are retained.  Sleep cycles and reboots on the main machine do not affect the EC.  An EC firmware upgrade reboots the EC.  Powering off the ThinkPad while it is on battery also powers down the EC.  The ThinkPad does not power down the EC while on AC (it has to be powered up to charge the batteries).&lt;br /&gt;
&lt;br /&gt;
I hope that answered all your doubts...&lt;br /&gt;
&lt;br /&gt;
--[[User:Hmh|hmh]] 04:45, 28 March 2007 (CEST)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== stop_charge_thres on t42p ==&lt;br /&gt;
&lt;br /&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
'cat /sys/devices/platform/smapi/BAT0/stop_charge_thres' does not work. I get:&lt;br /&gt;
'Function not implemented'. Under windows the ibm tool shows me both thresholds. I am using tp_smapi version 0.31 with kernel 2.6.20 (ubuntu feisty).&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Tp_smapi&amp;diff=29358</id>
		<title>Tp smapi</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Tp_smapi&amp;diff=29358"/>
		<updated>2007-04-16T21:39:08Z</updated>

		<summary type="html">&lt;p&gt;Runia: add: c.f. to discussion (x60, 2.6.20)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top;padding-right:20px;width:10px;white-space:nowrap;&amp;quot; | __TOC__&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot; |&lt;br /&gt;
The &amp;lt;tt&amp;gt;tp_smapi&amp;lt;/tt&amp;gt; kernel module exposes some features of the ThinkPad hardware/firmware via a &amp;lt;tt&amp;gt;sysfs&amp;lt;/tt&amp;gt; interface. Currently, the main implemented functionality is control of battery charging and extended battery status. The underlying hardware interfaces are [[SMAPI support for Linux|SMAPI]] and direct access to the embedded controller.&lt;br /&gt;
&lt;br /&gt;
For older ThinkPad models, see also [[tpctl]].&lt;br /&gt;
&lt;br /&gt;
{{WARN|This driver uses undocumented features and direct hardware access. It thus cannot be guaranteed to work and could conceivably damage your computer (though so far no incidents have been reported).}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
*Battery charge/discharge control&lt;br /&gt;
*Battery status information&lt;br /&gt;
*PCI bus power saving control&lt;br /&gt;
&lt;br /&gt;
===Project Homepage / Availability===&lt;br /&gt;
* Project page: http://tpctl.sourceforge.net/&lt;br /&gt;
* You need to [http://sourceforge.net/project/showfiles.php?group_id=1212&amp;amp;package_id=171579 download] only the &amp;lt;tt&amp;gt;tp_smapi&amp;lt;/tt&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
====Installation from source====&lt;br /&gt;
You will need the kernel headers and makefiles corresponding to your current kernel version. On {{Fedora}}, this means {{cmdroot|yum install kernel-devel-$(uname -r)}} .&lt;br /&gt;
&lt;br /&gt;
For testing, you can simply compile and load the driver within the current&lt;br /&gt;
working directory:&lt;br /&gt;
:{{cmdroot|tar xzvf tp_smapi-0.31.tgz}}&lt;br /&gt;
:{{cmdroot|cd tp_smapi-0.31}}&lt;br /&gt;
:{{cmdroot|make load}}&lt;br /&gt;
&lt;br /&gt;
To compile and install into the kernel's module path:&lt;br /&gt;
:{{cmdroot|make install}}&lt;br /&gt;
&lt;br /&gt;
If you use the [[HDAPS]] driver, add &amp;lt;tt&amp;gt;HDAPS=1&amp;lt;/tt&amp;gt; to also patch the &amp;lt;tt&amp;gt;hdaps&amp;lt;/tt&amp;gt; for compatibility with &amp;lt;tt&amp;gt;tp_smapi&amp;lt;/tt&amp;gt; (this requires a kernel source tree matching the current kernel):&lt;br /&gt;
:{{cmdroot|1=make load HDAPS=1}}&lt;br /&gt;
or, to compile and install into the kernel's module path:&lt;br /&gt;
:{{cmdroot|1=make install HDAPS=1}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To prepare a stand-alone patch against the current kernel tree (including&lt;br /&gt;
a patch against &amp;lt;tt&amp;gt;hdaps&amp;lt;/tt&amp;gt; and new &amp;lt;tt&amp;gt;Kconfig&amp;lt;/tt&amp;gt; entries):&lt;br /&gt;
:{{cmdroot|make patch}}&lt;br /&gt;
&lt;br /&gt;
To delete all autogenerated files:&lt;br /&gt;
:{{cmdroot|make clean}}&lt;br /&gt;
&lt;br /&gt;
The original kernel tree is never modified by any these commands. &lt;br /&gt;
The {{path|/lib/modules}} directory is modified only by {{cmdroot|make install}}.&lt;br /&gt;
&lt;br /&gt;
''Comment: I had to install the complete kernel source tree to make it work (Edgy, T43)''&lt;br /&gt;
&lt;br /&gt;
====Installation in Gentoo====&lt;br /&gt;
The {{Gentoo}} portage system carries a [http://packages.gentoo.org/packages/?category=app-laptop;name=tp_smapi tp_smapi package], which follows the latest version pretty closely. On a Gentoo system, you can install and load as follows.&lt;br /&gt;
&lt;br /&gt;
If you use the [[HDAPS]] driver, do this first:&lt;br /&gt;
&lt;br /&gt;
* Configure &amp;lt;tt&amp;gt;hdaps&amp;lt;/tt&amp;gt; as module in your kernel&lt;br /&gt;
* Add the &amp;lt;tt&amp;gt;HDAPS&amp;lt;/tt&amp;gt; use flag in {{path|/etc/make.conf}}&lt;br /&gt;
* {{cmdroot|rmmod hdaps}}&lt;br /&gt;
&lt;br /&gt;
Then:&lt;br /&gt;
&lt;br /&gt;
* {{cmdroot|emerge tp_smapi}} (or install tp_smapi with hdaps support manually, as above)&lt;br /&gt;
* {{cmdroot|echo &amp;quot;tp_smapi&amp;quot; &amp;gt;&amp;gt; /etc/modules.autoload.d/kernel-2.6}}&lt;br /&gt;
* {{cmdroot|echo &amp;quot;hdaps&amp;quot; &amp;gt;&amp;gt; /etc/modules.autoload.d/kernel-2.6}}&lt;br /&gt;
&lt;br /&gt;
Then reboot, or run:&lt;br /&gt;
* {{cmdroot|modprobe tp_smapi}}&lt;br /&gt;
* {{cmdroot|modprobe hdaps}}&lt;br /&gt;
&lt;br /&gt;
====Installation on Ubuntu/Debian====&lt;br /&gt;
&lt;br /&gt;
Installation on Ubuntu or Debian is quite easy, but there are a few things to look after:&lt;br /&gt;
&lt;br /&gt;
To get your system ready for compiling code, install the build-essentials (as root, of course, as all of the following comands; Ubuntu users have to prepend 'sudo' to every line and enter their own password when prompted):&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;apt-get install build-essentials&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get tp_smapi to work, obtain the latest source as mentioned above and unpack it. If you want to use HDAPS, you need to install the kernel source matching te kernel you are running. To do so, issue this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;uname -r&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will give you the version of your current kernel. As Ubuntu adds '-generic' to the kernel-version, the following command works for Debian users only:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;apt-get install linux-source-`uname -r`&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Ubuntu users use the kernel-version they got by the command before, e.g. 'linux-source-2.6.20'&lt;br /&gt;
&lt;br /&gt;
Now change to the tp_smapi dir:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;cd tp_smapi-X.YY&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt; (X.YY being the version-number of [[tp_smapi]])&lt;br /&gt;
and make and install tp_smapi as instructed above.&lt;br /&gt;
&lt;br /&gt;
If you get an error that the kernel version isn't matching, please check that there is a symlink from the modules dir to the kernel source:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;root@localhost:~#ls -l /lib/modules/2.6.20-6-generic&lt;br /&gt;
lrwxrwxrwx  1 root root     28 2007-02-02 08:39 source -&amp;gt; /usr/src/linux-source-2.6.20&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
Create the link if the line above is not existent:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;root@localhost:~#ln -s /usr/src/linux-source-2.6.20 /lib/modules/2.6.20-6-generic/source&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the following will build and install the correct modules to their locations:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;make install HDAPS=1&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
To make sure your system loads the modules at boot time, do this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;echo &amp;quot;tp_smapi&amp;quot; &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
echo &amp;quot;hdaps&amp;quot; &amp;gt;&amp;gt; /etc/modules&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
and update your initramfs:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;update-initramfs -u&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get tp_smapi running now, just load the modules:&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;modprobe tp_smapi hdaps&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This description was tested on Kubuntu 'Feisty Fawn' and should work on all Debian-based distros with minor tweaks.&lt;br /&gt;
&lt;br /&gt;
===Battery charge control features===&lt;br /&gt;
To set the thresholds for starting and stopping battery charging (in percent of current full charge capacity):&lt;br /&gt;
:{{cmdroot|echo 40 &amp;gt; /sys/devices/platform/smapi/BAT0/start_charge_thresh}}&lt;br /&gt;
:{{cmdroot|echo 70 &amp;gt; /sys/devices/platform/smapi/BAT0/stop_charge_thresh}}&lt;br /&gt;
:{{cmdroot|cat /sys/devices/platform/smapi/BAT0/*_charge_thresh}}&lt;br /&gt;
{{HINT|Battery charging thresholds can be used to keep Li-Ion ad Li-Polymer batteries partially charged, in order to [[Maintenance#Battery_treatment|increase their lifetime]].}}&lt;br /&gt;
To unconditionally inhibit charging for 17 minutes:&lt;br /&gt;
:{{cmdroot|echo 17 &amp;gt; /sys/devices/platform/smapi/BAT0/inhibit_charge_minutes}}&lt;br /&gt;
{{HINT|Charge inhibiting can be used to reduce the power draw of the laptop, in order to use an under-spec power supply that can't handle the combined power draw of running and charging. It can also be used to control which battery is charged when [[How to use UltraBay batteries|using an Ultrabay battery]].}}&lt;br /&gt;
&lt;br /&gt;
To cancel charge inhibiting:&lt;br /&gt;
:{{cmdroot|echo 0 &amp;gt; /sys/devices/platform/smapi/BAT0/inhibit_charge_minutes}}&lt;br /&gt;
&lt;br /&gt;
To force battery discharging even if connected to AC, use one of these:&lt;br /&gt;
:{{cmdroot|echo 1 &amp;gt; /sys/devices/platform/smapi/BAT0/force_discharge}}&lt;br /&gt;
{{HINT|This can be used to choose which battery is discharged when [[How to use UltraBay batteries|using an UltraBay battery]].}}&lt;br /&gt;
&lt;br /&gt;
To cancel forced discharge:&lt;br /&gt;
:{{cmdroot|echo 0 &amp;gt; /sys/devices/platform/smapi/BAT0/force_discharge}}&lt;br /&gt;
&lt;br /&gt;
===Battery status features===&lt;br /&gt;
To view extended battery status such as charging state, voltage, current, capacity, cycle count and model information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/installed&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/state       # idle/charging/discharging&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/cycle_count&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/current_now # instantaneous current&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/current_avg # last minute average&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/power_now   # instantaneous power&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/power_avg   # last minute average&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/last_full_capacity&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/remaining_percent&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/remaining_running_time&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/remaining_charging_time&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/remaining_capacity&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/design_capacity&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/voltage&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/design_voltage&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/manufacturer&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/model&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/barcoding&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/chemistry&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/serial&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/manufacture_date&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/first_use_date&lt;br /&gt;
# cat /sys/devices/platform/smapi/BAT0/temperature # in milli-Celsius&lt;br /&gt;
# cat /sys/devices/platform/smapi/ac_connected&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The raw status data is also available, including some fields not listed above (in case you can figure them out):&lt;br /&gt;
&lt;br /&gt;
:{{cmdroot|cat /sys/devices/platform/smapi/BAT0/dump}}&lt;br /&gt;
&lt;br /&gt;
In all of the above, replace &amp;lt;tt&amp;gt;BAT0&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;BAT1&amp;lt;/tt&amp;gt; to address the 2nd battery.&lt;br /&gt;
&lt;br /&gt;
Note that the battery status readout conflicts with the stock [[HDAPS|hdaps]] driver, so if you use &amp;lt;tt&amp;gt;hdaps&amp;lt;/tt&amp;gt; you will need to load &amp;lt;tt&amp;gt;tp_smapi&amp;lt;/tt&amp;gt; using {{cmdroot|1=make load HDAPS=1}} (see [[#Conflict_with_hdaps|Conflict with hdaps]] below).&lt;br /&gt;
&lt;br /&gt;
On [[ACPI]]-enabled systems, most of above information is also available through the files under {{path|/proc/acpi/battery}}. However, the ACPI interface does not include the instantaneous power and cycle count readouts, and does not work well when [[How to use UltraBay batteries|hotswapping UltraBay batteries]].&lt;br /&gt;
&lt;br /&gt;
===Other features===&lt;br /&gt;
&lt;br /&gt;
This controls the &amp;quot;PCI bus power saving&amp;quot; option in the BIOS, and takes effect at the next boot. On a ThinkPad {{T43}} turning this off increases idle power consumption by about 350mW. Out-of-the-box default is 1.&lt;br /&gt;
 # cat /sys/devices/platform/smapi/enable_pci_power_saving_on_boot&lt;br /&gt;
 # echo 1 &amp;gt; /sys/devices/platform/smapi/enable_pci_power_saving_on_boot # on&lt;br /&gt;
 # echo 0 &amp;gt; /sys/devices/platform/smapi/enable_pci_power_saving_on_boot # off&lt;br /&gt;
&lt;br /&gt;
There is also [[sysfs]] attribute for making direct SMAPI requests to the SM BIOS firmware. Don't touch it unless you really know what you're doing. Example:&lt;br /&gt;
 # echo '211a 100 0 0 &amp;gt; /sys/devices/platform/smapi/smapi_request; cat /sys/devices/platform/smapi/smapi_request&lt;br /&gt;
 211a 34b b2 0 0 0 'OK'&lt;br /&gt;
The 4b&amp;quot; in the 2nd value, converted to decimal is 75: the current charge stop threshold.&lt;br /&gt;
&lt;br /&gt;
===Conflict with &amp;lt;tt&amp;gt;hdaps&amp;lt;/tt&amp;gt;===&lt;br /&gt;
The extended battery status function conflicts with the [[HDAPS|hdaps]] kernel module (they use the same IO ports). The &amp;lt;tt&amp;gt;tp_smapi&amp;lt;/tt&amp;gt; package includes a patch against &amp;lt;tt&amp;gt;hdaps&amp;lt;/tt&amp;gt; to make it compatible with &amp;lt;tt&amp;gt;tp_smapi&amp;lt;/tt&amp;gt;, and also to fix many problems in the original driver.&lt;br /&gt;
&lt;br /&gt;
To build the patched version, simply append the &amp;lt;tt&amp;gt;HDAPS=1&amp;lt;/tt&amp;gt; parameter to the &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; command, for example: {{cmdroot|1=make load HDAPS=1}} (see [[#Installation|Installation]] above).&lt;br /&gt;
&lt;br /&gt;
If you don't do that, you will not be able tp load &amp;lt;tt&amp;gt;tp_smapi&amp;lt;/tt&amp;gt; (and its support module &amp;lt;tt&amp;gt;tp_base&amp;lt;/tt&amp;gt;) when &amp;lt;tt&amp;gt;hdaps&amp;lt;/tt&amp;gt; is loaded, and vice versa. You can use &amp;lt;tt&amp;gt;rmmod&amp;lt;/tt&amp;gt; to switch between these modules.&lt;br /&gt;
&lt;br /&gt;
Note that some of the battery status is also visible through ACPI ({{path|/proc/acpi/battery/*}}), independently of &amp;lt;tt&amp;gt;tp_smapi&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
&lt;br /&gt;
If you get &amp;lt;tt&amp;gt;thinkpad_ec: no ThinkPad embedded controller!&amp;lt;/tt&amp;gt; when trying to load the module on a supported model listed below, you should [[BIOS_Upgrade|upgrade your BIOS]]. Some early BIOS (like 1.x on the X31) don't handle the embedded controller.&lt;br /&gt;
&lt;br /&gt;
===Model-specific status===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 92%&amp;quot;&amp;gt;&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
|+&amp;lt;tt&amp;gt;tp_smapi&amp;lt;/tt&amp;gt; feature support matrix&lt;br /&gt;
|-&lt;br /&gt;
! &amp;amp;times; &lt;br /&gt;
! &amp;lt;tt&amp;gt;start_charge_&amp;lt;br /&amp;gt;thresh&amp;lt;/tt&amp;gt; &lt;br /&gt;
!           &amp;lt;tt&amp;gt;stop_charge_&amp;lt;br /&amp;gt;thresh&amp;lt;/tt&amp;gt;&lt;br /&gt;
!                      &amp;lt;tt&amp;gt;inhbit_charge_&amp;lt;br /&amp;gt;minutes&amp;lt;/tt&amp;gt;&lt;br /&gt;
!                                   &amp;lt;tt&amp;gt;force_discharge&amp;lt;/tt&amp;gt;&lt;br /&gt;
!                                                battery status files&lt;br /&gt;
!                                                             &amp;lt;tt&amp;gt;cd_speed&amp;lt;/tt&amp;gt;&amp;lt;br \&amp;gt;&amp;lt;span style=&amp;quot;font-size: 90%&amp;quot;&amp;gt;(removed)&amp;lt;/span&amp;gt;&lt;br /&gt;
!                                                                       Notes&lt;br /&gt;
|-&lt;br /&gt;
! colspan=8 style=&amp;quot;text-align:center;background:#efefef;&amp;quot; | &lt;br /&gt;
=====A series=====&lt;br /&gt;
|-&lt;br /&gt;
! {{A22p}} 2629-USG&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{A30}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! colspan=8 style=&amp;quot;text-align:center;background:#efefef;&amp;quot; |&lt;br /&gt;
=====G series=====&lt;br /&gt;
|-&lt;br /&gt;
! {{G41}}&lt;br /&gt;
| {{Cyes}} || {{Cno}}  || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! colspan=8 style=&amp;quot;text-align:center;background:#efefef;&amp;quot; |&lt;br /&gt;
=====R series=====&lt;br /&gt;
|-&lt;br /&gt;
! [[:Category:R31|R31]]&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || No SMAPI BIOS&lt;br /&gt;
|-&lt;br /&gt;
! {{R40}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cunk}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{R50}}&lt;br /&gt;
| {{Cunk}} || {{Cno}}  || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{R50e}} 1834-JAG&lt;br /&gt;
| {{Cyes}} || {{Cno}}  || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{R50p}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cyes}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{R51}}&lt;br /&gt;
| {{Cyes}} || {{Cno}}  || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{R52}}&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{R60}}&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
! colspan=8 style=&amp;quot;text-align:center;background:#efefef;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=====T series=====&lt;br /&gt;
|-&lt;br /&gt;
! {{T20}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cunk}} || Has SMAPI BIOS but no function is supported. EC LPC3 protocol fails.&lt;br /&gt;
|-&lt;br /&gt;
! {{T22}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cunk}} || Has SMAPI BIOS but no function is supported. EC LPC3 protocol fails.&lt;br /&gt;
|-&lt;br /&gt;
! {{T23}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{T30}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{T40}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cunk}} || {{Cyes}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{T40p}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cyes}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{T41}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cyes}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{T41p}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}} || {{Cyes}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{T42}} &lt;br /&gt;
| {{Cyes}} || {{Cno}}  || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{T42p}} 2373-KUU&lt;br /&gt;
| {{Cyes}} || {{Cno}}  || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{T43}} 2686-DGU&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{T43p}}&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{T60}}&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! colspan=8 style=&amp;quot;text-align:center;background:#efefef;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=====X series=====&lt;br /&gt;
|-&lt;br /&gt;
! {{X20}} 2662-31G&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cunk}} || tp_smapi 0.20&lt;br /&gt;
|-&lt;br /&gt;
! {{X24}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cunk}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{X31}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cunk}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{X32}}&lt;br /&gt;
| {{Cno}}  || {{Cno}}  || {{Cno}}  || {{Cno}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{X40}}&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cyes}} || {{Cunk}} || BIOS v2.03, EC v1.60&lt;br /&gt;
|-&lt;br /&gt;
! {{X41}}&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{X60}}&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} || BIOS v2.07, EC v1.10, 2.6.20 issue (see discussion)&lt;br /&gt;
|-&lt;br /&gt;
! colspan=8 style=&amp;quot;text-align:center;background:#efefef;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
=====Z series=====&lt;br /&gt;
|-&lt;br /&gt;
! {{Z60m}}&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{Z60t}}&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cunk}} || {{Cunk}} || {{Cyes}} || {{Cunk}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{Z61m}}&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} ||&lt;br /&gt;
|-&lt;br /&gt;
! {{Z61t}}&lt;br /&gt;
| {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} || {{Cyes}} ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please update the above and report your experience on the [[Talk:tp_smapi|discussion]] page. If the module loads but gives a &amp;quot;&amp;lt;tt&amp;gt;not supported&amp;lt;/tt&amp;gt;&amp;quot; or &amp;quot;&amp;lt;tt&amp;gt;not implementeded&amp;lt;/tt&amp;gt;&amp;quot; when you try to use some specific file in {{path|/sys/devices/platform/smapi/}}, please report the &amp;lt;tt&amp;gt;dmesg&amp;lt;/tt&amp;gt; output and whether the corresponding functionality is available under Windows - maybe your ThinkPad just can't do that. &lt;br /&gt;
&lt;br /&gt;
While at it, you may also want to add your laptop to the [[list of DMI IDs]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Drivers]] [[Category:Patches]]&lt;br /&gt;
&lt;br /&gt;
===Tools using this driver===&lt;br /&gt;
&lt;br /&gt;
The driver's interface can be accessed directly through the files under {{path|/sys/devices/platform/smapi}}, or via the following tools:&lt;br /&gt;
* [[KThinkBat]] - display battery status on the KDE &amp;lt;tt&amp;gt;kicker&amp;lt;/tt&amp;gt; panel.&lt;br /&gt;
* [[gkrellm-ThinkBat]] - battery status plugin for Gkrellm2&lt;br /&gt;
* {{CodeRef|thinkpad-smapi.sh}} - script to display various SMAPI information using tp_smapi module.&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=How_to_configure_the_TrackPoint&amp;diff=10029</id>
		<title>How to configure the TrackPoint</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=How_to_configure_the_TrackPoint&amp;diff=10029"/>
		<updated>2005-10-08T10:09:33Z</updated>

		<summary type="html">&lt;p&gt;Runia: /* Using the X server (kernel 2.6.11+) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|style=&amp;quot;vertical-align:top;padding-right:20px;width:10px;white-space:nowrap;&amp;quot; | __TOC__&lt;br /&gt;
|style=&amp;quot;vertical-align:top&amp;quot; |The [[Patch to enable advanced trackpoint configuration|kernel trackpoint driver]] is controlled by echoing values to special files. Common configuration options are outlined below.&lt;br /&gt;
{{NOTE|&lt;br /&gt;
Prior to kernel 2.6.11 these files were located in &amp;lt;tt&amp;gt;/proc/trackpoint&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
From 2.6.11 on this is no longer the case. Instead use &amp;lt;tt&amp;gt;/sys/devices/platform/i8042/serio0&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
(The newer form is used throughout this document.)&lt;br /&gt;
}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==General Configuration==&lt;br /&gt;
The configuration options are reflected by the files you can find in {{path|/sys/devices/platform/i8042/serio0}}. See the [[Patch to enable advanced trackpoint configuration|TrackPoint driver page]] for a complete list.&lt;br /&gt;
Configuration is done by echoing the appropriate values into these special files.&lt;br /&gt;
{{HINT|If &amp;lt;tt&amp;gt;echo XX &amp;gt; file&amp;lt;/tt&amp;gt; isn't working for you, try &amp;lt;tt&amp;gt;echo -n XX &amp;gt; file&amp;lt;/tt&amp;gt; instead}}&lt;br /&gt;
&lt;br /&gt;
==Most common Features==&lt;br /&gt;
The most common settings are '''Press to Select''', '''sensitivity''', '''speed''' and '''scrolling'''.&lt;br /&gt;
&lt;br /&gt;
===Press to Select===&lt;br /&gt;
Press to Select allows you to tap the control stick which will simulate a left click. You can enable this feature by typing the following in to a terminal (you may need to be root):&lt;br /&gt;
&lt;br /&gt;
:{{cmdroot|echo 1 &amp;gt; /sys/devices/platform/i8042/serio0/press_to_select}}&lt;br /&gt;
&lt;br /&gt;
Press to Select should now be enabled. You can disable it in a similar manner:&lt;br /&gt;
&lt;br /&gt;
:{{cmdroot|echo 0 &amp;gt; /sys/devices/platform/i8042/serio0/press_to_select}}&lt;br /&gt;
&lt;br /&gt;
===Sensitivity &amp;amp; Speed===&lt;br /&gt;
Adjusting the speed and sensitivity of the TrackPoint requires echoing a value between 0 and 255 into the appropriate file. For example, for a speed of 120 and a sensitivity of 250, type the following into a terminal:&lt;br /&gt;
&lt;br /&gt;
:{{cmdroot|echo 120 &amp;gt; /sys/devices/platform/i8042/serio0/speed}}&lt;br /&gt;
:{{cmdroot|echo 250 &amp;gt; /sys/devices/platform/i8042/serio0/sensitivity}}&lt;br /&gt;
&lt;br /&gt;
Feel free to experiment with your settings until you find a combination that is comfortable.&lt;br /&gt;
&lt;br /&gt;
===Scrolling===&lt;br /&gt;
====Using a kernel prior to 2.6.11====&lt;br /&gt;
The scrolling action is essentially the same as is used in the TrackPoint Windows drivers. To enable this feature, type the following in to a terminal (you may need to be root): &lt;br /&gt;
&lt;br /&gt;
:{{cmdroot|echo 1 &amp;gt; /proc/trackpoint/scroll}}&lt;br /&gt;
&lt;br /&gt;
Then press the middle button and push the stick up and down to scroll. Similarly, to disable scrolling:&lt;br /&gt;
&lt;br /&gt;
:{{cmdroot|echo 0 &amp;gt; /proc/trackpoint/scroll}}&lt;br /&gt;
&lt;br /&gt;
====Using the X server (kernel 2.6.11+)====&lt;br /&gt;
The scroll setting has been removed from the trackpoint driver in kernel versions 2.6.11 and above. Scroll emulation should now be handled in the X server. First do:&lt;br /&gt;
&lt;br /&gt;
:{{cmd|echo -n 0 &amp;gt;  /sys/devices/platform/i8042/serio0/middle_btn_disable}}&lt;br /&gt;
&lt;br /&gt;
(Note for kernel 2.6.13: There's no more such file /sys/devices/platform/i8042/serio0/middle_btn_disable)&lt;br /&gt;
&lt;br /&gt;
Then, for versions of Xorg since ~Oct '04, add these lines to your TrackPoint configuration section in {{path|/etc/X11/xorg.conf}}:&lt;br /&gt;
&lt;br /&gt;
        Option          &amp;quot;EmulateWheel&amp;quot;          &amp;quot;on&amp;quot;&lt;br /&gt;
        Option          &amp;quot;EmulateWheelButton&amp;quot;    &amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now restart X and hold down button 2 and move the mouse to scroll, or just press and release button 2 for a middle click.&lt;br /&gt;
Please note that the patch allowing to use button 2 for a middle click is currently (27/09/05) NOT included in Debian and Ubuntu packages of Xorg. You can find an updated version of the package in the Experimental branch of debian.&lt;br /&gt;
&lt;br /&gt;
For older versions of Xorg or for Xfree86 ({{path|/etc/X11/XF86Config}}) try this:&lt;br /&gt;
&lt;br /&gt;
       Option          &amp;quot;Emulate3Buttons&amp;quot;       &amp;quot;true&amp;quot;&lt;br /&gt;
       Option          &amp;quot;EmulateWheel&amp;quot;          &amp;quot;true&amp;quot;&lt;br /&gt;
       Option          &amp;quot;EmulateWheelButton&amp;quot;    &amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now restart X and hold down button two and move the mouse for scrolling. To get a middle click, press buttons 1 and 3 simultaneously.&lt;br /&gt;
&lt;br /&gt;
==Soft Transparent Mode==&lt;br /&gt;
If you wish to connect a special device to the external PS/2 port, you should consider using &amp;quot;Soft Transparent Mode&amp;quot; so that the TrackPoint controller does not interpret any commands sent to the external PS/2 port. You can enable soft transparent mode by typing the following in to a terminal:&lt;br /&gt;
&lt;br /&gt;
:{{cmdroot|echo 1 &amp;gt; /proc/trackpoint/transparent}}&lt;br /&gt;
&lt;br /&gt;
Disabling soft transparent mode is similar:&lt;br /&gt;
&lt;br /&gt;
:{{cmdroot|echo 0 &amp;gt; /proc/trackpoint/transparent}}&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Problem_with_high_power_drain_in_ACPI_sleep&amp;diff=9918</id>
		<title>Problem with high power drain in ACPI sleep</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Problem_with_high_power_drain_in_ACPI_sleep&amp;diff=9918"/>
		<updated>2005-10-08T10:03:53Z</updated>

		<summary type="html">&lt;p&gt;Runia: /* Affected Models */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Information about the problem of too high power drain in ACPI sleep mode.&lt;br /&gt;
&lt;br /&gt;
==Problem description==&lt;br /&gt;
Several people realized that their ThinkPads eat up too much power while suspended to ram via ACPI. Compared to APM suspend to ram the power drain is experienced to be about 10 times as high, 2-5 Watts. This empties the battery within one or two days.&lt;br /&gt;
&lt;br /&gt;
==Affected Models==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; style=&amp;quot;float:right;margin-left:20px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;vertical-align:top;background-color:#ffcfbc;&amp;quot; | affected models&lt;br /&gt;
! style=&amp;quot;vertical-align:top;background-color:#cfefcf;&amp;quot; | unaffected models &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;vertical-align:top;background-color:#fff0e0;&amp;quot; |&lt;br /&gt;
* {{R32}}&lt;br /&gt;
** 2658-BQG&lt;br /&gt;
* {{R40}}&lt;br /&gt;
** 2722-5MG&lt;br /&gt;
** 2722-B3G&lt;br /&gt;
** 2722-CDG&lt;br /&gt;
** 2897-GWU&lt;br /&gt;
** 2722-6YU&lt;br /&gt;
** 2722-CDG&lt;br /&gt;
* {{R50}}&lt;br /&gt;
** 1829-7RG&lt;br /&gt;
** 1829-6DM&lt;br /&gt;
** 1836-3SU&lt;br /&gt;
* {{R51}}&lt;br /&gt;
** 1829-9MG&lt;br /&gt;
** 1829-EHG&lt;br /&gt;
** 1829-R6G&lt;br /&gt;
** 1830-DG4&lt;br /&gt;
** 1836-Q6U&lt;br /&gt;
* {{T23}}&lt;br /&gt;
**2647-???&lt;br /&gt;
* {{T30}}&lt;br /&gt;
** 2366-81A&lt;br /&gt;
** 2366-97U&lt;br /&gt;
** 2366-FBU&lt;br /&gt;
** 2366-96G&lt;br /&gt;
*{{T40}}&lt;br /&gt;
**2373-MU3 &lt;br /&gt;
**2373-82U&lt;br /&gt;
**2373-92U&lt;br /&gt;
**2373-22G&lt;br /&gt;
**2373-19G&lt;br /&gt;
**2373-A1U&lt;br /&gt;
**2373-42G&lt;br /&gt;
*{{T40p}}&lt;br /&gt;
**2373-G1U &lt;br /&gt;
**2373-G3U&lt;br /&gt;
**2373-G3G&lt;br /&gt;
**2373-G1G&lt;br /&gt;
**2373-G5G&lt;br /&gt;
* {{T41}}&lt;br /&gt;
**2379-DJU&lt;br /&gt;
**2373-9HU&lt;br /&gt;
**2373-4FG&lt;br /&gt;
**2373-4PG&lt;br /&gt;
**2373-1FG&lt;br /&gt;
**2373-2FG&lt;br /&gt;
**2373-2GG&lt;br /&gt;
**2373-6U4&lt;br /&gt;
**2373-7JU&lt;br /&gt;
**2373-CY0&lt;br /&gt;
**2373-TG5&lt;br /&gt;
* {{T41p}}&lt;br /&gt;
**2373-9FU&lt;br /&gt;
* {{T42}}&lt;br /&gt;
**2373-C19&lt;br /&gt;
**2373-CTO&lt;br /&gt;
**2378-DTU&lt;br /&gt;
**2378-DUU&lt;br /&gt;
**2373-FWG&lt;br /&gt;
**2374-ZEP&lt;br /&gt;
**2373-F2G&lt;br /&gt;
**[[2373-6ZG]]&lt;br /&gt;
* {{X21}}&lt;br /&gt;
**2662-BSG&lt;br /&gt;
* {{X32}}&lt;br /&gt;
**2884-A3U&lt;br /&gt;
| style=&amp;quot;vertical-align:top;background-color:#e9f9e9;&amp;quot; |&lt;br /&gt;
*[[:Category:R50p | R50p]]&lt;br /&gt;
*[[:Category:R52 | R52]]&lt;br /&gt;
**1858-6MM&lt;br /&gt;
*[[:Category:T41 | T41]]&lt;br /&gt;
**2373-GEU&lt;br /&gt;
*[[:Category:T41p | T41p]]&lt;br /&gt;
**2373-GKG&lt;br /&gt;
**2373-GGG&lt;br /&gt;
**[[2373-GHG]]&lt;br /&gt;
*[[:Category:T42p | T42p]]&lt;br /&gt;
**[[2373-HTG]]&lt;br /&gt;
**[[2373-W6M]]&lt;br /&gt;
**[[2373-GTG]]&lt;br /&gt;
**[[2373-GXG]]&lt;br /&gt;
**2373-KXM&lt;br /&gt;
*[[:Category:T42 | T42]]&lt;br /&gt;
**[[2378-FVU]]&lt;br /&gt;
**[[2373-WBZ]]&lt;br /&gt;
**[[2378-RTU]]&lt;br /&gt;
*[[:Category:T43 | T43]]&lt;br /&gt;
**[[2668-W12]]&lt;br /&gt;
*[[:Category:X40 | X40]]&lt;br /&gt;
**2371&lt;br /&gt;
*[[:Category:A22m | A22m]]&lt;br /&gt;
**2628&lt;br /&gt;
*[[:Category:A31 | A31]]&lt;br /&gt;
**2652-D5G&lt;br /&gt;
|}&lt;br /&gt;
*Different symptoms have been reported for different models. In some models the origin of the power drain is obvious ([[Problem with LCD backlight remaining on during ACPI sleep|backlight on during suspend]]), in other models there is no obvious reason.&lt;br /&gt;
&lt;br /&gt;
*On some models/configurations the higher power drain couldn't even be realized or was at least significantly lower.&lt;br /&gt;
&lt;br /&gt;
*The T4x ThinkPad series and other Radeon based models suspend to ram just fine, and there are no components that are obviously left powered up. The [[UltraBay]] and network light is on, but that is the same under windows (but under APM sleep to RAM those lights are OFF). For these models the higher power drain is caused by a driver problem and can be fixed in software. This fix has not yet made its way into the official kernel (as of linux 2.6.12).&lt;br /&gt;
&lt;br /&gt;
The table on the right gives an overview of the models suffering from the mysterious power drain. To find out about your model, you may use the following [[ACPI sleep power drain test script | script]]. It creates a file {{path|/var/log/battery.log}} which will tell you if you are affected or not.&lt;br /&gt;
&lt;br /&gt;
==Affected Operating Systems==&lt;br /&gt;
*Linux, all flavours.&lt;br /&gt;
*Windows, for some models as well (only when using non-IBM drivers).&lt;br /&gt;
*FreeBSD (on the A22M)&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
*The cause of the mysterious power drain is the Radeon GPU, which requires extra steps to suspend properly. Unfortunately, this fix might break non-ThinkPad machines and therefore is not yet in the official kernel sources.&lt;br /&gt;
*The official bugzilla entry for the radeon suspend issue is in the [http://bugme.osdl.org/show_bug.cgi?id=3022 OSDL Bugzilla]. There you can find a patch which will solve the power drain issue.&lt;br /&gt;
{{WARN|This solution enables doing suspend-to-D2 on non-PPC-machines, which is not properly documented! Be careful and have a look at the discussion for kernel bug 3022 (see above) before applying the patch. By default, the patch enables the suspend-to-D2 only on machines where it is know to work. This behaviour can be overridden with a module option.}}&lt;br /&gt;
*Most certainly, the DSDT is not at fault. (Interesting to note: The DSDT from BIOS 3.13 (Nov 04) for the T42p compiles without bugs.)&lt;br /&gt;
*Some additional power savings can be achieved by turning off the wake-on-lan ({{cmdroot|ethtool -s eth0 wol d}}). The power drain of the wol feature is far smaller than the radeon bug, but can be noticeable.&lt;br /&gt;
&lt;br /&gt;
==Solutions==&lt;br /&gt;
===For ThinkPads with Radeon graphic chips===&lt;br /&gt;
You must use a patched version of the radeon frame buffer, even if you are only interested in using the X window system. This modified radeon frame buffer then suspends the radeon chip correctly during ACPI sleep. This patch is not yet in the official (kernel.org) kernels.&lt;br /&gt;
&lt;br /&gt;
The [http://carrot.hep.upenn.edu/~vbraun/kernel-T4x/test/patch-2.6.11-rc2-radeonfb-D2.patch.bz2 patch] contains a list of ThinkPads where it is known to work, and by default only activates on these machines. If you think that your computer would profit from the patch as well, you can force it by including the module parameter {{bootparm|radeon_force_sleep|1}}. If it doesn't work this can result in system hangs.&lt;br /&gt;
&lt;br /&gt;
====Technical Background====&lt;br /&gt;
The patch removes the CONFIG_PPC_PMAC condition for enabling D2 sleep in {{path|drivers/video/aty/radeon_pm.c}} as discussed in [http://bugme.osdl.org/show_bug.cgi?id=3022 kernel bug 3022]. &lt;br /&gt;
&lt;br /&gt;
====Fedora Core====&lt;br /&gt;
* Fedora Core 4: Fedora ships a patched radeon frame buffer (radeonfb.ko), but you must enable it yourself. {{Fedora}} compiles it as a module rather than including it in the kernel, therefore you cannot activate it at boot time without a custom initrd. You must arrange for the module to be loaded before X starts (for example, using an init script).&lt;br /&gt;
* Fedora Core 3: this is also true for updated kernels (at least for kernel-2.6.12-1.1376_FC3) but '''not''' for the initially shipped version.&lt;br /&gt;
&lt;br /&gt;
There are precompiled patched kernels [http://www.sas.upenn.edu/~vbraun/computing/T41/kernel.html available] as well, that do not need an initrd modification:&lt;br /&gt;
*[http://carrot.hep.upenn.edu/~vbraun/kernel-T4x/i386/kernel-T4x-2.6.11.11-26.i386.rpm linux 2.6.11 for Fedora Core 3]&lt;br /&gt;
*[http://carrot.hep.upenn.edu/~vbraun/kernel-T4x/i386/kernel-T4x-2.6.12.2-2.i386.rpm linux 2.6.12 for Fedora Core 4]&lt;br /&gt;
These kernels contain additional ThinkPad-related patches, including software suspend2 and trackpoint support. Suspend to disk and suspend to ram should work with them. If your ThinkPad model is not yet whitelisted in the patch, you might have to enable the radeon fix by including the parameter {{bootparm|video|2=radeonfb:radeon_force_sleep=1}} on the kernel command line.&lt;br /&gt;
&lt;br /&gt;
If you try, please send the result (hang yes/no, battery drain yes/no) with the precise model number (i.e. IBM ThinkPad T41 2379-DJU) to &amp;lt;tt&amp;gt;vbraun at physics dot upenn dot edu&amp;lt;/tt&amp;gt;, it would be nice if your subject line would include &amp;quot;RADEONFB:&amp;quot; to make sure that I do not miss any emails.&lt;br /&gt;
&lt;br /&gt;
=====testing radeonfb without changing initrd=====&lt;br /&gt;
If you want to try the radeon frame buffer, you can enable it as follows:&lt;br /&gt;
*First, switch to a console ({{key|Ctrl}}{{key|Alt}}{{key|F1}}) and log in as root.&lt;br /&gt;
*Stop X: {{cmdroot|init 3}}&lt;br /&gt;
*Now you can load the module: {{cmdroot|1=modprobe radeonfb radeon_force_sleep=1}}&lt;br /&gt;
*Finally, resume X: {{cmdroot|init 5}}&lt;br /&gt;
&lt;br /&gt;
=====including radeonfb into your initrd=====&lt;br /&gt;
As an alternative you can build your customized initrd. This is as simple as running&lt;br /&gt;
:{{cmdroot|1=mkinitrd --with=radeonfb /boot/&amp;lt;name-of-your-new-initrd&amp;gt; `uname -r`}}&lt;br /&gt;
and replacing the initrd in {{path|/boot/grub/grub.conf}} with your new one. You also need to add the kernel command line argument {{bootparm|video|2=radeonfb:radeon_force_sleep=1}}.&lt;br /&gt;
&lt;br /&gt;
====Gentoo====&lt;br /&gt;
After installing the patch on {{Gentoo}} (it works fine with gentoo-sources: {{cmdroot|cd /usr/src/linux/drivers/video/aty}}, and execute {{cmdroot|patch -p4 &amp;lt;patchname&amp;gt;}}, then recompile the kernel), one needs to add {{bootparm|video|radeonfb:force_sleep}} to the kernel parameters.&lt;br /&gt;
&lt;br /&gt;
====Another possible solution====&lt;br /&gt;
It is possible that [[radeontool]] will help some people with this case.&lt;br /&gt;
(simply run radeontool light off before suspend and radeontool light on after resume).&lt;br /&gt;
A radeontool patch for freebsd is here: http://www.init-main.com/radeontool.patch (by Takanori Watanabe).&lt;br /&gt;
&lt;br /&gt;
===For models without radeon graphics===&lt;br /&gt;
The Problem seems to be solved when you use the [http://www.srcf.ucam.org/~mjg59/vbetool/ vbetool] to turn the LCD off before suspending ...&lt;br /&gt;
:{{cmdroot|vbetool dpms off}}&lt;br /&gt;
and turning it on afterwards again...&lt;br /&gt;
:{{cmdroot|vbetool dpms on}}&lt;br /&gt;
You have to change to a normal console before turning the LCD off.&lt;br /&gt;
Additionally you have to deactivate the Wake-On-Lan feature like mentioned above ...&lt;br /&gt;
:{{cmdroot|ethtool -s eth0 wol d}}&lt;br /&gt;
With these commands used together the &amp;quot;testing script&amp;quot; reports no high power drain while suspending.&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Problem_with_high_power_drain_in_ACPI_sleep&amp;diff=9791</id>
		<title>Problem with high power drain in ACPI sleep</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Problem_with_high_power_drain_in_ACPI_sleep&amp;diff=9791"/>
		<updated>2005-10-08T10:03:40Z</updated>

		<summary type="html">&lt;p&gt;Runia: /* Affected Models */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Information about the problem of too high power drain in ACPI sleep mode.&lt;br /&gt;
&lt;br /&gt;
==Problem description==&lt;br /&gt;
Several people realized that their ThinkPads eat up too much power while suspended to ram via ACPI. Compared to APM suspend to ram the power drain is experienced to be about 10 times as high, 2-5 Watts. This empties the battery within one or two days.&lt;br /&gt;
&lt;br /&gt;
==Affected Models==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; style=&amp;quot;float:right;margin-left:20px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;vertical-align:top;background-color:#ffcfbc;&amp;quot; | affected models&lt;br /&gt;
! style=&amp;quot;vertical-align:top;background-color:#cfefcf;&amp;quot; | unaffected models &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;vertical-align:top;background-color:#fff0e0;&amp;quot; |&lt;br /&gt;
* {{R32}}&lt;br /&gt;
** 2658-BQG&lt;br /&gt;
* {{R40}}&lt;br /&gt;
** 2722-5MG&lt;br /&gt;
** 2722-B3G&lt;br /&gt;
** 2722-CDG&lt;br /&gt;
** 2897-GWU&lt;br /&gt;
** 2722-6YU&lt;br /&gt;
** 2722-CDG&lt;br /&gt;
* {{R50}}&lt;br /&gt;
** 1829-7RG&lt;br /&gt;
** 1829-6DM&lt;br /&gt;
** 1836-3SU&lt;br /&gt;
* {{R51}}&lt;br /&gt;
** 1829-9MG&lt;br /&gt;
** 1829-EHG&lt;br /&gt;
** 1829-R6G&lt;br /&gt;
** 1830-DG4&lt;br /&gt;
** 1836-Q6U&lt;br /&gt;
* {{T23}}&lt;br /&gt;
**2647-???&lt;br /&gt;
* {{T30}}&lt;br /&gt;
** 2366-81A&lt;br /&gt;
** 2366-97U&lt;br /&gt;
** 2366-FBU&lt;br /&gt;
** 2366-96G&lt;br /&gt;
*{{T40}}&lt;br /&gt;
**2373-MU3 &lt;br /&gt;
**2373-82U&lt;br /&gt;
**2373-92U&lt;br /&gt;
**2373-22G&lt;br /&gt;
**2373-19G&lt;br /&gt;
**2373-A1U&lt;br /&gt;
**2373-42G&lt;br /&gt;
*{{T40p}}&lt;br /&gt;
**2373-G1U &lt;br /&gt;
**2373-G3U&lt;br /&gt;
**2373-G3G&lt;br /&gt;
**2373-G1G&lt;br /&gt;
**2373-G5G&lt;br /&gt;
* {{T41}}&lt;br /&gt;
**2379-DJU&lt;br /&gt;
**2373-9HU&lt;br /&gt;
**2373-4FG&lt;br /&gt;
**2373-4PG&lt;br /&gt;
**2373-1FG&lt;br /&gt;
**2373-2FG&lt;br /&gt;
**2373-2GG&lt;br /&gt;
**2373-6U4&lt;br /&gt;
**2373-7JU&lt;br /&gt;
**2373-CY0&lt;br /&gt;
**2373-TG5&lt;br /&gt;
* {{T41p}}&lt;br /&gt;
**2373-9FU&lt;br /&gt;
* {{T42}}&lt;br /&gt;
**2373-C19&lt;br /&gt;
**2373-CTO&lt;br /&gt;
**2378-DTU&lt;br /&gt;
**2378-DUU&lt;br /&gt;
**2373-FWG&lt;br /&gt;
**2374-ZEP&lt;br /&gt;
**2373-F2G&lt;br /&gt;
**[[2373-6ZG]]&lt;br /&gt;
* {{X21}}&lt;br /&gt;
**2662-BSG&lt;br /&gt;
* {{X32}}&lt;br /&gt;
**2884-A3U&lt;br /&gt;
| style=&amp;quot;vertical-align:top;background-color:#e9f9e9;&amp;quot; |&lt;br /&gt;
*[[:Category:R50p | R50p]]&lt;br /&gt;
*[[:Category:R52 | R52]]&lt;br /&gt;
**1858-6MM&lt;br /&gt;
*[[:Category:T41 | T41]]&lt;br /&gt;
**2373-GEU&lt;br /&gt;
*[[:Category:T41p | T41p]]&lt;br /&gt;
**2373-GKG&lt;br /&gt;
**2373-GGG&lt;br /&gt;
**[[2373-GHG]]&lt;br /&gt;
*[[:Category:T42p | T42p]]&lt;br /&gt;
**[[2373-HTG]]&lt;br /&gt;
**[[2373-W6M]]&lt;br /&gt;
**[[2373-GTG]]&lt;br /&gt;
**[[2373-GXG]]&lt;br /&gt;
**2373-KXM&lt;br /&gt;
*[[:Category:T42 | T42]]&lt;br /&gt;
**[[2378-FVU]]&lt;br /&gt;
**[[2373-WBZ]]&lt;br /&gt;
**[[2378-RTU]]&lt;br /&gt;
*[[:Category:T43 | T43]]&lt;br /&gt;
**[[2668-W12]]&lt;br /&gt;
*[[:Category:X40 | X40]]&lt;br /&gt;
**2371&lt;br /&gt;
*[[:Category:A22m | A22m]]&lt;br /&gt;
**2628&lt;br /&gt;
*[[:Category:A31 | A31]]&lt;br /&gt;
**2652-&lt;br /&gt;
|}&lt;br /&gt;
*Different symptoms have been reported for different models. In some models the origin of the power drain is obvious ([[Problem with LCD backlight remaining on during ACPI sleep|backlight on during suspend]]), in other models there is no obvious reason.&lt;br /&gt;
&lt;br /&gt;
*On some models/configurations the higher power drain couldn't even be realized or was at least significantly lower.&lt;br /&gt;
&lt;br /&gt;
*The T4x ThinkPad series and other Radeon based models suspend to ram just fine, and there are no components that are obviously left powered up. The [[UltraBay]] and network light is on, but that is the same under windows (but under APM sleep to RAM those lights are OFF). For these models the higher power drain is caused by a driver problem and can be fixed in software. This fix has not yet made its way into the official kernel (as of linux 2.6.12).&lt;br /&gt;
&lt;br /&gt;
The table on the right gives an overview of the models suffering from the mysterious power drain. To find out about your model, you may use the following [[ACPI sleep power drain test script | script]]. It creates a file {{path|/var/log/battery.log}} which will tell you if you are affected or not.&lt;br /&gt;
&lt;br /&gt;
==Affected Operating Systems==&lt;br /&gt;
*Linux, all flavours.&lt;br /&gt;
*Windows, for some models as well (only when using non-IBM drivers).&lt;br /&gt;
*FreeBSD (on the A22M)&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
*The cause of the mysterious power drain is the Radeon GPU, which requires extra steps to suspend properly. Unfortunately, this fix might break non-ThinkPad machines and therefore is not yet in the official kernel sources.&lt;br /&gt;
*The official bugzilla entry for the radeon suspend issue is in the [http://bugme.osdl.org/show_bug.cgi?id=3022 OSDL Bugzilla]. There you can find a patch which will solve the power drain issue.&lt;br /&gt;
{{WARN|This solution enables doing suspend-to-D2 on non-PPC-machines, which is not properly documented! Be careful and have a look at the discussion for kernel bug 3022 (see above) before applying the patch. By default, the patch enables the suspend-to-D2 only on machines where it is know to work. This behaviour can be overridden with a module option.}}&lt;br /&gt;
*Most certainly, the DSDT is not at fault. (Interesting to note: The DSDT from BIOS 3.13 (Nov 04) for the T42p compiles without bugs.)&lt;br /&gt;
*Some additional power savings can be achieved by turning off the wake-on-lan ({{cmdroot|ethtool -s eth0 wol d}}). The power drain of the wol feature is far smaller than the radeon bug, but can be noticeable.&lt;br /&gt;
&lt;br /&gt;
==Solutions==&lt;br /&gt;
===For ThinkPads with Radeon graphic chips===&lt;br /&gt;
You must use a patched version of the radeon frame buffer, even if you are only interested in using the X window system. This modified radeon frame buffer then suspends the radeon chip correctly during ACPI sleep. This patch is not yet in the official (kernel.org) kernels.&lt;br /&gt;
&lt;br /&gt;
The [http://carrot.hep.upenn.edu/~vbraun/kernel-T4x/test/patch-2.6.11-rc2-radeonfb-D2.patch.bz2 patch] contains a list of ThinkPads where it is known to work, and by default only activates on these machines. If you think that your computer would profit from the patch as well, you can force it by including the module parameter {{bootparm|radeon_force_sleep|1}}. If it doesn't work this can result in system hangs.&lt;br /&gt;
&lt;br /&gt;
====Technical Background====&lt;br /&gt;
The patch removes the CONFIG_PPC_PMAC condition for enabling D2 sleep in {{path|drivers/video/aty/radeon_pm.c}} as discussed in [http://bugme.osdl.org/show_bug.cgi?id=3022 kernel bug 3022]. &lt;br /&gt;
&lt;br /&gt;
====Fedora Core====&lt;br /&gt;
* Fedora Core 4: Fedora ships a patched radeon frame buffer (radeonfb.ko), but you must enable it yourself. {{Fedora}} compiles it as a module rather than including it in the kernel, therefore you cannot activate it at boot time without a custom initrd. You must arrange for the module to be loaded before X starts (for example, using an init script).&lt;br /&gt;
* Fedora Core 3: this is also true for updated kernels (at least for kernel-2.6.12-1.1376_FC3) but '''not''' for the initially shipped version.&lt;br /&gt;
&lt;br /&gt;
There are precompiled patched kernels [http://www.sas.upenn.edu/~vbraun/computing/T41/kernel.html available] as well, that do not need an initrd modification:&lt;br /&gt;
*[http://carrot.hep.upenn.edu/~vbraun/kernel-T4x/i386/kernel-T4x-2.6.11.11-26.i386.rpm linux 2.6.11 for Fedora Core 3]&lt;br /&gt;
*[http://carrot.hep.upenn.edu/~vbraun/kernel-T4x/i386/kernel-T4x-2.6.12.2-2.i386.rpm linux 2.6.12 for Fedora Core 4]&lt;br /&gt;
These kernels contain additional ThinkPad-related patches, including software suspend2 and trackpoint support. Suspend to disk and suspend to ram should work with them. If your ThinkPad model is not yet whitelisted in the patch, you might have to enable the radeon fix by including the parameter {{bootparm|video|2=radeonfb:radeon_force_sleep=1}} on the kernel command line.&lt;br /&gt;
&lt;br /&gt;
If you try, please send the result (hang yes/no, battery drain yes/no) with the precise model number (i.e. IBM ThinkPad T41 2379-DJU) to &amp;lt;tt&amp;gt;vbraun at physics dot upenn dot edu&amp;lt;/tt&amp;gt;, it would be nice if your subject line would include &amp;quot;RADEONFB:&amp;quot; to make sure that I do not miss any emails.&lt;br /&gt;
&lt;br /&gt;
=====testing radeonfb without changing initrd=====&lt;br /&gt;
If you want to try the radeon frame buffer, you can enable it as follows:&lt;br /&gt;
*First, switch to a console ({{key|Ctrl}}{{key|Alt}}{{key|F1}}) and log in as root.&lt;br /&gt;
*Stop X: {{cmdroot|init 3}}&lt;br /&gt;
*Now you can load the module: {{cmdroot|1=modprobe radeonfb radeon_force_sleep=1}}&lt;br /&gt;
*Finally, resume X: {{cmdroot|init 5}}&lt;br /&gt;
&lt;br /&gt;
=====including radeonfb into your initrd=====&lt;br /&gt;
As an alternative you can build your customized initrd. This is as simple as running&lt;br /&gt;
:{{cmdroot|1=mkinitrd --with=radeonfb /boot/&amp;lt;name-of-your-new-initrd&amp;gt; `uname -r`}}&lt;br /&gt;
and replacing the initrd in {{path|/boot/grub/grub.conf}} with your new one. You also need to add the kernel command line argument {{bootparm|video|2=radeonfb:radeon_force_sleep=1}}.&lt;br /&gt;
&lt;br /&gt;
====Gentoo====&lt;br /&gt;
After installing the patch on {{Gentoo}} (it works fine with gentoo-sources: {{cmdroot|cd /usr/src/linux/drivers/video/aty}}, and execute {{cmdroot|patch -p4 &amp;lt;patchname&amp;gt;}}, then recompile the kernel), one needs to add {{bootparm|video|radeonfb:force_sleep}} to the kernel parameters.&lt;br /&gt;
&lt;br /&gt;
====Another possible solution====&lt;br /&gt;
It is possible that [[radeontool]] will help some people with this case.&lt;br /&gt;
(simply run radeontool light off before suspend and radeontool light on after resume).&lt;br /&gt;
A radeontool patch for freebsd is here: http://www.init-main.com/radeontool.patch (by Takanori Watanabe).&lt;br /&gt;
&lt;br /&gt;
===For models without radeon graphics===&lt;br /&gt;
The Problem seems to be solved when you use the [http://www.srcf.ucam.org/~mjg59/vbetool/ vbetool] to turn the LCD off before suspending ...&lt;br /&gt;
:{{cmdroot|vbetool dpms off}}&lt;br /&gt;
and turning it on afterwards again...&lt;br /&gt;
:{{cmdroot|vbetool dpms on}}&lt;br /&gt;
You have to change to a normal console before turning the LCD off.&lt;br /&gt;
Additionally you have to deactivate the Wake-On-Lan feature like mentioned above ...&lt;br /&gt;
:{{cmdroot|ethtool -s eth0 wol d}}&lt;br /&gt;
With these commands used together the &amp;quot;testing script&amp;quot; reports no high power drain while suspending.&lt;/div&gt;</summary>
		<author><name>Runia</name></author>
		
	</entry>
</feed>