Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pwm/for-4.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm

Pull pwm fixes from Thierry Reding:
"One more fix for some fallout observed after the introduction of the
atomic API"

* tag 'pwm/for-4.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm:
pwm: Fix pwm_apply_args()

+10 -6
+10 -6
include/linux/pwm.h
··· 464 464 465 465 static inline void pwm_apply_args(struct pwm_device *pwm) 466 466 { 467 + struct pwm_state state = { }; 468 + 467 469 /* 468 470 * PWM users calling pwm_apply_args() expect to have a fresh config 469 471 * where the polarity and period are set according to pwm_args info. ··· 478 476 * at startup (even if they are actually enabled), thus authorizing 479 477 * polarity setting. 480 478 * 481 - * Instead of setting ->enabled to false, we call pwm_disable() 482 - * before pwm_set_polarity() to ensure that everything is configured 483 - * as expected, and the PWM is really disabled when the user request 484 - * it. 479 + * To fulfill this requirement, we apply a new state which disables 480 + * the PWM device and set the reference period and polarity config. 485 481 * 486 482 * Note that PWM users requiring a smooth handover between the 487 483 * bootloader and the kernel (like critical regulators controlled by 488 484 * PWM devices) will have to switch to the atomic API and avoid calling 489 485 * pwm_apply_args(). 490 486 */ 491 - pwm_disable(pwm); 492 - pwm_set_polarity(pwm, pwm->args.polarity); 487 + 488 + state.enabled = false; 489 + state.polarity = pwm->args.polarity; 490 + state.period = pwm->args.period; 491 + 492 + pwm_apply_state(pwm, &state); 493 493 } 494 494 495 495 struct pwm_lookup {