Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andy Shevchenko | c558e39 | 2014-08-19 19:17:35 +0300 | [diff] [blame] | 2 | /* |
| 3 | * Intel Low Power Subsystem PWM controller driver |
| 4 | * |
| 5 | * Copyright (C) 2014, Intel Corporation |
| 6 | * |
| 7 | * Derived from the original pwm-lpss.c |
Andy Shevchenko | c558e39 | 2014-08-19 19:17:35 +0300 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef __PWM_LPSS_H |
| 11 | #define __PWM_LPSS_H |
| 12 | |
| 13 | #include <linux/device.h> |
| 14 | #include <linux/pwm.h> |
| 15 | |
Hans de Goede | 9dc419b | 2018-10-12 12:12:26 +0200 | [diff] [blame] | 16 | #define MAX_PWMS 4 |
| 17 | |
| 18 | struct pwm_lpss_chip { |
| 19 | struct pwm_chip chip; |
| 20 | void __iomem *regs; |
| 21 | const struct pwm_lpss_boardinfo *info; |
Hans de Goede | 9dc419b | 2018-10-12 12:12:26 +0200 | [diff] [blame] | 22 | }; |
Andy Shevchenko | c558e39 | 2014-08-19 19:17:35 +0300 | [diff] [blame] | 23 | |
| 24 | struct pwm_lpss_boardinfo { |
| 25 | unsigned long clk_rate; |
Mika Westerberg | 4e11f5a | 2015-10-20 16:53:05 +0300 | [diff] [blame] | 26 | unsigned int npwm; |
qipeng.zha | 883e4d0 | 2015-11-17 17:20:15 +0800 | [diff] [blame] | 27 | unsigned long base_unit_bits; |
Hans de Goede | b997e3e | 2017-04-06 14:54:01 +0300 | [diff] [blame] | 28 | bool bypass; |
Hans de Goede | 4743765 | 2018-10-14 17:12:01 +0200 | [diff] [blame] | 29 | /* |
| 30 | * On some devices the _PS0/_PS3 AML code of the GPU (GFX0) device |
| 31 | * messes with the PWM0 controllers state, |
| 32 | */ |
| 33 | bool other_devices_aml_touches_pwm_regs; |
Andy Shevchenko | c558e39 | 2014-08-19 19:17:35 +0300 | [diff] [blame] | 34 | }; |
| 35 | |
Andy Shevchenko | c558e39 | 2014-08-19 19:17:35 +0300 | [diff] [blame] | 36 | struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, struct resource *r, |
| 37 | const struct pwm_lpss_boardinfo *info); |
Andy Shevchenko | c558e39 | 2014-08-19 19:17:35 +0300 | [diff] [blame] | 38 | |
| 39 | #endif /* __PWM_LPSS_H */ |