OSDN Git Service

pwm: Add support referencing PWMs from ACPI
authorNikolaus Voss <nikolaus.voss@loewensteinmedical.de>
Wed, 12 Jun 2019 08:36:07 +0000 (10:36 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 26 Jun 2019 09:39:11 +0000 (11:39 +0200)
commit4a6ef8e37c4d9a40f09438068da1734fd965bd75
tree648a522e0979f02ef20aa8431977b590c05c435f
parent4a5fa56cc031274738ddc86b3ec0c5d1e21822b3
pwm: Add support referencing PWMs from ACPI

In analogy to referencing a GPIO using the "gpios" property from ACPI,
support referencing a PWM using the "pwms" property.

ACPI entries must look like
 Package () {"pwms", Package ()
     { <PWM device reference>, <PWM index>, <PWM period> [, <PWM flags>]}}

In contrast to the DT implementation, only _one_ PWM entry in the "pwms"
property is supported. As a consequence "pwm-names"-property and
con_id lookup aren't supported.

Support for ACPI is added via the firmware-node framework which is an
abstraction layer on top of ACPI/DT. To keep this patch clean, DT and
ACPI paths are kept separate. The firmware-node framework could be used
to unify both paths in a future patch.

To support leds-pwm driver, an additional method devm_fwnode_pwm_get()
which supports both ACPI and DT configuration is exported.

Signed-off-by: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
[thierry.reding@gmail.com: fix build failures for !ACPI]
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c
include/linux/pwm.h