summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2020-02-10 22:35:18 +0100
committerThierry Reding <thierry.reding@gmail.com>2020-03-30 16:55:26 +0200
commit3ad1f3a33286dc67d595f6fab3a3a9e583bc738a (patch)
treee0cbc0017e20028ccb090e9f68ced37aaa2f8655 /include
parentpwm: imx27: Ensure clocks being on iff the PWM is on (diff)
downloadlinux-3ad1f3a33286dc67d595f6fab3a3a9e583bc738a.tar.xz
linux-3ad1f3a33286dc67d595f6fab3a3a9e583bc738a.zip
pwm: Implement some checks for lowlevel drivers
There are some expectations which the callbacks provided by lowlevel drivers should fulfill. Implement checks that help driver authors to get these semantics right. As these have some overhead the checks can be disabled using a Kconfig setting. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pwm.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index 0ef808d925bb..2635b2a55090 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -71,7 +71,8 @@ struct pwm_state {
* @chip: PWM chip providing this PWM device
* @chip_data: chip-private data associated with the PWM device
* @args: PWM arguments
- * @state: curent PWM channel state
+ * @state: last applied state
+ * @last: last implemented state (for PWM_DEBUG)
*/
struct pwm_device {
const char *label;
@@ -83,6 +84,7 @@ struct pwm_device {
struct pwm_args args;
struct pwm_state state;
+ struct pwm_state last;
};
/**