Closed mwallnoefer closed 4 years ago
pmic_ccsm driver will never be upstreamed, So, if battery service at some point will be revived, it will be (completely?) different approach. So, I would go further and remove this from distribution for time being.
afaikt all this service does is get the battery voltage and print it. So now, from bcove_adc we get
cat /sys/bus/platform/drivers/mrfld_bcove_adc/mrfld_bcove_adc/iio:device0/in_voltage0_raw
returns 988, which probably corresponds to 988 / 1024 * 4.5 = 4.34V.
So, what does pmic_ccsm do extra?
afaikt all this service does is get the battery voltage and print it. So now, from bcove_adc we get
cat /sys/bus/platform/drivers/mrfld_bcove_adc/mrfld_bcove_adc/iio:device0/in_voltage0_raw
returns 988, which probably corresponds to 988 / 1024 * 4.5 = 4.34V.
Yes, monitoring (PMIC ADC) works...
So, what does pmic_ccsm do extra?
...charging is not.
Sorry for the confusion, because I didn't quite get what is that service for.
Sorry for the confusion, because I didn't quite get what is that service for.
Neither do I. It seems to print battery status to syslog? But why?
Anyway I fixed it, useless as it seems. Will appear initially in https://github.com/htot/meta-intel-edison/tree/zeus
I saw this in every boot log.
[FAILED] Failed to start Battery Voltage daemon. See 'systemctl status battery-voltage.service' for details.
root@edison:~# systemctl status battery-voltage.service ● battery-voltage.service - Battery Voltage daemon Loaded: loaded (/lib/systemd/system/battery-voltage.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2020-02-15 17:20:10 UTC; 8min ago Process: 639 ExecStart=/usr/bin/battery-voltage (code=exited, status=255/EXCEPTION) Main PID: 639 (code=exited, status=255/EXCEPTION) Feb 15 17:20:10 edison systemd[1]: battery-voltage.service: Service RestartSec=100ms expired, scheduling restart. Feb 15 17:20:10 edison systemd[1]: battery-voltage.service: Scheduled restart job, restart counter is at 5. Feb 15 17:20:10 edison systemd[1]: Stopped Battery Voltage daemon. Feb 15 17:20:10 edison systemd[1]: battery-voltage.service: Start request repeated too quickly. Feb 15 17:20:10 edison systemd[1]: battery-voltage.service: Failed with result 'exit-code'. Feb 15 17:20:10 edison systemd[1]: Failed to start Battery Voltage daemon.
So, charging actually works on Sparkfun Battery block and on Edison/Arduino according to the data sheets of certain discrete components. The idea behind the service is probably to shutdown correctly the machine, or do something else.
Okay, I investigated battery level mechanism. It seems that the above service just prints it in human readable format, while the formula is indeed (x) * 450 / 1024 = Battery Level in centivolts
(pmic_get_battery_voltage()
in the stock kernel sources), where (x)
is the 16-bit value from Channel 0, i.e. VBATRSLT
. So, this service is doubtfully needed.
Thus, I think removal is the best option to avoid user confusion.
May only be re-enabled if the pmic_ccsm service gets restored (consider battery-voltage/battery-voltage/battery-voltage.c).