Port-macppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: smartbat hacking



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Jun 27, 2008, at 12:11, Magnus Henoch wrote:
I wanted my computer to be aware of its battery even after the sysmon
change, so I hacked on smartbat.c, taking parts from battery.c and
pm_direct.c.  The attached version compiles and seems to work.  Add

smartbat* at pmu?
options SMARTBAT_DEBUG

to your kernel configuration.

I'm not sure if all sensors work as they should yet, but I wanted to
throw this out for public view.

Thanks, I'll give it a shot later today!

About this:
        /* XXX: are these all valid for smart batteries? */
        if (out) {
                printf(" flags: %x", buf[1]);
                if (buf[2] & PMU_PWR_AC_PRESENT)
                        printf(" AC");

I'm not sure if any non-battery related bits ( like AC power ) are valid with smart batteries, I'll check if it works here and if if works for both of us there should be a good chance it works for others as well.

have fun
Michael

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQEVAwUBSGUzH8pnzkX8Yg2nAQLhTggAtKlSau317XC2ZPaKH6wzcxG7M1NigkCX
GDf1OtlAPZXgp6lOFO9FIONnq7CLiX/FidDtbPckithEu4k+UXa4VVJkGh6bzxDa
kEpCTczv2jdEDrjfhIEgF8l0/Y0OTe5mP85yH3VeXsGufx8VYfXir10Q1GLsnOb+
g8X7kpMP+/uHWPOUw/tScKWoyJiWYR6LEdcrWT/YbEmYUtOt0DiaVJVqsdNztDdn
3AD/aSN7P6y0mfm+bJTHDVlbqQlJbzMFYXSJ4TWD3W9xJZyWdj0EaJTIrxaTzrvc
N8vqnrV/aSKcsMCNJx3GeJAA8JTPcGpwa4f+/AvBWNOrMPca20hiaQ==
=E1P5
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index