[v3,1/6] docs: firmware-guide: ACPI: Add a PWM example

Message ID 20210607122458.40073-1-andriy.shevchenko@linux.intel.com
State Accepted
Commit ef3d13b867637f9a791b524100362ba7e2b69810
Headers show
Series
  • [v3,1/6] docs: firmware-guide: ACPI: Add a PWM example
Related show

Commit Message

Andy Shevchenko June 7, 2021, 12:24 p.m.
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>
---
v3: despite flags being optional, don't alter it in the documentation
v2: updated example to use 600 ms instead of 600 us (looks saner)
 .../firmware-guide/acpi/enumeration.rst       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

Comments

Rafael J. Wysocki June 7, 2021, 12:38 p.m. | #1
On Mon, Jun 7, 2021 at 2:24 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> 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>

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

and I'm assuming this to go in via PWM.

> ---
> v3: despite flags being optional, don't alter it in the documentation
> v2: updated example to use 600 ms instead of 600 us (looks saner)
>  .../firmware-guide/acpi/enumeration.rst       | 32 +++++++++++++++++++
>  1 file changed, 32 insertions(+)
>
> diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst
> index 9f0d5c854fa4..f588663ba906 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>
> +                        600000000,         // <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 ms (note that
> +value is given in nanoseconds).
> +
>  GPIO support
>  ============
>
> --
> 2.30.2
>
Andy Shevchenko June 7, 2021, 2:36 p.m. | #2
On Mon, Jun 07, 2021 at 02:38:26PM +0200, Rafael J. Wysocki wrote:
> On Mon, Jun 7, 2021 at 2:24 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > 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>
> 
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> and I'm assuming this to go in via PWM.

Yes, thanks for your tags!

Patch

diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst
index 9f0d5c854fa4..f588663ba906 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>
+                        600000000,         // <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 ms (note that
+value is given in nanoseconds).
+
 GPIO support
 ============