diff mbox series

[v1,1/5] docs: firmware-guide: ACPI: Add a PWM example

Message ID 20210531154351.53614-1-andriy.shevchenko@linux.intel.com
State Superseded
Headers show
Series [v1,1/5] docs: firmware-guide: ACPI: Add a PWM example | expand

Commit Message

Andy Shevchenko May 31, 2021, 3:43 p.m. UTC
When PWM support for ACPI has been added into the kernel, it missed
the documentation update. Hence update documentation here.

Fixes: 4a6ef8e37c4d ("pwm: Add support referencing PWMs from ACPI")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 .../firmware-guide/acpi/enumeration.rst       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

Comments

Andy Shevchenko May 31, 2021, 4:09 p.m. UTC | #1
On Mon, May 31, 2021 at 06:43:47PM +0300, Andy Shevchenko wrote:
> When PWM support for ACPI has been added into the kernel, it missed
> the documentation update. Hence update documentation here.

I am actually in doubt that original commit message provides that short period
intentionally. Possibly it was misinterpretation of nanoseconds (which is
expected by PWM framework) with microseconds than might sound logical for LED.

Perhaps we may add 000 to the value (1) and replace us by ms in the text (2).

...

> +                    Package () {
> +                        "\\_SB.PCI0.PWM",  // <PWM device reference>
> +                        0,                 // <PWM index>

> +                        600000,            // <PWM period>

(1)

> +                        0,                 // <PWM flags>
> +                    }

> +In the above example the PWM-based LED driver references to the PWM channel 0
> +of \_SB.PCI0.PWM device with initial period setting equal to 600 us (note that

(2)

> +value is given in nanoseconds).
Andy Shevchenko May 31, 2021, 7:41 p.m. UTC | #2
On Mon, May 31, 2021 at 07:09:13PM +0300, Andy Shevchenko wrote:
> On Mon, May 31, 2021 at 06:43:47PM +0300, Andy Shevchenko wrote:
> > When PWM support for ACPI has been added into the kernel, it missed
> > the documentation update. Hence update documentation here.
> 
> I am actually in doubt that original commit message provides that short period
> intentionally. Possibly it was misinterpretation of nanoseconds (which is
> expected by PWM framework) with microseconds than might sound logical for LED.
> 
> Perhaps we may add 000 to the value (1) and replace us by ms in the text (2).

Okay, I will send an extended v2 and I think I will use 600 ms in the
documentation example.
diff mbox series

Patch

diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst
index 9f0d5c854fa4..0813508b45b0 100644
--- a/Documentation/firmware-guide/acpi/enumeration.rst
+++ b/Documentation/firmware-guide/acpi/enumeration.rst
@@ -258,6 +258,38 @@  input driver::
 		.id_table	= mpu3050_ids,
 	};
 
+Reference to PWM device
+=======================
+
+Sometimes a device can be a consumer of PWM channel. Obviously OS would like
+to know which one. To provide this mapping the special property has been
+introduced, i.e.::
+
+    Device (DEV)
+    {
+        Name (_DSD, Package ()
+        {
+            ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
+            Package () {
+                Package () { "compatible", Package () { "pwm-leds" } },
+                Package () { "label", "alarm-led" },
+                Package () { "pwms",
+                    Package () {
+                        "\\_SB.PCI0.PWM",  // <PWM device reference>
+                        0,                 // <PWM index>
+                        600000,            // <PWM period>
+                        0,                 // <PWM flags>
+                    }
+                }
+            }
+
+        })
+        ...
+
+In the above example the PWM-based LED driver references to the PWM channel 0
+of \_SB.PCI0.PWM device with initial period setting equal to 600 us (note that
+value is given in nanoseconds).
+
 GPIO support
 ============