aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@free-electrons.com>2016-04-14 15:17:37 -0400
committerThierry Reding <thierry.reding@gmail.com>2016-05-17 08:47:30 -0400
commita8c3862551e063344f80c3e05d595f9d8836f355 (patch)
tree6e4741194a46b669b6f7945c1d41920371a2972b /drivers/pwm
parent102232c54601071304cb6946f9758e3cd74d3e1e (diff)
pwm: Keep PWM state in sync with hardware state
Before the introduction of pwm_args, the core was resetting the PWM period and polarity states to the reference values (those provided through the DT, a PWM lookup table or hardcoded in the driver). Now that all PWM users are correctly using pwm_args to configure their PWM device, we can safely remove the pwm_apply_args() call in pwm_get() and of_pwm_get(). We can also get rid of the pwm_set_period() call in pwm_apply_args(), because PWM users are now directly using pargs->period instead of pwm_get_period(). By doing that we avoid messing with the current PWM period. The only remaining bit in pwm_apply_args() is the initial polarity setting, and it should go away when all PWM users have been patched to use the atomic API (with this API the polarity will be set along with other PWM arguments when configuring the PWM). Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/core.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index cb762cf51332..64330595e17b 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -609,13 +609,6 @@ struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id)
609 609
610 pwm->label = con_id; 610 pwm->label = con_id;
611 611
612 /*
613 * FIXME: This should be removed once all PWM users properly make use
614 * of struct pwm_args to initialize the PWM device. As long as this is
615 * here, the PWM state and hardware state can get out of sync.
616 */
617 pwm_apply_args(pwm);
618
619put: 612put:
620 of_node_put(args.np); 613 of_node_put(args.np);
621 614
@@ -750,13 +743,6 @@ struct pwm_device *pwm_get(struct device *dev, const char *con_id)
750 pwm->args.period = chosen->period; 743 pwm->args.period = chosen->period;
751 pwm->args.polarity = chosen->polarity; 744 pwm->args.polarity = chosen->polarity;
752 745
753 /*
754 * FIXME: This should be removed once all PWM users properly make use
755 * of struct pwm_args to initialize the PWM device. As long as this is
756 * here, the PWM state and hardware state can get out of sync.
757 */
758 pwm_apply_args(pwm);
759
760out: 746out:
761 mutex_unlock(&pwm_lookup_lock); 747 mutex_unlock(&pwm_lookup_lock);
762 return pwm; 748 return pwm;