diff options
author | Thierry Reding <thierry.reding@gmail.com> | 2016-05-17 14:57:47 +0200 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2016-05-17 14:57:47 +0200 |
commit | bf5dd9abcb4443bbab8cb63b9d82b96a4a45c802 (patch) | |
tree | a4d776d644c5b5140490f26c95578f9dcb77653d /drivers | |
parent | c3499f0bc38d6db78f119f8f95d5d471e026ef88 (diff) | |
parent | fbd45a12988e75a48d392feb8b0e5feb5d612513 (diff) | |
download | linux-bf5dd9abcb4443bbab8cb63b9d82b96a4a45c802.tar.bz2 |
Merge branch 'for-4.7/pwm-args' into for-next
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pwm/core.c | 26 | ||||
-rw-r--r-- | drivers/pwm/pwm-clps711x.c | 2 | ||||
-rw-r--r-- | drivers/pwm/pwm-pxa.c | 2 |
3 files changed, 22 insertions, 8 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c index 2a1a2d566e39..e4de9156974d 100644 --- a/drivers/pwm/core.c +++ b/drivers/pwm/core.c @@ -147,12 +147,12 @@ of_pwm_xlate_with_flags(struct pwm_chip *pc, const struct of_phandle_args *args) if (IS_ERR(pwm)) return pwm; - pwm_set_period(pwm, args->args[1]); + pwm->args.period = args->args[1]; if (args->args[2] & PWM_POLARITY_INVERTED) - pwm_set_polarity(pwm, PWM_POLARITY_INVERSED); + pwm->args.polarity = PWM_POLARITY_INVERSED; else - pwm_set_polarity(pwm, PWM_POLARITY_NORMAL); + pwm->args.polarity = PWM_POLARITY_NORMAL; return pwm; } @@ -173,7 +173,7 @@ of_pwm_simple_xlate(struct pwm_chip *pc, const struct of_phandle_args *args) if (IS_ERR(pwm)) return pwm; - pwm_set_period(pwm, args->args[1]); + pwm->args.period = args->args[1]; return pwm; } @@ -621,6 +621,13 @@ struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id) pwm->label = con_id; + /* + * FIXME: This should be removed once all PWM users properly make use + * of struct pwm_args to initialize the PWM device. As long as this is + * here, the PWM state and hardware state can get out of sync. + */ + pwm_apply_args(pwm); + put: of_node_put(args.np); @@ -752,8 +759,15 @@ struct pwm_device *pwm_get(struct device *dev, const char *con_id) if (IS_ERR(pwm)) goto out; - pwm_set_period(pwm, chosen->period); - pwm_set_polarity(pwm, chosen->polarity); + pwm->args.period = chosen->period; + pwm->args.polarity = chosen->polarity; + + /* + * FIXME: This should be removed once all PWM users properly make use + * of struct pwm_args to initialize the PWM device. As long as this is + * here, the PWM state and hardware state can get out of sync. + */ + pwm_apply_args(pwm); out: mutex_unlock(&pwm_lookup_lock); diff --git a/drivers/pwm/pwm-clps711x.c b/drivers/pwm/pwm-clps711x.c index a80c10803636..7d335422cfda 100644 --- a/drivers/pwm/pwm-clps711x.c +++ b/drivers/pwm/pwm-clps711x.c @@ -60,7 +60,7 @@ static int clps711x_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) return -EINVAL; /* Store constant period value */ - pwm_set_period(pwm, DIV_ROUND_CLOSEST(NSEC_PER_SEC, freq)); + pwm->args.period = DIV_ROUND_CLOSEST(NSEC_PER_SEC, freq); return 0; } diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c index cb2f7024cf68..58b709f29130 100644 --- a/drivers/pwm/pwm-pxa.c +++ b/drivers/pwm/pwm-pxa.c @@ -160,7 +160,7 @@ pxa_pwm_of_xlate(struct pwm_chip *pc, const struct of_phandle_args *args) if (IS_ERR(pwm)) return pwm; - pwm_set_period(pwm, args->args[0]); + pwm->args.period = args->args[0]; return pwm; } |