[PATCH] pwm: imx-tpm: Enable pinctrl setting for sleep state

Shenwei Wang shenwei.wang at nxp.com
Mon Jul 1 12:48:40 PDT 2024



> -----Original Message-----
> From: Shenwei Wang
> Sent: Friday, June 14, 2024 1:43 PM
> To: Uwe Kleine-König <ukleinek at kernel.org>; Shawn Guo
> <shawnguo at kernel.org>; Sascha Hauer <s.hauer at pengutronix.de>
> > -----Original Message-----
> > From: Shenwei Wang <shenwei.wang at nxp.com>
> > Sent: Tuesday, May 14, 2024 3:06 PM
> > To: Uwe Kleine-König <ukleinek at kernel.org>; Shawn Guo
> > <shawnguo at kernel.org>; Sascha Hauer <s.hauer at pengutronix.de>
> > Cc: Pengutronix Kernel Team <kernel at pengutronix.de>; Fabio Estevam
> > <festevam at gmail.com>; linux-pwm at vger.kernel.org; imx at lists.linux.dev;
> > linux-arm-kernel at lists.infradead.org; dl-linux-imx
> > <linux-imx at nxp.com>; Shenwei Wang <shenwei.wang at nxp.com>
> > Subject: [PATCH] pwm: imx-tpm: Enable pinctrl setting for sleep state
> >
> > Apply the pinctrl setting of sleep state when system enters suspend state.
> > Restore to the default pinctrl setting when system resumes.
> >
> 
> Ping @Uwe

2nd Ping. 

Hi Uwe,
Can you please provide your feedback on this patch?

Thanks,
Shenwei
> 
> Thanks,
> Shenwei
> 
> > Signed-off-by: Shenwei Wang <shenwei.wang at nxp.com>
> > ---
> >  drivers/pwm/pwm-imx-tpm.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/pwm/pwm-imx-tpm.c b/drivers/pwm/pwm-imx-tpm.c
> > index c50ddbac43c8..19245790c67c 100644
> > --- a/drivers/pwm/pwm-imx-tpm.c
> > +++ b/drivers/pwm/pwm-imx-tpm.c
> > @@ -393,7 +393,7 @@ static int pwm_imx_tpm_suspend(struct device
> *dev)
> >
> >  	clk_disable_unprepare(tpm->clk);
> >
> > -	return 0;
> > +	return pinctrl_pm_select_sleep_state(dev);
> >  }
> >
> >  static int pwm_imx_tpm_resume(struct device *dev) @@ -401,6 +401,10
> > @@ static int pwm_imx_tpm_resume(struct device *dev)
> >  	struct imx_tpm_pwm_chip *tpm = dev_get_drvdata(dev);
> >  	int ret = 0;
> >
> > +	ret = pinctrl_pm_select_default_state(dev);
> > +	if (ret)
> > +		return ret;
> > +
> >  	ret = clk_prepare_enable(tpm->clk);
> >  	if (ret)
> >  		dev_err(dev, "failed to prepare or enable clock: %d\n", ret);
> > --
> > 2.34.1




More information about the linux-arm-kernel mailing list