From 15fa8a43c147213a9563903c87b29671035eb6e8 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 14 Apr 2016 21:17:40 +0200 Subject: pwm: Add hardware readout infrastructure Add a ->get_state() function to the pwm_ops struct to let PWM drivers initialize the PWM state attached to a PWM device. Signed-off-by: Boris Brezillon Signed-off-by: Thierry Reding --- drivers/pwm/core.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/pwm/core.c') diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index c240b5437145..a909c64ee863 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -270,6 +270,9 @@ int pwmchip_add_with_polarity(struct pwm_chip *chip, pwm->hwpwm = i; pwm->state.polarity = polarity; + if (chip->ops->get_state) + chip->ops->get_state(chip, pwm, &pwm->state); + radix_tree_insert(&pwm_tree, pwm->pwm, pwm); } -- cgit v1.2.3