neuschaefer / linux

Linux kernel source tree
Other
9 stars 2 forks source link

Netronix MSP430 - Battery Driver #1

Open Artox opened 4 years ago

Artox commented 4 years ago

The Embedded Controller provides status information about the battery. This issue collects information and code drops related to implementing a driver that can ultimately report charge level and charging status.

Artox commented 4 years ago

I have implemented a prototype driver: https://github.com/Artox/linux/commit/aa739e598b3e071a0b85d7041acb893f56532726

Working:

Nice to Have:

neuschaefer commented 3 years ago

Hello @Artox, good news! The base driver finally landed in linux-next.

A few things changed in the meantime:

If you're still interested in this driver, I'll be happy to review your patches (please let me know).

Artox commented 3 years ago

\o/

I was quietly watching the iterations of your patchset on the lists, well done! I am still interested, but it might take me up to a month before I can spend time on this again :(

So depending on your plans, you could take over my work - or wait, focus on something else etc. The biggest open questions imo are if I have modeled the battery appropriately in device-tree - especially with hard-coding capacity and voltages.

neuschaefer commented 3 years ago

There's no hurry from my end (for the near future).

About the devicetree details: I don't know. I think this is best answered by the power supply and DT experts on the mailing lists.

Artox commented 3 years ago

@neuschaefer I finally got around to adapting my work to the current multi-function driver: https://github.com/Artox/linux/commit/773c4d07a0719d9804ade2d98427bd431ebf72b4

This is feature-wise identical what I had earlier, but much boilerplate inspired by your rtc driver. I will still have to properly split dts and driver - and add documentation. But if you want to play around with, cat /sys/class/power_supply/ec-battery/uevent is used to report some static information as well as the voltage level.

Artox commented 3 years ago

added copyright header .... thanks for reminding me! https://github.com/Artox/linux/commit/bd153bf852e73de3dbc01690ac847dffbdc8fa0a

akemnade commented 3 years ago

some general comments here: if there is some guess about current,

fuel_level_LiIon() in linux/power/generic-fuel-gauge.h

can be used to get percent, if there is good information about current, registering iio channels and using generic-adc-battery on top of that might be interesting.

neuschaefer commented 2 years ago

Hi @Artox, are you still interested in bringing the battery driver upsteam?

If you have questions about the API changes in the NTXEC drivers, I'd be happy to help.