From: Vinod Koul <vinod.koul@intel.com> To: Jingchang Lu <jingchang.lu@freescale.com>, g@intel.com Cc: dan.j.williams@intel.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/2] dmaengine: fsl-edma: add PM suspend/resume support Date: Thu, 5 Mar 2015 16:11:08 +0530 [thread overview] Message-ID: <20150305104108.GF2613@intel.com> (raw) In-Reply-To: <1419928907-18053-3-git-send-email-jingchang.lu@freescale.com> On Tue, Dec 30, 2014 at 04:41:47PM +0800, Jingchang Lu wrote: > This adds power management suspend/resume support for > the fsl-edma driver. > > Signed-off-by: Jingchang Lu <jingchang.lu@freescale.com> > --- > drivers/dma/fsl-edma.c | 38 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 38 insertions(+) > > diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c > index e0bd517..6a81699 100644 > --- a/drivers/dma/fsl-edma.c > +++ b/drivers/dma/fsl-edma.c > @@ -1017,6 +1017,43 @@ static int fsl_edma_remove(struct platform_device *pdev) > return 0; > } > > +#ifdef CONFIG_PM_SLEEP > +static int fsl_edma_pm_suspend(struct device *dev) > +{ > + struct fsl_edma_engine *fsl_edma = dev_get_drvdata(dev); > + struct fsl_edma_chan *fsl_chan; > + int i; > + > + for (i = 0; i < fsl_edma->n_chans; i++) { > + fsl_chan = &fsl_edma->chans[i]; > + fsl_edma_chan_mux(fsl_chan, 0, false); > + } > + > + return 0; > +} > + > +static int fsl_edma_pm_resume(struct device *dev) > +{ > + struct fsl_edma_engine *fsl_edma = dev_get_drvdata(dev); > + struct fsl_edma_chan *fsl_chan; > + int i; > + > + for (i = 0; i < fsl_edma->n_chans; i++) { > + fsl_chan = &fsl_edma->chans[i]; > + edma_writew(fsl_edma, 0x0, fsl_edma->membase + EDMA_TCD_CSR(i)); > + /* restore the channel slave id configuration */ > + fsl_edma_chan_mux(fsl_chan, fsl_chan->slave_id, true); Wouldnt this be reconfigured? Should you do this for all channels or active ones. Also I dont see you pausing or suspending active channels or checking for them? -- ~Vinod > + } > + > + edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, > + fsl_edma->membase + EDMA_CR); > + > + return 0; > +} > +#endif > +static > +SIMPLE_DEV_PM_OPS(fsl_edma_pm_ops, fsl_edma_pm_suspend, fsl_edma_pm_resume); > + > static const struct of_device_id fsl_edma_dt_ids[] = { > { .compatible = "fsl,vf610-edma", }, > { /* sentinel */ } > @@ -1027,6 +1064,7 @@ static struct platform_driver fsl_edma_driver = { > .driver = { > .name = "fsl-edma", > .of_match_table = fsl_edma_dt_ids, > + .pm = &fsl_edma_pm_ops, > }, > .probe = fsl_edma_probe, > .remove = fsl_edma_remove, > -- > 1.8.0 > --
WARNING: multiple messages have this Message-ID (diff)
From: vinod.koul@intel.com (Vinod Koul) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] dmaengine: fsl-edma: add PM suspend/resume support Date: Thu, 5 Mar 2015 16:11:08 +0530 [thread overview] Message-ID: <20150305104108.GF2613@intel.com> (raw) In-Reply-To: <1419928907-18053-3-git-send-email-jingchang.lu@freescale.com> On Tue, Dec 30, 2014 at 04:41:47PM +0800, Jingchang Lu wrote: > This adds power management suspend/resume support for > the fsl-edma driver. > > Signed-off-by: Jingchang Lu <jingchang.lu@freescale.com> > --- > drivers/dma/fsl-edma.c | 38 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 38 insertions(+) > > diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c > index e0bd517..6a81699 100644 > --- a/drivers/dma/fsl-edma.c > +++ b/drivers/dma/fsl-edma.c > @@ -1017,6 +1017,43 @@ static int fsl_edma_remove(struct platform_device *pdev) > return 0; > } > > +#ifdef CONFIG_PM_SLEEP > +static int fsl_edma_pm_suspend(struct device *dev) > +{ > + struct fsl_edma_engine *fsl_edma = dev_get_drvdata(dev); > + struct fsl_edma_chan *fsl_chan; > + int i; > + > + for (i = 0; i < fsl_edma->n_chans; i++) { > + fsl_chan = &fsl_edma->chans[i]; > + fsl_edma_chan_mux(fsl_chan, 0, false); > + } > + > + return 0; > +} > + > +static int fsl_edma_pm_resume(struct device *dev) > +{ > + struct fsl_edma_engine *fsl_edma = dev_get_drvdata(dev); > + struct fsl_edma_chan *fsl_chan; > + int i; > + > + for (i = 0; i < fsl_edma->n_chans; i++) { > + fsl_chan = &fsl_edma->chans[i]; > + edma_writew(fsl_edma, 0x0, fsl_edma->membase + EDMA_TCD_CSR(i)); > + /* restore the channel slave id configuration */ > + fsl_edma_chan_mux(fsl_chan, fsl_chan->slave_id, true); Wouldnt this be reconfigured? Should you do this for all channels or active ones. Also I dont see you pausing or suspending active channels or checking for them? -- ~Vinod > + } > + > + edma_writel(fsl_edma, EDMA_CR_ERGA | EDMA_CR_ERCA, > + fsl_edma->membase + EDMA_CR); > + > + return 0; > +} > +#endif > +static > +SIMPLE_DEV_PM_OPS(fsl_edma_pm_ops, fsl_edma_pm_suspend, fsl_edma_pm_resume); > + > static const struct of_device_id fsl_edma_dt_ids[] = { > { .compatible = "fsl,vf610-edma", }, > { /* sentinel */ } > @@ -1027,6 +1064,7 @@ static struct platform_driver fsl_edma_driver = { > .driver = { > .name = "fsl-edma", > .of_match_table = fsl_edma_dt_ids, > + .pm = &fsl_edma_pm_ops, > }, > .probe = fsl_edma_probe, > .remove = fsl_edma_remove, > -- > 1.8.0 > --
next prev parent reply other threads:[~2015-03-05 10:44 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-12-30 8:41 [PATCH 0/2] dmaengine: fsl-edma: add dma memcpy and suspend/resume support Jingchang Lu 2014-12-30 8:41 ` Jingchang Lu 2014-12-30 8:41 ` [PATCH 1/2] dmaengine: fsl-edma: add dma memcpy support Jingchang Lu 2014-12-30 8:41 ` Jingchang Lu 2015-01-14 9:36 ` Jingchang Lu 2015-01-14 9:36 ` Jingchang Lu 2015-01-30 9:00 ` Yao Yuan 2015-01-30 9:00 ` Yao Yuan 2015-01-30 12:39 ` Stefan Agner 2015-01-30 12:39 ` Stefan Agner 2015-02-11 8:06 ` Yao Yuan 2015-02-11 8:06 ` Yao Yuan 2015-03-05 10:39 ` Vinod Koul 2015-03-05 10:39 ` Vinod Koul 2014-12-30 8:41 ` [PATCH 2/2] dmaengine: fsl-edma: add PM suspend/resume support Jingchang Lu 2014-12-30 8:41 ` Jingchang Lu 2015-01-30 13:05 ` Stefan Agner 2015-01-30 13:05 ` Stefan Agner 2015-03-05 10:41 ` Vinod Koul [this message] 2015-03-05 10:41 ` Vinod Koul [not found] <BL2PR03MB3383F18A5096A989DF7DE8F839B0@BL2PR03MB338.namprd03.prod.outlook.com> 2015-07-15 9:23 ` Yao Yuan [not found] <BL2PR03MB33868673832B44DD03ED841839B0@BL2PR03MB338.namprd03.prod.outlook.com> 2015-07-15 9:29 ` Yao Yuan
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20150305104108.GF2613@intel.com \ --to=vinod.koul@intel.com \ --cc=dan.j.williams@intel.com \ --cc=dmaengine@vger.kernel.org \ --cc=g@intel.com \ --cc=jingchang.lu@freescale.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.