kernel/kernel-baytrail-4.9.9-pwm-lpss.patch

72 lines
2.0 KiB
Diff

diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
index bf01288..cda31ea 100644
--- a/drivers/pwm/Kconfig
+++ b/drivers/pwm/Kconfig
@@ -240,28 +240,22 @@ config PWM_LPC32XX
will be called pwm-lpc32xx.
config PWM_LPSS
- tristate
+ bool
config PWM_LPSS_PCI
- tristate "Intel LPSS PWM PCI driver"
+ bool "Intel LPSS PWM PCI driver"
depends on X86 && PCI
select PWM_LPSS
help
The PCI driver for Intel Low Power Subsystem PWM controller.
- To compile this driver as a module, choose M here: the module
- will be called pwm-lpss-pci.
-
config PWM_LPSS_PLATFORM
- tristate "Intel LPSS PWM platform driver"
+ bool "Intel LPSS PWM platform driver"
depends on X86 && ACPI
select PWM_LPSS
help
The platform driver for Intel Low Power Subsystem PWM controller.
- To compile this driver as a module, choose M here: the module
- will be called pwm-lpss-platform.
-
config PWM_MESON
tristate "Amlogic Meson PWM driver"
depends on ARCH_MESON
diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c
index 72c0bce..b4d8835 100644
--- a/drivers/pwm/pwm-lpss.c
+++ b/drivers/pwm/pwm-lpss.c
@@ -161,6 +161,12 @@ static const struct pwm_ops pwm_lpss_ops = {
.owner = THIS_MODULE,
};
+/* PWM consumed by the Intel GFX */
+static struct pwm_lookup pwm_lpss_lookup[] = {
+ PWM_LOOKUP("pwm-lpss", 0, "0000:00:02.0", "pwm_backlight", 0,
+ PWM_POLARITY_NORMAL),
+};
+
struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, struct resource *r,
const struct pwm_lpss_boardinfo *info)
{
@@ -193,12 +199,17 @@ struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, struct resource *r,
return ERR_PTR(ret);
}
+ /* Add lookup table for pwm_backlight */
+ pwm_lpss_lookup[0].provider = dev_name(dev);
+ pwm_add_table(pwm_lpss_lookup, ARRAY_SIZE(pwm_lpss_lookup));
+
return lpwm;
}
EXPORT_SYMBOL_GPL(pwm_lpss_probe);
int pwm_lpss_remove(struct pwm_lpss_chip *lpwm)
{
+ pwm_remove_table(pwm_lpss_lookup, ARRAY_SIZE(pwm_lpss_lookup));
return pwmchip_remove(&lpwm->chip);
}
EXPORT_SYMBOL_GPL(pwm_lpss_remove);