[gpm] tp_smapi does not report status correctly when using battery charge control features



On Mon, Jul 6, 2009 at 4:04 PM, Richard Hughes<hughsient gmail com> wrote:
> 2009/7/6 Darren Hoo <darren hoo gmail com>:
>> I've got a thinkpad T60 and have battery charge control features enabled:
>>    # echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
>>    # echo 100 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
>> upon this setup,when the battery  capacity is about say 80% and AC power
>> is on, the battery is in a state of   not charging nor fully charged.thus
>> g-p-m applet shows an warning icon.This is not as g-p-m 2.24 has worked.
>>
>> line 131 of  src/gpm-devicekit.c says:
>>                } else if (state == DKP_DEVICE_STATE_UNKNOWN && percentage > 95.0f) {
>>                        egg_warning ("fixing up unknown %f", percentage);
>>                        filename = g_strdup_printf ("gpm-%s-charged", prefix);
>>
>> I think here the percentage > 95.0f  here is too strict and unnecessary.
>
> Well, the battery state is unknown, so g-p-m can't really do anything
> sensible here. I think part of the problem is that ACPI exposes two
> values, is_charging and is_discharging, and so it's tricky to map them
> to a sane number of states.
>
> What's the value of state in the correct device in
> /sys/class/power_supply? If this is fixed in the kernel, it'll just
> work in g-p-m. Just lowering the threshold is not a good idea at all,
> and I'll probably remove that hack from g-p-m altogether.
>
Hi,Richard and tp_smapi developers,
Thanks,

$ cat /sys/class/power_supply/BAT0/status
Unknown

So the status is unknown.The kernel module I use is tp_smapi which is
not in the  mainstream kernel yet .
If you don't mind I've cc'ed this mail to tm_smapi developer's mailing-list.
I would like to see what are their  opinions on this.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]