linux/drivers/pwm
Hans de Goede 6cf9481b44 pwm: Fallback to the static lookup-list when acpi_pwm_get fails
Commit 4a6ef8e37c ("pwm: Add support referencing PWMs from ACPI")
made pwm_get unconditionally return the acpi_pwm_get return value if
the device passed to pwm_get has an ACPI fwnode.

But even if the passed in device has an ACPI fwnode, it does not
necessarily have the necessary ACPI package defining its pwm bindings,
especially since the binding / API of this ACPI package has only been
introduced very recently.

Up until now X86/ACPI devices which use a separate pwm controller for
controlling their LCD screen's backlight brightness have been relying
on the static lookup-list to get their pwm.

pwm_get unconditionally returning the acpi_pwm_get return value breaks
this, breaking backlight control on these devices.

This commit fixes this by making pwm_get fall back to the static
lookup-list if acpi_pwm_get returns -ENOENT.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=96571
Reported-by: youling257@gmail.com
Fixes: 4a6ef8e37c ("pwm: Add support referencing PWMs from ACPI")
Cc: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
2019-08-08 13:17:38 +02:00
..
core.c pwm: Fallback to the static lookup-list when acpi_pwm_get fails 2019-08-08 13:17:38 +02:00
Kconfig pwm: Changes for v5.3-rc1 2019-07-09 08:57:45 -07:00
Makefile pwm: sifive: Add a driver for SiFive SoC PWM 2019-06-25 14:48:12 +02:00
pwm-ab8500.c
pwm-atmel-hlcdc.c pwm: Changes for v5.3-rc1 2019-07-09 08:57:45 -07:00
pwm-atmel-tcb.c
pwm-atmel.c
pwm-bcm2835.c pwm: bcm2835: Improve precision of PWM 2019-06-26 11:39:12 +02:00
pwm-bcm-iproc.c
pwm-bcm-kona.c
pwm-berlin.c
pwm-brcmstb.c
pwm-clps711x.c
pwm-crc.c
pwm-cros-ec.c
pwm-ep93xx.c
pwm-fsl-ftm.c pwm: Changes for v5.3-rc1 2019-07-09 08:57:45 -07:00
pwm-hibvt.c
pwm-img.c
pwm-imx1.c
pwm-imx27.c
pwm-imx-tpm.c
pwm-jz4740.c pwm: Changes for v5.3-rc1 2019-07-09 08:57:45 -07:00
pwm-lp3943.c
pwm-lpc18xx-sct.c
pwm-lpc32xx.c
pwm-lpss-pci.c
pwm-lpss-platform.c
pwm-lpss.c
pwm-lpss.h
pwm-mediatek.c
pwm-meson.c pwm: meson: Add documentation to the driver 2019-06-26 11:39:10 +02:00
pwm-mtk-disp.c
pwm-mxs.c
pwm-omap-dmtimer.c
pwm-pca9685.c
pwm-puv3.c
pwm-pxa.c
pwm-rcar.c pwm: rcar: Remove suspend/resume support 2019-06-26 11:39:11 +02:00
pwm-renesas-tpu.c
pwm-rockchip.c
pwm-samsung.c
pwm-sifive.c pwm: sifive: Add a driver for SiFive SoC PWM 2019-06-25 14:48:12 +02:00
pwm-spear.c
pwm-sti.c
pwm-stm32-lp.c pwm: stm32-lp: Add power management support 2019-06-25 14:49:50 +02:00
pwm-stm32.c pwm: stm32: Use 3 cells ->of_xlate() 2019-06-25 14:53:51 +02:00
pwm-stmpe.c
pwm-sun4i.c
pwm-tegra.c
pwm-tiecap.c
pwm-tiehrpwm.c
pwm-tipwmss.c
pwm-twl-led.c
pwm-twl.c
pwm-vt8500.c
pwm-zx.c
sysfs.c pwm: Changes for v5.3-rc1 2019-07-09 08:57:45 -07:00