RE: [PATCH 1/2] pwm: pwm-tiehrpwm: Low power sleep support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 14, 2013 at 12:38:56, Thierry Reding wrote:
> On Thu, Jan 10, 2013 at 06:33:43PM +0530, Philip Avinash wrote:
> [...]
> > diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
> [...]
> > +static int ehrpwm_pwm_suspend(struct device *dev)
> > +{
> > +	struct ehrpwm_pwm_chip *pc = dev_get_drvdata(dev);
> > +
> > +	ehrpwm_pwm_context_save(pc);
> > +	pm_runtime_put_sync(dev);
> > +	return 0;
> > +}
> > +
> > +static int ehrpwm_pwm_resume(struct device *dev)
> > +{
> > +	struct ehrpwm_pwm_chip *pc = dev_get_drvdata(dev);
> > +
> > +	pm_runtime_get_sync(dev);
> > +	ehrpwm_pwm_context_restore(pc);
> > +	return 0;
> > +}
> 
> According to Documentation/power/runtime_pm.txt, the PM core runs the
> pm_runtime_get_noresume() and pm_runtime_put_sync() before executing the
> .suspend() and .resume() callbacks. Are you sure you need to call them
> here explicitly?

I understand the problem of calling pm_runtime_get_sync() from .resume().
But this has to be called if pwm was running while going to suspend so that
pwm can continues to run after resume.

So I will add check of test_bit(PWMF_ENABLED, &pwm->flags) before 
pm_runtime_get/put_sync calls.

Thanks
Avinash

> 
> Thierry
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux