pwm: tiecap: Make use of pwmchip_parent() accessor
struct pwm_chip::dev is about to change. To not have to touch this driver in the same commit as struct pwm_chip::dev, use the accessor function provided for exactly this purpose. Link: https://lore.kernel.org/r/ae92e06b49437ca7e768b1f8b405170e33948a70.1707900770.git.u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This commit is contained in:
parent
02aa760d29
commit
ba60fbf92d
@ -70,7 +70,7 @@ static int ecap_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
|
|||||||
duty_cycles = (u32)c;
|
duty_cycles = (u32)c;
|
||||||
}
|
}
|
||||||
|
|
||||||
pm_runtime_get_sync(chip->dev);
|
pm_runtime_get_sync(pwmchip_parent(chip));
|
||||||
|
|
||||||
value = readw(pc->mmio_base + ECCTL2);
|
value = readw(pc->mmio_base + ECCTL2);
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ static int ecap_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
|
|||||||
writew(value, pc->mmio_base + ECCTL2);
|
writew(value, pc->mmio_base + ECCTL2);
|
||||||
}
|
}
|
||||||
|
|
||||||
pm_runtime_put_sync(chip->dev);
|
pm_runtime_put_sync(pwmchip_parent(chip));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ static int ecap_pwm_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm,
|
|||||||
struct ecap_pwm_chip *pc = to_ecap_pwm_chip(chip);
|
struct ecap_pwm_chip *pc = to_ecap_pwm_chip(chip);
|
||||||
u16 value;
|
u16 value;
|
||||||
|
|
||||||
pm_runtime_get_sync(chip->dev);
|
pm_runtime_get_sync(pwmchip_parent(chip));
|
||||||
|
|
||||||
value = readw(pc->mmio_base + ECCTL2);
|
value = readw(pc->mmio_base + ECCTL2);
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ static int ecap_pwm_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm,
|
|||||||
|
|
||||||
writew(value, pc->mmio_base + ECCTL2);
|
writew(value, pc->mmio_base + ECCTL2);
|
||||||
|
|
||||||
pm_runtime_put_sync(chip->dev);
|
pm_runtime_put_sync(pwmchip_parent(chip));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -135,7 +135,7 @@ static int ecap_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
|
|||||||
u16 value;
|
u16 value;
|
||||||
|
|
||||||
/* Leave clock enabled on enabling PWM */
|
/* Leave clock enabled on enabling PWM */
|
||||||
pm_runtime_get_sync(chip->dev);
|
pm_runtime_get_sync(pwmchip_parent(chip));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable 'Free run Time stamp counter mode' to start counter
|
* Enable 'Free run Time stamp counter mode' to start counter
|
||||||
@ -162,7 +162,7 @@ static void ecap_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
|
|||||||
writew(value, pc->mmio_base + ECCTL2);
|
writew(value, pc->mmio_base + ECCTL2);
|
||||||
|
|
||||||
/* Disable clock on PWM disable */
|
/* Disable clock on PWM disable */
|
||||||
pm_runtime_put_sync(chip->dev);
|
pm_runtime_put_sync(pwmchip_parent(chip));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ecap_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
|
static int ecap_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
|
||||||
@ -275,11 +275,11 @@ static void ecap_pwm_save_context(struct pwm_chip *chip)
|
|||||||
{
|
{
|
||||||
struct ecap_pwm_chip *pc = to_ecap_pwm_chip(chip);
|
struct ecap_pwm_chip *pc = to_ecap_pwm_chip(chip);
|
||||||
|
|
||||||
pm_runtime_get_sync(chip->dev);
|
pm_runtime_get_sync(pwmchip_parent(chip));
|
||||||
pc->ctx.ecctl2 = readw(pc->mmio_base + ECCTL2);
|
pc->ctx.ecctl2 = readw(pc->mmio_base + ECCTL2);
|
||||||
pc->ctx.cap4 = readl(pc->mmio_base + CAP4);
|
pc->ctx.cap4 = readl(pc->mmio_base + CAP4);
|
||||||
pc->ctx.cap3 = readl(pc->mmio_base + CAP3);
|
pc->ctx.cap3 = readl(pc->mmio_base + CAP3);
|
||||||
pm_runtime_put_sync(chip->dev);
|
pm_runtime_put_sync(pwmchip_parent(chip));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ecap_pwm_restore_context(struct pwm_chip *chip)
|
static void ecap_pwm_restore_context(struct pwm_chip *chip)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user