Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Battery module support for rk817 #1495

Merged
merged 1 commit into from
Apr 5, 2022
Merged

Battery module support for rk817 #1495

merged 1 commit into from
Apr 5, 2022

Conversation

0cc4m
Copy link
Contributor

@0cc4m 0cc4m commented Mar 28, 2022

I have a device with a battery driver that is not currently supported by your battery module. A PineNote with a Rockchip RK817 battery controller. The driver is not upstreamed yet, but I think the changes are generic enough for this not to matter.

» ls /sys/class/power_supply/rk817-battery/
charge_empty_design  charge_full_design  charge_type                  constant_charge_voltage_max  current_boot  hwmon0  present  subsystem  uevent       voltage_boot        voltage_min_design  wakeup4
charge_full          charge_now          constant_charge_current_max  current_avg                  device        power   status   type       voltage_avg  voltage_max_design  voltage_ocv

It does not have a capacity, so it fails the initial check, and it does not have current_now or voltage_now.
I added charge_now to the initial file check, since capacity is only needed if charge_now doesn't exist.
I also added a check whether current_now or voltage_now exist, and if not attempt to read current_avg and voltage_avg

Please let me know what you think.

@Alexays
Copy link
Owner

Alexays commented Apr 5, 2022

Thx!

@Alexays Alexays merged commit d5b76bd into Alexays:master Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants