-
Notifications
You must be signed in to change notification settings - Fork 0
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
Creates Charging Subsystem #2
Conversation
801f60c
to
bf71ab9
Compare
Add initial charger driver API with the most basic of native_posix driver tests. Signed-off-by: Ricardo Rivera-Matos <[email protected]>
Currently charger drivers use the Sensor API. Which allows for reading specific data channels, setting properties, and getting events. It seems like this has only a method to get property values. Is this really any different than what is done now with sensor channels? There doesn't appear to be any way to get notified of events. Change state changing, error conditions, etc. |
Hey @xyzzy42, the MVP here is to port the Linux sbs_charger and create a dedicated charging API. I kept it as small as possible for the eventual upstream PR and only introduced the charging API props that would be used by the sbs_charger. Once the basic API is upstreamed, subsequent PRs for more feature rich charging ICs would grow the API. The charging API is intended to pair with the recently upstream fuel gauge API to create a complete power supply subsystem in Zephyr as is done in Linux. (zephyrproject-rtos#44847) I couldn't find an example of a charging IC driver in the sensor subsystem, but I could find a couple of fuel gauge ICs (max17055, max17262, bq247xx). Could you share the charging IC driver you are referring to? |
I wrote a BQ25180 driver using the Sensor API. Which supports more controls than those here and also supports charging events. While existing drivers aren't really chargers, they end up sharing some of the same fields as chargers. I don't quite see the point of making a new API that is just a subset of an existing one and solves no problems, just to say there is a new API. New APIs add complexity and more code. There should be a problem statement. Existing methods have these limitations. And then the proposed method should then solve those limitations. |
The BQ25180 is a very simple charging IC aimed at IoT and wearables, so I agree that the added complexity would probably not benefit that application and would be well served by the sensor API. |
@xyzzy42, this discussion wrt to Zephyr architecture is valuable and I would hate for it to get lost on our Cirrus Zephyr OS fork. I will put together an RFC on zephyrproject/zephyr and share the link with you here once it is available. |
@xyzzy42, here is the RFC: zephyrproject-rtos#56635 |
Adds a sample sbs charger driver and basics tests. Signed-off-by: Ricardo Rivera-Matos <[email protected]>
Adds a short stub doc as a placeholder for future documentation in the charger API. Signed-off-by: Ricardo Rivera-Matos <[email protected]>
Moving discussion to zephyrproject-rtos#56666 |
Adds a charging subsystem to the Zephyr kernel akin to the fuel gauge subsystem. Introduces a sample sbs charger driver with basic testing framework.