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

hx20: CHG_LIMIT_GET_LIMIT disables charge override #6

Closed
DHowett opened this issue Jan 23, 2022 · 0 comments · Fixed by #7
Closed

hx20: CHG_LIMIT_GET_LIMIT disables charge override #6

DHowett opened this issue Jan 23, 2022 · 0 comments · Fixed by #7

Comments

@DHowett
Copy link
Contributor

DHowett commented Jan 23, 2022

Querying the charge limit with host command CHARGE_LIMIT_CONTROL mode CHG_LIMIT_GET_LIMIT reloads the charge limit from bbram, which overwrites the CHG_LIMIT_OVERRIDE flag.

Flag is set here (and not stored to bbram, because it is a one-time override):

if (p->modes & CHG_LIMIT_OVERRIDE)
charging_maximum_level = charging_maximum_level | CHG_LIMIT_OVERRIDE;

and cleared when we read into charging_maximum_level here:

if (p->modes & CHG_LIMIT_GET_LIMIT) {
system_get_bbram(SYSTEM_BBRAM_IDX_CHG_MAX, &charging_maximum_level);

DHowett added a commit to DHowett/framework-ec that referenced this issue Jan 23, 2022
@DHowett DHowett changed the title CHG_LIMIT_GET_LIMIT disables charge override hx20: CHG_LIMIT_GET_LIMIT disables charge override Jun 10, 2022
@kiram9 kiram9 closed this as completed in #7 May 26, 2023
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 a pull request may close this issue.

1 participant