|
@@ -165,7 +165,7 @@ static void rockchip_pwm_get_state(struct pwm_chip *chip,
|
|
clk_disable(pc->pclk);
|
|
clk_disable(pc->pclk);
|
|
}
|
|
}
|
|
|
|
|
|
-static int rockchip_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
|
|
|
|
|
|
+static void rockchip_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
|
|
int duty_ns, int period_ns)
|
|
int duty_ns, int period_ns)
|
|
{
|
|
{
|
|
struct rockchip_pwm_chip *pc = to_rockchip_pwm_chip(chip);
|
|
struct rockchip_pwm_chip *pc = to_rockchip_pwm_chip(chip);
|
|
@@ -188,8 +188,6 @@ static int rockchip_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
|
|
|
|
|
|
writel(period, pc->base + pc->data->regs.period);
|
|
writel(period, pc->base + pc->data->regs.period);
|
|
writel(duty, pc->base + pc->data->regs.duty);
|
|
writel(duty, pc->base + pc->data->regs.duty);
|
|
-
|
|
|
|
- return 0;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static int rockchip_pwm_enable(struct pwm_chip *chip,
|
|
static int rockchip_pwm_enable(struct pwm_chip *chip,
|
|
@@ -236,13 +234,7 @@ static int rockchip_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
|
|
enabled = false;
|
|
enabled = false;
|
|
}
|
|
}
|
|
|
|
|
|
- ret = rockchip_pwm_config(chip, pwm, state->duty_cycle, state->period);
|
|
|
|
- if (ret) {
|
|
|
|
- if (enabled != curstate.enabled)
|
|
|
|
- rockchip_pwm_enable(chip, pwm, !enabled,
|
|
|
|
- state->polarity);
|
|
|
|
- goto out;
|
|
|
|
- }
|
|
|
|
|
|
+ rockchip_pwm_config(chip, pwm, state->duty_cycle, state->period);
|
|
|
|
|
|
if (state->enabled != enabled) {
|
|
if (state->enabled != enabled) {
|
|
ret = rockchip_pwm_enable(chip, pwm, state->enabled,
|
|
ret = rockchip_pwm_enable(chip, pwm, state->enabled,
|