Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pwm: imx27: Don't use pwm consumer API

Lowlevel driver callbacks are not supposed to use the consumer API
functions. Currently this works, but with the upcoming locking changes
this maybe results in dead locks. So directly access pwm->state.

Link: https://lore.kernel.org/r/20240126101624.2056801-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

+3 -6
+3 -6
drivers/pwm/pwm-imx27.c
··· 204 204 sr = readl(imx->mmio_base + MX3_PWMSR); 205 205 fifoav = FIELD_GET(MX3_PWMSR_FIFOAV, sr); 206 206 if (fifoav == MX3_PWMSR_FIFOAV_4WORDS) { 207 - period_ms = DIV_ROUND_UP_ULL(pwm_get_period(pwm), 208 - NSEC_PER_MSEC); 207 + period_ms = DIV_ROUND_UP_ULL(pwm->state.period, 208 + NSEC_PER_MSEC); 209 209 msleep(period_ms); 210 210 211 211 sr = readl(imx->mmio_base + MX3_PWMSR); ··· 219 219 { 220 220 unsigned long period_cycles, duty_cycles, prescale; 221 221 struct pwm_imx27_chip *imx = to_pwm_imx27_chip(chip); 222 - struct pwm_state cstate; 223 222 unsigned long long c; 224 223 unsigned long long clkrate; 225 224 int ret; 226 225 u32 cr; 227 - 228 - pwm_get_state(pwm, &cstate); 229 226 230 227 clkrate = clk_get_rate(imx->clk_per); 231 228 c = clkrate * state->period; ··· 251 254 * Wait for a free FIFO slot if the PWM is already enabled, and flush 252 255 * the FIFO if the PWM was disabled and is about to be enabled. 253 256 */ 254 - if (cstate.enabled) { 257 + if (pwm->state.enabled) { 255 258 pwm_imx27_wait_fifo_slot(chip, pwm); 256 259 } else { 257 260 ret = pwm_imx27_clk_prepare_enable(imx);