[ltp] Re: Battery charging control ?

linux-thinkpad@linux-thinkpad.org linux-thinkpad@linux-thinkpad.org
Wed, 28 Sep 2005 13:57:38 +0300


Hi,

BATINFEX.DLL is just some part of the user interface. The SM_* functions
are implemented in TPPWRW32.DLL, also part of Battery MaxiMiser.

Inside that DLL, one of the things SM_SetChargeCapacityThreshold does is
to call DeviceIoControl (with dwIoControlCode=80013F18h and 52-byte
buffers). I don't know which device driver ends up handling this.

By the "SM_" prefix I'd guess that it's talking to something (the
embedded controller?) over the SMBus. Maybe the protocols conforms to
one of the Smart Battery specifications
(http://www.sbs-forum.org/specs/), though I doubt it.

Note that there's no standard ACPI method for this functionality, and in
the DSDT I don't see any obvious non-standard method either.

Reverse-engineering this could be quite inconvenient. Any chance of
getting IBM to provide the specs?



> Hi,
> Yes, just checked with 1.30 driver on T42 and I can confirm that there
> is such
> functionality as changing charge thresholds & maximum charge value
> (defaults are 96% & 100%).
> .
> I'm not sure however how this is done. Through SMAPI?
> $strings batinfex.dll |grep -i sm_
>     SM_GetSMAPIInfo
>     SM_IsOptionalFunctionSupported
>     SM_IsSmartBatteryInstalled
>     SM_GetSmartBatteryStatus
>     SM_IsPowerModeChanged
>     SM_IsBatteryStatusChanged
>     _SM_UpdateCalcCounter@4
>     SM_CheckResumeStatus
>     SM_CheckDischargePossibility
>     SM_StartDischarging
>     SM_StopDischarging
>     SM_GetACDischargeStatus
>     SM_GetBatteryHealthStatus
>     SM_GetBatteryCondition
>     SM_GetInhibitChargeStatus
>     SM_SetInhibitChargeStatus
>     SM_GetChargeCapacityThreshold
>     SM_SetChargeCapacityThreshold
>     SM_GetDischargeStatus
>     SM_SetDischargeStatus
> .
> BRGDS,
> Eriks
> 
> 
> Jerome Poggi wrote:
> 
>> On Wed, 27 Jul 2005, Paul RIVIER wrote:
>> [...]
>>
>>> Someone told me that windows can do this, but I don't have windows to
>>> check by myself.
>>
>>
>>
>> I can confirm, but the last version of the windows driver is not
>> available on IBM site. The version, that can do this deep discharge, is
>> verion 0.30 and I can find only version 0.26.
>>
>> I try the program (integrated in power manager driver) and it can do
>> some deep charge and discharge, but on the old battery, that I would
>> "regenerate" I didn't see any progress, it still only 5 minutes of
>> battery :-(
>>
>>
>>> Do you know if it is possible and how please ? should I inspect
>>> ecdumps ?
>>> My laptop is a T42.
>>
>>
>>
>> I think, that the power supply hardware is manageable, but i never see
>> it on IBM site.
>>
>> Jerome.
>>
>> -- 
>> Jerome POGGI                                     Jerome.Poggi@hsc.fr
>> Herve Schauer Consultants   -=-   Network security consultant, CISSP
>> http://www.hsc.fr/                             Tel : +33 141 409 700
> 
>