Editing Bme replacement
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 14: | Line 14: | ||
.debs are available from: | .debs are available from: | ||
- | + | https://atrey.karlin.mff.cuni.cz/~pali/rx51-bme-replacement/ | |
- | + | (might need to ignore expired certificate) | |
It works for everyday usage, but some major problems were found, see below. | It works for everyday usage, but some major problems were found, see below. | ||
- | |||
- | |||
- | |||
- | |||
=Problems/bugs and proposed solutions= | =Problems/bugs and proposed solutions= | ||
Line 32: | Line 28: | ||
'''1. gconf value''', that allow power users to change voltage, at which device shutdowns to any arbitrary value. | '''1. gconf value''', that allow power users to change voltage, at which device shutdowns to any arbitrary value. | ||
- | This is | + | This is preffered solution, as some devices are more like to have problems with GSM chip restarting at low voltage, even around '''EDV1''' 3248 mV. People with such problems, that preffer GSM stability over calibration, could bump voltage treeshold, to avoid problems. OTOH, people with less picky devices and/or dual-cell setups, could decrease limit, getting more from their batteries. |
- | This method can be also augmented by solution 2, for "default" shutdown | + | This method can be also augmented by solution 2, for "default" shutdown treeshold. |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
--- | --- | ||
Line 46: | Line 38: | ||
'''EDV1''' flag can be read from ''/sys/class/power_supply/bq24150a-0/registers'' address 0x55 0x0A, divided by 2. | '''EDV1''' flag can be read from ''/sys/class/power_supply/bq24150a-0/registers'' address 0x55 0x0A, divided by 2. | ||
- | '''2.a''' In case of '''EDV1''' flag being not available'''*''', fallback to using 3150 mV as shutdown | + | '''2.a''' In case of '''EDV1''' flag being not available'''*''', fallback to using 3150 mV as shutdown treeshold. Rationale: 3150 mV shouldn't cause GSM chip restarts on devices, where 3248 mV haven't caused it already. |
It doesn't guarantee calibration, as it require 15 seconds *straight* below 3248 mV (EDV1 voltage), and 3150 mV might be just momentary low voltage spike. But, it is better than current implementation, which permits calibration *ever* - and, after all, it is just theoretical fallback for hyphotetical, non-existing kernel. | It doesn't guarantee calibration, as it require 15 seconds *straight* below 3248 mV (EDV1 voltage), and 3150 mV might be just momentary low voltage spike. But, it is better than current implementation, which permits calibration *ever* - and, after all, it is just theoretical fallback for hyphotetical, non-existing kernel. | ||
Line 65: | Line 57: | ||
[14:17] <kerio> 4) bq27200 is our lord, bq27200 is our ruler, bq27200 is our saviour - when calibrated, /everything/ should be grabbed from bq27200 and that's it - percentages, capacity (when full and at the moment) | [14:17] <kerio> 4) bq27200 is our lord, bq27200 is our ruler, bq27200 is our saviour - when calibrated, /everything/ should be grabbed from bq27200 and that's it - percentages, capacity (when full and at the moment) | ||
- | * Pali: add gconf value (int) for using maximal (design) capacity from rx51_battery | + | * Pali: add gconf value (int) for using maximal (design) capacity from rx51_battery. 0 - never, 1 - when not calibrated, 2 - always. Default value 1. TODO: hald-addon-bme must always report some value for design capacity. So what to show for gconf value 0? |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
==3. bq27x00_battery sysfs node reports -ENODATA when not calibrated== | ==3. bq27x00_battery sysfs node reports -ENODATA when not calibrated== | ||
Line 87: | Line 74: | ||
* Pali: ...all scripts/programs that depends on those sysfsnodes breaks, due to "data read error". ... - bug in programs open/read syscall could fail and set some errno value (see manpages for read and open) | * Pali: ...all scripts/programs that depends on those sysfsnodes breaks, due to "data read error". ... - bug in programs open/read syscall could fail and set some errno value (see manpages for read and open) | ||
- | * Pali: I do not want to touch kernel drivers in maemo 2.6.28 kernel - this is very old version. Also "registers" sysfs entry is deprecated and is not upstreamed. In upstream kernel there is "regmap" api for exporting all needed registers to userspace, but there is no patch yet... See https://lkml.org/lkml/2013/1/19/162 Problem that userspace application cannot read battery i2c registers directly can be fixed with flag I2C_SLAVE_FORCE see: https://lkml.org/lkml/2013/ | + | * Pali: I do not want to touch kernel drivers in maemo 2.6.28 kernel - this is very old version. Also "registers" sysfs entry is deprecated and is not upstreamed. In upstream kernel there is "regmap" api for exporting all needed registers to userspace, but there is no patch yet... See https://lkml.org/lkml/2013/1/19/162 Problem that userspace application cannot read battery i2c registers directly can be fixed with flag I2C_SLAVE_FORCE see: https://lkml.org/lkml/2013/1/20/20 |
- | + | ||
- | + | ||
- | + | ||
* Pali: question what should power supply function return to power supply interface when data are/could be incorrect is for power supply kernel maintainer. TODO: add link for mailinglist (lkml) discussion about it. | * Pali: question what should power supply function return to power supply interface when data are/could be incorrect is for power supply kernel maintainer. TODO: add link for mailinglist (lkml) discussion about it. | ||
* Proposal from Kerio on this: hald-addon-bme should provide a way to know if bq27k is calibrated or not, and the battery applet should show a "(CI)" whenever it's not; battery.reporting.design should always come from rx51-battery, other data should always come from bq27k (with the implicit message that if it's uncalibrated, it might be inaccurate); the battery applet should have three modes: a mode where it does *the same thing as stock*, without showing anything at all (default for CSSU stable maybe?), a mode (default on CSSU testing, maybe?) where it prefers to calculate against the battery design reported by rx51-battery, and a mode where it calculates against the last full charge as reported by bq27k, regardless of calibration (but showing the CI indicator next to the charge/full charge report) | * Proposal from Kerio on this: hald-addon-bme should provide a way to know if bq27k is calibrated or not, and the battery applet should show a "(CI)" whenever it's not; battery.reporting.design should always come from rx51-battery, other data should always come from bq27k (with the implicit message that if it's uncalibrated, it might be inaccurate); the battery applet should have three modes: a mode where it does *the same thing as stock*, without showing anything at all (default for CSSU stable maybe?), a mode (default on CSSU testing, maybe?) where it prefers to calculate against the battery design reported by rx51-battery, and a mode where it calculates against the last full charge as reported by bq27k, regardless of calibration (but showing the CI indicator next to the charge/full charge report) | ||
- | |||
- | |||
- |
Learn more about Contributing to the wiki.