OSDN Git Service

pwm: Add consumer device link
authorFabrice Gasnier <fabrice.gasnier@st.com>
Thu, 18 Apr 2019 09:37:47 +0000 (11:37 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 25 Jun 2019 12:51:43 +0000 (14:51 +0200)
commitb2c200e3f2fd1158f5f1c93ccb2e0a27d96c4a7a
tree37e6878972f4272b199d689de29d44d54267c9db
parentcce4a833fc6dfdb43a492876ad06f506a61f8fbd
pwm: Add consumer device link

Add a device link between the PWM consumer and the PWM provider. This
enforces the PWM user to get suspended before the PWM provider. It
allows proper synchronization of suspend/resume sequences: the PWM user
is responsible for properly stopping PWM, before the provider gets
suspended: see [1]. Add the device link in:
- of_pwm_get()
- pwm_get()
- devm_*pwm_get() variants
as it requires a reference to the device for the PWM consumer.

[1] https://lkml.org/lkml/2019/2/5/770

Suggested-by: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/core.c
include/linux/pwm.h