mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
atmel_pwm: set up only one PWM clock when allocating a clock
This patch will only setup one clock, if free, and return this clock to the caller. The previous solution would setup both clocks with the same prescaler and divider and return PWM_CPR_CLKB, thus taking both clocks in the same call without the caller knowing. Signed-off-by: Hans-Christian Egtvedt <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
82736f4d1d
commit
5aa0769d08
1 changed files with 1 additions and 2 deletions
|
|
@ -211,8 +211,7 @@ int pwm_clk_alloc(unsigned prescale, unsigned div)
|
|||
if ((mr & 0xffff) == 0) {
|
||||
mr |= val;
|
||||
ret = PWM_CPR_CLKA;
|
||||
}
|
||||
if ((mr & (0xffff << 16)) == 0) {
|
||||
} else if ((mr & (0xffff << 16)) == 0) {
|
||||
mr |= val << 16;
|
||||
ret = PWM_CPR_CLKB;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue