linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/7] docs: firmware-guide: ACPI: Add a PWM example
@ 2021-05-31 19:49 Andy Shevchenko
  2021-05-31 19:49 ` [PATCH v2 2/7] pwm: core: Always require PWM flags to be provided Andy Shevchenko
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Andy Shevchenko @ 2021-05-31 19:49 UTC (permalink / raw)
  To: Uwe Kleine-König, Andy Shevchenko, Flavio Suligoi,
	Thierry Reding, linux-doc, linux-kernel, linux-pwm, linux-acpi
  Cc: Jonathan Corbet, Lee Jones, Rafael J. Wysocki, Len Brown

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>
---
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


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

end of thread, other threads:[~2021-06-07 14:11 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31 19:49 [PATCH v2 1/7] docs: firmware-guide: ACPI: Add a PWM example Andy Shevchenko
2021-05-31 19:49 ` [PATCH v2 2/7] pwm: core: Always require PWM flags to be provided Andy Shevchenko
2021-06-06 21:30   ` Uwe Kleine-König
2021-06-07  9:02     ` Andy Shevchenko
2021-06-07  9:53       ` Uwe Kleine-König
2021-06-07 10:15         ` Andy Shevchenko
2021-06-07 10:21           ` Andy Shevchenko
2021-06-07 11:49             ` Andy Shevchenko
2021-06-07 14:11               ` Uwe Kleine-König
2021-05-31 19:49 ` [PATCH v2 3/7] pwm: core: Convert to use fwnode for matching Andy Shevchenko
2021-05-31 19:49 ` [PATCH v2 4/7] pwm: core: Reuse fwnode_to_pwmchip() in ACPI case Andy Shevchenko
2021-05-31 19:49 ` [PATCH v2 5/7] pwm: core: Unify fwnode checks in the module Andy Shevchenko
2021-05-31 19:49 ` [PATCH v2 6/7] pwm: core: Remove unused devm_pwm_put() Andy Shevchenko
2021-06-06 21:40   ` Uwe Kleine-König
2021-05-31 19:49 ` [PATCH v2 7/7] pwm: core: Simplify some devm_*pwm*() functions Andy Shevchenko
2021-06-06 21:45   ` Uwe Kleine-König

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).