Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pwm: lpss: Allow other drivers to enable PWM LPSS

The PWM LPSS device can be embedded in another device.
In order to enable it, allow that drivers to probe
a corresponding device.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

+34 -21
+1 -21
drivers/pwm/pwm-lpss.h
··· 13 13 #include <linux/pwm.h> 14 14 #include <linux/types.h> 15 15 16 - struct device; 16 + #include <linux/platform_data/x86/pwm-lpss.h> 17 17 18 18 #define LPSS_MAX_PWMS 4 19 19 ··· 23 23 const struct pwm_lpss_boardinfo *info; 24 24 }; 25 25 26 - struct pwm_lpss_boardinfo { 27 - unsigned long clk_rate; 28 - unsigned int npwm; 29 - unsigned long base_unit_bits; 30 - /* 31 - * Some versions of the IP may stuck in the state machine if enable 32 - * bit is not set, and hence update bit will show busy status till 33 - * the reset. For the rest it may be otherwise. 34 - */ 35 - bool bypass; 36 - /* 37 - * On some devices the _PS0/_PS3 AML code of the GPU (GFX0) device 38 - * messes with the PWM0 controllers state, 39 - */ 40 - bool other_devices_aml_touches_pwm_regs; 41 - }; 42 - 43 26 extern const struct pwm_lpss_boardinfo pwm_lpss_byt_info; 44 27 extern const struct pwm_lpss_boardinfo pwm_lpss_bsw_info; 45 28 extern const struct pwm_lpss_boardinfo pwm_lpss_bxt_info; 46 29 extern const struct pwm_lpss_boardinfo pwm_lpss_tng_info; 47 - 48 - struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, void __iomem *base, 49 - const struct pwm_lpss_boardinfo *info); 50 30 51 31 #endif /* __PWM_LPSS_H */
+33
include/linux/platform_data/x86/pwm-lpss.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* Intel Low Power Subsystem PWM controller driver */ 3 + 4 + #ifndef __PLATFORM_DATA_X86_PWM_LPSS_H 5 + #define __PLATFORM_DATA_X86_PWM_LPSS_H 6 + 7 + #include <linux/types.h> 8 + 9 + struct device; 10 + 11 + struct pwm_lpss_chip; 12 + 13 + struct pwm_lpss_boardinfo { 14 + unsigned long clk_rate; 15 + unsigned int npwm; 16 + unsigned long base_unit_bits; 17 + /* 18 + * Some versions of the IP may stuck in the state machine if enable 19 + * bit is not set, and hence update bit will show busy status till 20 + * the reset. For the rest it may be otherwise. 21 + */ 22 + bool bypass; 23 + /* 24 + * On some devices the _PS0/_PS3 AML code of the GPU (GFX0) device 25 + * messes with the PWM0 controllers state, 26 + */ 27 + bool other_devices_aml_touches_pwm_regs; 28 + }; 29 + 30 + struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, void __iomem *base, 31 + const struct pwm_lpss_boardinfo *info); 32 + 33 + #endif /* __PLATFORM_DATA_X86_PWM_LPSS_H */