rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/2] Add a bare-minimum Regulator abstraction
@ 2025-07-04 18:43 Daniel Almeida
  2025-07-04 18:43 ` [PATCH v7 1/2] rust: regulator: add a bare minimum regulator abstraction Daniel Almeida
  2025-07-04 18:43 ` [PATCH v7 2/2] MAINAINTERS: add regulator.rs to the regulator API entry Daniel Almeida
  0 siblings, 2 replies; 7+ messages in thread
From: Daniel Almeida @ 2025-07-04 18:43 UTC (permalink / raw)
  To: Miguel Ojeda, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, Boris Brezillon, Sebastian Reichel,
	Liam Girdwood, Mark Brown, Benno Lossin
  Cc: linux-kernel, rust-for-linux, Daniel Almeida


---
Changes in v7:
- Add RegulatorState::DISABLE_ON_DROP (Alice)
- Remove #[cfg(CONFIG_REGULATOR)] in lib.rs (if this is N we will use
  the stubs)
- Add the bound on 'static directly on RegulatorState to avoid
  repetition
- Removed the `data` member on the example (Alice)
- Removed the `mut` token from try_into_enabled() and
  try_into_disabled() (Miguel & Intel bot)
- Link to v6: https://lore.kernel.org/r/20250627-topics-tyr-regulator-v6-0-1d015219b454@collabora.com

Changes in v6:
- Use ManuallyDrop<T> to avoid running the destructor in
  try_into_enabled() and try_into_disabled(). This is the same strategy
  that was being used successfully in the pre-typestate version of this
  patch
- Link to v5: https://lore.kernel.org/r/20250623-topics-tyr-regulator-v5-0-99069658cb54@collabora.com

Changes in v5:
- Remove TryIntoEnabled and TryIntoDisabled traits (they were only
  implemented for a single type anyways)
- Added regulator.rs to VOLTAGE AND CURRENT REGULATOR FRAMEWORK
- Applied the diff from Miguel Ojeda to format the docs
- Link to v4: https://lore.kernel.org/r/20250609-topics-tyr-regulator-v4-1-b4fdcf1385a7@collabora.com

Changes in v4:
- Rewrote the abstraction to use typestates as per the suggestions by
  Benno and Alex.
- Introduced the `Dynamic` state.
- Added more examples.
- Fixed some broken docs.
- Link to v3: https://lore.kernel.org/r/20250513-topics-tyr-regulator-v3-1-4cc2704dfec6@collabora.com

Changes in v3:
- Rebased on rust-next
- Added examples to showcase the API
- Fixed some rendering issues in the docs
- Exposed {get|set}_voltage for both Regulator and EnabledRegulator
- Derived Clone, Copy, PartialEq and Eq for Microvolt
- Link to v2: https://lore.kernel.org/r/20250326-topics-tyr-regulator-v2-1-c0ea6a861be6@collabora.com

Resend v2:
  - cc Regulator maintainers
Changes from v1:
  - Rebased on rust-next
  - Split the design into two types as suggested by Alice Ryhl.
  - Modify the docs to highlight how users can use kernel::types::Either
    or an enum to enable and disable the regulator at runtime.
  - Link to v1: https://lore.kernel.org/rust-for-linux/20250219162517.278362-1-daniel.almeida@collabora.com/

---
Daniel Almeida (2):
      rust: regulator: add a bare minimum regulator abstraction
      MAINAINTERS: add regulator.rs to the regulator API entry

 MAINTAINERS                     |   1 +
 rust/bindings/bindings_helper.h |   1 +
 rust/kernel/lib.rs              |   1 +
 rust/kernel/regulator.rs        | 403 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 406 insertions(+)
---
base-commit: 2009a2d5696944d85c34d75e691a6f3884e787c0
change-id: 20250326-topics-tyr-regulator-e8b98f6860d7

Best regards,
-- 
Daniel Almeida <daniel.almeida@collabora.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-07 16:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-04 18:43 [PATCH v7 0/2] Add a bare-minimum Regulator abstraction Daniel Almeida
2025-07-04 18:43 ` [PATCH v7 1/2] rust: regulator: add a bare minimum regulator abstraction Daniel Almeida
2025-07-06  0:39   ` kernel test robot
2025-07-07 16:23     ` Daniel Almeida
2025-07-07  5:39   ` Alexandre Courbot
2025-07-04 18:43 ` [PATCH v7 2/2] MAINAINTERS: add regulator.rs to the regulator API entry Daniel Almeida
2025-07-07  5:39   ` Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).