summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pwm/core.c')
-rw-r--r--drivers/pwm/core.c3
1 files changed, 3 insertions, 0 deletions
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);
}