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

drivers: regulator: API to get max regulator voltage #80029

Merged
merged 3 commits into from
Oct 24, 2024

Conversation

RafaelLaya
Copy link
Contributor

There is already a regulator_common_get_min_voltage() API, to query the maximum supported voltage on a regulator. This change adds an analogous and symmetric API to query the maximum supported voltage

@RafaelLaya RafaelLaya force-pushed the get_max_voltage branch 2 times, most recently from cd1c094 to 203bdd8 Compare October 18, 2024 03:30
@RafaelLaya RafaelLaya changed the title drivers: i2c: API to get max regulator voltage drivers: regulator: API to get max regulator voltage Oct 18, 2024
@RafaelLaya
Copy link
Contributor Author

@gmarull @danieldegrasse @aasinclair Fixed title and commit message (this is on the regulator API, not i2c, but for some reason my brain made me type i2c...) Hope all the automatic tags are correct?

Copy link
Member

@gmarull gmarull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this needed/used? These are internal APIs

@RafaelLaya RafaelLaya force-pushed the get_max_voltage branch 5 times, most recently from 0a6696c to ecf18a1 Compare October 18, 2024 16:57
@RafaelLaya
Copy link
Contributor Author

RafaelLaya commented Oct 18, 2024

where is this needed/used? These are internal APIs

Good point. I've added two more commits, for a total of three:

  1. The addition of get_max_voltage()
  2. Adds unit-testing coverage for the new get_max_voltage() and for the pre-existing get_min_voltage()
  3. Linter pass on the unit tests to make sure CI is happy

Now it's used in the tests

Regarding for where this is needed:

  1. For symmetry since the get_min_voltage() internal API already exists
  2. In general it is a useful API for code interfacing with regulators, even if only used internally
  3. I've also got some uses for it but it's not ready yet (if ever) to upstream. But in any case, this is still a useful API and completes the symmetry with get_min_voltage()

Copy link
Member

@gmarull gmarull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, introduce any formatting changes in a separate commit.

There is already a get_min_voltage() API, so let us add
an API to also query the max voltage

Signed-off-by: Rafael Laya <rafael_laya97@hotmail.com.com>
Rafael Laya added 2 commits October 21, 2024 06:20
Adds unit tests to make sure get_max and get_min voltage
remain healthy

Signed-off-by: Rafael Laya <rafael_laya97@hotmail.com.com>
Linter pass makes CI happy and keeps code compliant
with the stylistic guidelines of the project

Signed-off-by: Rafael Laya <rafael_laya97@hotmail.com.com>
@RafaelLaya
Copy link
Contributor Author

please, introduce any formatting changes in a separate commit.

Good catch! I thought I had three commits. My bad, now I've actually split the changes into the three commits mentioned above

@carlescufi carlescufi merged commit 1621801 into zephyrproject-rtos:main Oct 24, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants