mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
pwm: rockchip: move the clk_enable() after arbiter check in freq mode
Change-Id: I219f8bfb033214b5f3cf85883d2c3c27d2c5ffb6 Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
This commit is contained in:
@@ -1121,9 +1121,6 @@ static int rockchip_pwm_set_freq_meter_v4(struct pwm_chip *chip, struct pwm_devi
|
||||
int ret;
|
||||
|
||||
if (enable) {
|
||||
ret = clk_enable(pc->clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
pc->freq_res_valid = false;
|
||||
|
||||
arbiter = BIT(pc->channel_id) << FREQ_READ_LOCK_SHIFT |
|
||||
@@ -1141,6 +1138,12 @@ static int rockchip_pwm_set_freq_meter_v4(struct pwm_chip *chip, struct pwm_devi
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (enable) {
|
||||
ret = clk_enable(pc->clk);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
writel_relaxed(FREQ_INT_EN(enable), pc->base + INT_EN);
|
||||
writel_relaxed(timer_val, pc->base + FREQ_TIMER_VALUE);
|
||||
writel_relaxed(FREQ_EN(enable) | FREQ_CLK_SEL(input_sel) | FREQ_CHANNEL_SEL(channel_sel),
|
||||
|
||||
Reference in New Issue
Block a user