Difference between revisions of "Ultrabay 2000 Battery"

From ThinkWiki
Jump to: navigation, search
m (Linux Support)
(Linux Support)
Line 28: Line 28:
 
We need to find a way of telling the ACPI subsystem to rescan for batteries.
 
We need to find a way of telling the ACPI subsystem to rescan for batteries.
  
With kernel 2.6.14.2 (possibly only with IBM_ACPI) there is a sysfs file: /sys/firmware/acpi/namespace/ACPI/_SB/PCI0/LPC/EC/BAT1/eject. There isn't one for BAT0, but then /proc/acpi/battery/BAT0/* shows "not present" when there is no battery. For BAT1 all the states go to 0, critical, etc. "echo 1 > /sys/firmware/acpi/namespace/ACPI/_SB/PCI0/LPC/EC/BAT1/eject" will remove /proc/acpi/battery/BAT1 and turn off the ultrabay light. Interestingly the battery will still be discharging (charging not tested) until it is physically removed.
+
With kernel 2.6.14.2 (possibly only with [[ibm-acpi]]) there is a sysfs file: {{path|/sys/firmware/acpi/namespace/ACPI/_SB/PCI0/LPC/EC/BAT1/eject}}. There isn't one for BAT0, but {{cmdroot|cat /proc/acpi/battery/BAT0/*}} shows {{cmdresult|not present}} when there is no internal battery.  
  
Also, if you compile the battery module of ACPI as a module, boot with the ultrabay battery present, remove the ultrabay battery (without doing the eject above), /proc/acpi/battery/BAT1 is still there, rmmod battery, modprobe battery, /proc/acpi/battery/BAT1 is gone (BAT0 is back), put the battery back in, /proc/acpi/battery/BAT1 still missing, rmmod battery, modprobe battery, /proc/acpi/battery/BAT1 is back.
+
For BAT1 all the states go to 0, critical, etc. .
If you boot without the second battery BAT1 never shows up.
+
 
If you eject using the sysfs file above, BAT1 disappears from both /proc and /sys and never comes back.
+
{{cmdroot|echo 1 > /sys/firmware/acpi/namespace/ACPI/_SB/PCI0/LPC/EC/BAT1/eject}} will remove {{path|/proc/acpi/battery/BAT1}} and turn off the UltraBay led. Interestingly the battery will still be discharging (charging not tested) until it is physically removed.
 +
 
 +
Also, if you compile the battery module of ACPI as a module, boot with the UltraBay battery present, remove the UltraBay battery (without doing the eject above), {{path|/proc/acpi/battery/BAT1}} is still there, while after {{cmdroot|rmmod battery && modprobe battery}} {{path|/proc/acpi/battery/BAT1}} is gone (BAT0 is back). Put the battery back in and {{path|/proc/acpi/battery/BAT1}} is still missing, do {{cmdroot|rmmod battery && modprobe battery}} and {{path|/proc/acpi/battery/BAT1}} is back.
 +
 
 +
If you boot without the second battery {{path|/proc/acpi/battery/BAT1}} never shows up.
 +
 
 +
If you eject using the sysfs file above, <tt>BAT1</tt> disappears from both {{path|/proc}} and {{path|/sys}} and never comes back.
  
 
Test machine: T23.
 
Test machine: T23.

Revision as of 20:23, 3 January 2006

UltraBay 2000 Battery

This is a battery that slides into a supported UltraBay 2000.

Features

  • 10.8V Lithium-Ion
  • 9 cells
  • Up to 3 hours of battery life
  • Weight: 268g (0.59 lbs)
  • Charge time: 2.0 h

UltraBay 2000 Battery

IBM Partnumbers

  • Marketing PN: 02K6646
  • FRU PN: 02K6645

Linux Support

The second battery is correctly detected by either the APM or ACPI subsystem.

However, the Linux ACPI subsystem only scans for batteries on boot. This means that the second battery must be present at boot time, or you will not be able to get any info for it.

We need to find a way of telling the ACPI subsystem to rescan for batteries.

With kernel 2.6.14.2 (possibly only with ibm-acpi) there is a sysfs file: /sys/firmware/acpi/namespace/ACPI/_SB/PCI0/LPC/EC/BAT1/eject. There isn't one for BAT0, but # cat /proc/acpi/battery/BAT0/* shows not present when there is no internal battery.

For BAT1 all the states go to 0, critical, etc. .

# echo 1 > /sys/firmware/acpi/namespace/ACPI/_SB/PCI0/LPC/EC/BAT1/eject will remove /proc/acpi/battery/BAT1 and turn off the UltraBay led. Interestingly the battery will still be discharging (charging not tested) until it is physically removed.

Also, if you compile the battery module of ACPI as a module, boot with the UltraBay battery present, remove the UltraBay battery (without doing the eject above), /proc/acpi/battery/BAT1 is still there, while after # rmmod battery && modprobe battery /proc/acpi/battery/BAT1 is gone (BAT0 is back). Put the battery back in and /proc/acpi/battery/BAT1 is still missing, do # rmmod battery && modprobe battery and /proc/acpi/battery/BAT1 is back.

If you boot without the second battery /proc/acpi/battery/BAT1 never shows up.

If you eject using the sysfs file above, BAT1 disappears from both /proc and /sys and never comes back.

Test machine: T23.

The battery status should also be accessible via tp_smapi, independently of the ACPI system.
Help needed
Please report if tp_smapi support for the second battery indeed works.

Supported with