pwm: imx: set can_sleep flag for imx_pwm_v2
Subsystems (2)
PATCH 1/1 pwm: imx: set can_sleep flag for imx_pwm_v2
The .config() hook of imx_pwm_data_v2 calls clk_get_rate() which might sleep, so we need to set can_sleep flag on it.
--- drivers/pwm/pwm-imx.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/pwm/pwm-imx.c +3 -0
@@ -272,6 +272,9 @@ static int imx_pwm_probe(struct platform_device *pdev) imx->config = data->config; imx->set_enable = data->set_enable; +if (data == &imx_pwm_data_v2) + imx->chip.can_sleep = true; + ret =pwmchip_add (&imx->chip);if (ret <0 )return ret;
Signature · 1 line
1.8.3.2
PATCH 1/1 pwm: imx: set can_sleep flag for imx_pwm_v2
Hi Shawn,
Quoted 14 lines · Shawn Guo
The .config() hook of
imx_pwm_data_v2callsclk_get_rate()which might sleep, so we need to setcan_sleepflag on it.Signed-off-by Shawn Guo <[email protected]>--- drivers/pwm/pwm-imx.c | 3 +++ 1 file changed, 3 insertions(+)drivers/pwm/pwm-imx.c +0
-0
drivers/pwm/pwm-imx.c static int imx_pwm_probe(struct platform_device *pdev) · line 280
Quoted 9 lines
drivers/pwm/pwm-imx.c +3
-0@@ -272,6 +272,9 @@ static int imx_pwm_probe(struct platform_device *pdev) imx->config = data->config; imx->set_enable = data->set_enable; +if (data == &imx_pwm_data_v2) + imx->chip.can_sleep = true; + ret =pwmchip_add (&imx->chip);if (ret <0 )return ret;
clk_prepare_enable()/clk_disable_unprepare() called in imx_pwm_config() may sleep.
So, the can_sleep flag should be true for both i.MX PWM v1 and v2, right?
Signature · 1 line
Liu Ying
PATCH 1/1 pwm: imx: set can_sleep flag for imx_pwm_v2
Quoted 29 lines · Liu Ying
Hi Shawn,
Quoted 14 lines · Shawn Guo
The .config() hook of
imx_pwm_data_v2callsclk_get_rate()which might sleep, so we need to setcan_sleepflag on it.Signed-off-by Shawn Guo <[email protected]>--- drivers/pwm/pwm-imx.c | 3 +++ 1 file changed, 3 insertions(+)drivers/pwm/pwm-imx.c +0
-0drivers/pwm/pwm-imx.c static int imx_pwm_probe(struct platform_device *pdev) · line 280
Quoted 9 lines
drivers/pwm/pwm-imx.c +3
-0@@ -272,6 +272,9 @@ static int imx_pwm_probe(struct platform_device *pdev) imx->config = data->config; imx->set_enable = data->set_enable; +if (data == &imx_pwm_data_v2) + imx->chip.can_sleep = true; + ret =pwmchip_add (&imx->chip);if (ret <0 )return ret;clk_prepare_enable()/clk_disable_unprepare() called in
imx_pwm_config()may sleep.
Quoted 1 line
So, the
can_sleepflag should be true for both i.MX PWM v1 and v2, right?
Yes, you're right. I missed that. Thanks for pointing it out.
Will send v2 shortly.
Shawn