• Nikolaus Voss's avatar
    pwm: Add support referencing PWMs from ACPI · 4a6ef8e3
    Nikolaus Voss authored
    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: default avatarNikolaus Voss <nikolaus.voss@loewensteinmedical.de>
    [thierry.reding@gmail.com: fix build failures for !ACPI]
    Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
    4a6ef8e3
core.c 28.2 KB