The following implements a battery manager driver for HP DVx laptops. There are two pieces required to make this work, the AppleACPIBatteryManager.kext (driver) and a DSDT edit.
The driver is generic and will probably work on other platforms that properly implement the _BST and _BIF methods in their DSDT. As the HP _BST method on DVx isn't (IMHO) implemented correctly, DVx owners will also have to implement the DSDT edit so that the _BST method returns proper values to the driver in order to calculate the time remaining (to charge or discharge) value.
This was tested on an HP DV8 but will likely work on any DVx model that implements a similar DSDT method. Also, I have only tested this on a 32-bit kernel, but it should work on a 64-bit kernel as the driver has been compiled to a 10.6 32/64-bit universal (FAT) binary.
There are two zip files below, a debug and release version. The debug version outputs messages to kernel.log and the release version does not, otherwise they are identical.
Step 1: DSDT Edit
In your DSDT.dsl, locate the method UPBS that should look like this:
Method (UPBS, 0, NotSerialized)
{
Store (^^PCI0.LPCB.EC0.MBRM, Local5)
If (LNot (And (Local5, 0x8000)))
{
ShiftRight (Local5, 0x05, Local5)
ShiftLeft (Local5, 0x05, Local5)
If (LNotEqual (Local5, DerefOf (Index (PBST, 0x02))))
{
If (LEqual (^^PCI0.LPCB.EC0.BACR, One))
{
Store (FABL, Index (PBST, 0x02))
}
Else
{
Store (Local5, Index (PBST, 0x02))
}
}
}
Store (^^PCI0.LPCB.EC0.MBCV, Index (PBST, 0x03))
Store (^^PCI0.LPCB.EC0.MBST, Index (PBST, Zero))
}
If your method matches the above, replace it with:
Method (UPBS, 0, NotSerialized)
{
Store (^^PCI0.LPCB.EC0.MBST, Index (PBST, Zero))
^^PCI0.LPCB.EC0.SMRD (0x09, 0x16, 0x0A, RefOf (Local0))
Store (Local0, Index (PBST, One))
^^PCI0.LPCB.EC0.SMRD (0x09, 0x16, 0x0F, RefOf (Local1))
Store (Local1, Index (PBST, 0x02))
^^PCI0.LPCB.EC0.SMRD (0x09, 0x16, 0x09, RefOf (Local2))
Store (Local2, Index (PBST, 0x03))
}
Compile it and install as usual.
Step 2: Install Driver
Install the kext in /Extra/Extensions, set the permissions and rebuild your kext cache. Reboot.