Fix mvebu pwm patch (#3847)

This commit is contained in:
Jannis 2022-06-03 18:51:39 +02:00 committed by GitHub
parent 9a661d7af9
commit 4c0cc1e778
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -220,7 +220,7 @@ index bad399e3f..d3fdaf177 100644
regmap_read(mvchip->regs, GPIO_BLINK_EN_OFF + mvchip->offset, &u);
if (u)
@@ -723,19 +796,26 @@ static void mvebu_pwm_get_state(struct pwm_chip *chip,
@@ -796,13 +796,15 @@ static void mvebu_pwm_get_state(struct pwm_chip *chip,
else
state->enabled = false;
@ -237,10 +237,12 @@ index bad399e3f..d3fdaf177 100644
struct mvebu_gpio_chip *mvchip = mvpwm->mvchip;
unsigned long long val;
unsigned long flags;
unsigned int on, off;
@@ -811,7 +813,12 @@ static int mvebu_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
if (state->polarity != PWM_POLARITY_NORMAL)
return -EINVAL;
- val = (unsigned long long) mvpwm->clk_rate * state->duty_cycle;
+ if (chip_data)
+ if (chip_data)
+ controller = mvebu_pwm_list[chip_data->ctrl];
+ else
+ controller = &mvpwm->controller;

View File

@ -220,7 +220,7 @@ index bad399e3f..d3fdaf177 100644
regmap_read(mvchip->regs, GPIO_BLINK_EN_OFF + mvchip->offset, &u);
if (u)
@@ -723,19 +796,26 @@ static void mvebu_pwm_get_state(struct pwm_chip *chip,
@@ -796,13 +796,15 @@ static void mvebu_pwm_get_state(struct pwm_chip *chip,
else
state->enabled = false;
@ -237,10 +237,12 @@ index bad399e3f..d3fdaf177 100644
struct mvebu_gpio_chip *mvchip = mvpwm->mvchip;
unsigned long long val;
unsigned long flags;
unsigned int on, off;
@@ -811,7 +813,12 @@ static int mvebu_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
if (state->polarity != PWM_POLARITY_NORMAL)
return -EINVAL;
- val = (unsigned long long) mvpwm->clk_rate * state->duty_cycle;
+ if (chip_data)
+ if (chip_data)
+ controller = mvebu_pwm_list[chip_data->ctrl];
+ else
+ controller = &mvpwm->controller;