Skip to contentSkip to conversation

Documentation: add a driver API doc for the power sequencing subsystem

PATCH Superseded Bartosz Golaszewski 2 participants 5 messages Aug 20, 2024 – Aug 21, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: add a driver API doc for the power sequencing subsystem

From: Bartosz Golaszewski <[email protected]>

Describe what the subsystem does, how the consumers and providers work and add API reference generated from kerneldocs.

---
 Documentation/driver-api/index.rst  |  1 +
 Documentation/driver-api/pwrseq.rst | 98 +++++++++++++++++++++++++++++
 MAINTAINERS                         |  1 +
 3 files changed, 100 insertions(+)
 create mode 100644 Documentation/driver-api/pwrseq.rst
Documentation/driver-api/index.rst +1 -0
index f10decc2c14b..7f83e05769b4 100644
@@ -124,6 +124,7 @@ Subsystem-specific APIs
    pps
    ptp
    pwm
+   pwrseq
    regulator
    reset
    rfkill
Documentation/driver-api/pwrseq.rst new file +98 -0

98 lines not on this page · raw message

MAINTAINERS +1 -0
index f328373463b0..5a7500f048bb 100644
@@ -18204,6 +18204,7 @@ M:	Bartosz Golaszewski <[email protected]>
 L:	[email protected]
 S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
+F:	Documentation/driver-api/pwrseq.rst
 F:	drivers/power/sequencing/
 F:	include/linux/pwrseq/
 
Signature · 1 line
2.43.0
maintainer
#1 lore raw
Quoted 5 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Describe what the subsystem does, how the consumers and providers work and add API reference generated from kerneldocs.

Quoted 7 lines
---
 Documentation/driver-api/index.rst  |  1 +
 Documentation/driver-api/pwrseq.rst | 98 +++++++++++++++++++++++++++++
 MAINTAINERS                         |  1 +
 3 files changed, 100 insertions(+)
 create mode 100644 Documentation/driver-api/pwrseq.rst

Thanks for this ... just one quick nit...

Documentation/driver-api/pwrseq.rst line 57

Quoted 8 lines
Documentation/driver-api/pwrseq.rst new file +8 -0
+The consumer API is aimed to be as simple as possible. The driver interested in
+getting a descriptor from the power sequencer should call :c:func:`pwrseq_get()`
+and specify the name of the target it wants to reach in the sequence after
+calling :c:func:`pwrseq_power_up()`. The descriptor can be released by calling
+:c:func:`pwrseq_put()` and the consumer can request the powering down of its
+target with :c:func:`pwrseq_power_off()`. Note that there is no guarantee that
+:c:func:`pwrseq_power_off()` will have any effect as there may be multiple users
+of the underlying resources who may keep them active.

There is no need to use :c:func: here; just say function() and the Right Things will just magically happen.

Thanks,

jon

#2 lore raw
Quoted 18 lines · Jonathan Corbet
Quoted 5 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Describe what the subsystem does, how the consumers and providers work and add API reference generated from kerneldocs.

Quoted 7 lines
---
 Documentation/driver-api/index.rst  |  1 +
 Documentation/driver-api/pwrseq.rst | 98 +++++++++++++++++++++++++++++
 MAINTAINERS                         |  1 +
 3 files changed, 100 insertions(+)
 create mode 100644 Documentation/driver-api/pwrseq.rst

Thanks for this ... just one quick nit...

Quoted 11 lines

Documentation/driver-api/pwrseq.rst line 57

Quoted 8 lines
Documentation/driver-api/pwrseq.rst new file +8 -0
+The consumer API is aimed to be as simple as possible. The driver interested in
+getting a descriptor from the power sequencer should call :c:func:`pwrseq_get()`
+and specify the name of the target it wants to reach in the sequence after
+calling :c:func:`pwrseq_power_up()`. The descriptor can be released by calling
+:c:func:`pwrseq_put()` and the consumer can request the powering down of its
+target with :c:func:`pwrseq_power_off()`. Note that there is no guarantee that
+:c:func:`pwrseq_power_off()` will have any effect as there may be multiple users
+of the underlying resources who may keep them active.

There is no need to use :c:func: here; just say function() and the Right Things will just magically happen.

Am I getting that right, are all these :c:func: directives useless in this file or only in this paragraph?

Bart

maintainer
#3 lore raw
Quoted 2 lines · Bartosz Golaszewski

Am I getting that right, are all these :c:func: directives useless in this file or only in this paragraph?

Throughout - it is really just not needed for kernel docs.

Thanks,

jon

#4 lore raw
Quoted 11 lines · Jonathan Corbet
Quoted 2 lines · Bartosz Golaszewski

Am I getting that right, are all these :c:func: directives useless in this file or only in this paragraph?

Throughout - it is really just not needed for kernel docs.

Thanks,

jon

Just sent a v2. I can pick it up into my pwrseq tree with your Ack.

Bart