Bug 113141 - Lenovo ideapad 100s battery capacity/charge not detected
Summary: Lenovo ideapad 100s battery capacity/charge not detected
Status: CLOSED CODE_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Battery (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Lv Zheng
URL:
Keywords:
Depends on:
Blocks: 113151
  Show dependency tree
 
Reported: 2016-02-25 18:57 UTC by dan.g.tob
Modified: 2017-05-30 05:29 UTC (History)
4 users (show)

See Also:
Kernel Version: 4.5
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmidecode --dump-bin (2.02 KB, application/octet-stream)
2016-02-25 18:57 UTC, dan.g.tob
Details
dmidecode output (11.93 KB, text/plain)
2016-02-25 18:57 UTC, dan.g.tob
Details
systemd journal (114.17 KB, text/x-log)
2016-02-25 19:02 UTC, dan.g.tob
Details
upower --dump (2.39 KB, text/plain)
2016-02-25 19:05 UTC, dan.g.tob
Details
acpidump as requested (371.50 KB, text/plain)
2016-02-29 03:27 UTC, dan.g.tob
Details
sysfs info (1.55 KB, text/plain)
2016-02-29 03:28 UTC, dan.g.tob
Details
sysfs power_supply (3.12 KB, text/plain)
2017-03-13 09:38 UTC, dan.g.tob
Details
sysfs power_supply (3.12 KB, text/plain)
2017-03-13 09:39 UTC, dan.g.tob
Details

Description dan.g.tob 2016-02-25 18:57:10 UTC
Created attachment 206071 [details]
dmidecode --dump-bin

ls /sys/class/power_supply/
ADP1  BMBT

dmidecode give me this info

Handle 0x001A, DMI type 22, 26 bytes
Portable Battery
	Location: I2C2
	Manufacturer: Intel SR 1
	Manufacture Date: Date
	Serial Number: 123456789
	Name: SR Real Battery
	Chemistry: Lithium Ion
	Design Capacity: 0 mWh
	Design Voltage: 3750 mV
	SBDS Version: CRB Battery 0
	Maximum Error: Unknown
	OEM-specific Information: 0x00000000

Handle 0x001F, DMI type 39, 22 bytes
System Power Supply
	Location: OEM_Define0
	Name: OEM_Define1
	Manufacturer: OEM_Define2
	Serial Number: OEM_Define3
	Asset Tag: OEM_Define4
	Model Part Number: OEM_Define5
	Revision: OEM_Define6
	Max Power Capacity: 42 W
	Status: Present, OK
	Type: Regulator
	Input Voltage Range Switching: Auto-switch
	Plugged: No
	Hot Replaceable: No
	Input Voltage Probe Handle: 0x001C
Comment 1 dan.g.tob 2016-02-25 18:57:43 UTC
Created attachment 206081 [details]
dmidecode output
Comment 2 dan.g.tob 2016-02-25 19:02:02 UTC
Created attachment 206091 [details]
systemd journal
Comment 3 dan.g.tob 2016-02-25 19:05:59 UTC
Created attachment 206101 [details]
upower --dump
Comment 4 Zhang Rui 2016-02-29 02:31:15 UTC
please attach the output of acpidump.
Comment 5 Zhang Rui 2016-02-29 02:32:14 UTC
isn't /sys/class/power_supply/BMBT the battery device?
Comment 6 dan.g.tob 2016-02-29 03:27:17 UTC
Created attachment 206361 [details]
acpidump as requested
Comment 7 dan.g.tob 2016-02-29 03:28:56 UTC
Created attachment 206371 [details]
sysfs info

(In reply to Zhang Rui from comment #5)
> isn't /sys/class/power_supply/BMBT the battery device?

You appear to be correct, but it doesn't seem to report capacity
Comment 8 Zhang Rui 2016-03-15 08:22:35 UTC
is this a launched product?
because things like
cat /sys/class/power_supply/BMBT/serial_number
123456789
and
Handle 0x001F, DMI type 39, 22 bytes
System Power Supply
	Location: OEM_Define0
	Name: OEM_Define1
	Manufacturer: OEM_Define2
	Serial Number: OEM_Define3
	Asset Tag: OEM_Define4
	Model Part Number: OEM_Define5
	Revision: OEM_Define6
suggests that this laptop is running on some BIOS that is not for a product.

The battery issue is probably firmware related, and it's not worth debugging before the BIOS has been fixed first.
Please feel free to reopen it after the BIOS has been upgraded to a reasonable one. :)
Comment 9 dan.g.tob 2016-03-16 01:19:34 UTC
Definitely a production device that was bought from a retail store. BIOS E2CN13WW is the latest available and they don't seem to offer older versions for download. I've sent Lenovo a support email. Hopefully they'll sort it out soon. Thanks for looking into this.
Comment 10 Jan Schmidt 2016-05-06 16:44:41 UTC
Just a note, until/if Lenovo come back. With BIOS E2CN13WW, I get 

Handle 0x001A, DMI type 22, 26 bytes
Portable Battery
        Location: I2C2
        Manufacturer: Intel SR 1
        Manufacture Date: Date
        Serial Number: 123456789
        Name: SR Real Battery
        Chemistry: Lithium Ion
        Design Capacity: 0 mWh
        Design Voltage: 3750 mV
        SBDS Version: CRB Battery 0
        Maximum Error: Unknown
        OEM-specific Information: 0x00000000

even though they seem to have made some effort to edit the identifiers between E2CN11WW and E2CN13WW (my laptop came with the former).

In the DSDT the 'Intel SR 1' / 'SR Real Battery' is in the BIXP info for the BATC device. BMBT has a BIXP with:

            Name (BIXP, Package (0x14)
            {
                Zero, 
                One, 
                0xFFFFFFFF, 
                0xFFFFFFFF, 
                One, 
                0xFFFFFFFF, 
                0x0A, 
                0x04, 
                Zero, 
                0x00017318, 
                0xFFFFFFFF, 
                0xFFFFFFFF, 
                0x88B8, 
                0x61A8, 
                One, 
                One, 
                "NB116 1|CP4/58/145-2", 
                "123456789", 
                "LION", 
                "SUNWODA"
            })
Comment 11 dan.g.tob 2016-05-17 06:09:47 UTC
I was not able to properly get on to lenovo. First message I sent they told me they weren't trained to answer linux questions.. I tried multiple times again and could not get their web form to submit. Pretty average system and limited to 200 characters. Maybe you will have better luck in your region?
Comment 12 dan.g.tob 2016-08-30 22:47:14 UTC
After pulling my machine apart, I've determined that battery capacity is 8400mAh and voltage is 3.8v.

Design capacity should be 0x20D0 = 8400 mAh
Design voltage should be  0x0ED8 = 3800 mV (3.8v)

Design capacity of Warning seems wrong, so maybe 25% 0f 8400mAh 2100(0x0834)
Design Capacity of Low also seems wrong, so maybe 10% 0f 8400mAh 840(0x0348)

            Name (BIXP, Package (0x14)
            {
                Zero, 			/* Revision */
                One, 			/* Power Unit */
                0x000020D0, 		/* Design Capacity */
                0xFFFFFFFF, 		/* Last Full Charge Capacity */
                One, 			/* Battery Technology */
                0x00000ED8, 		/* Design Voltage */	     
                0x0834, 		/* Design capacity of Warning */
                0x0348, 		/* Design Capacity of Low */
                Zero, 			/* Cycle Count */
                0x00017318, 		/* Measurement Accuracy */		
                0xFFFFFFFF, 		/* Max Sampling Time */
                0xFFFFFFFF, 		/* Min Sampling Time */
                0x88B8, 		/* Max Averaging Interval */
                0x61A8, 		/* Min Averaging Interval */
                One, 			/* Battery Capacity Granularity 1 */
                One, 			/* Battery Capacity Granularity 2 */
                "NB116 1|CP4/58/145-2", /* Model Number */
                "123456789", 		/* Serial Number */
                "LION", 		/* Battery Type */
                "SUNWODA"		/* OEM Information */
            })

For whatever reason BIXP seems to be defined 3 times, so I just replaced all with the same. But still no change unfortunately.
Comment 13 dan.g.tob 2017-03-07 12:47:40 UTC
This is somewhat working now with 4.11rc1, axp288 is autoloaded now and I can see capacity/remaining charge etc.

Whats odd is that I now have 2 battery devices show up under the gnome power panel. Main is I guess the old acpi battery device that reports incorrectly. Extra is the new device thats managed by axp288 and reports correctly. Is it possible to blacklist the bad device?
Comment 14 Zhang Rui 2017-03-13 05:40:01 UTC
please attach the output of "grep . /sys/class/power_supply/*/*"
Comment 15 dan.g.tob 2017-03-13 09:38:25 UTC
Created attachment 255209 [details]
sysfs power_supply

charger unnplugged
Comment 16 dan.g.tob 2017-03-13 09:39:06 UTC
Created attachment 255211 [details]
sysfs power_supply

charger plugged
Comment 17 dan.g.tob 2017-03-20 13:03:32 UTC
Looks like there is a fix for this in progress

https://patchwork.kernel.org/patch/9628869/
https://patchwork.kernel.org/patch/9628873/
Comment 18 Zhang Rui 2017-03-27 03:16:47 UTC
great.

Bug marked as resolved.
And it will be closed once the patch mentioned above is merged in upstream kernel.
Comment 19 b.peguero 2017-04-05 17:25:29 UTC
What CONFIG_ are necessary for this module? I have axp288_* built as modules, but I can't find it in my modules directory find /lib/modules/4.11.0-rc5 | grep axp.

Note You need to log in before you can comment on or make changes to this bug.