From: Qiao Zhou <zhouqiao@marvell.com> To: dan.j.williams@intel.com, vinod.koul@intel.com, dmaengine@vger.kernel.org, zhangfei.gao@gmail.com, eric.y.miao@gmail.com, haojian.zhuang@gmail.com, linux@arm.linux.org.uk, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.de, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org Cc: Qiao Zhou <zhouqiao@marvell.com> Subject: [PATCH 1/2] dma: mmp_tdma: add DMA_PREP_INTERRUPT flag support Date: Wed, 10 Sep 2014 16:40:48 +0800 [thread overview] Message-ID: <1410338449-13961-1-git-send-email-zhouqiao@marvell.com> (raw) add DMA_PREP_INTERRUPT flag to support no_period_wakeup, in which user space app doesn't want audio interrupt to wake up audio threads. Signed-off-by: Qiao Zhou <zhouqiao@marvell.com> --- drivers/dma/mmp_tdma.c | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c index 6ad30e2..c6bd015 100644 --- a/drivers/dma/mmp_tdma.c +++ b/drivers/dma/mmp_tdma.c @@ -148,10 +148,16 @@ static void mmp_tdma_chan_set_desc(struct mmp_tdma_chan *tdmac, dma_addr_t phys) tdmac->reg_base + TDCR); } +static void mmp_tdma_enable_irq(struct mmp_tdma_chan *tdmac, bool enable) +{ + if (enable) + writel(TDIMR_COMP, tdmac->reg_base + TDIMR); + else + writel(0, tdmac->reg_base + TDIMR); +} + static void mmp_tdma_enable_chan(struct mmp_tdma_chan *tdmac) { - /* enable irq */ - writel(TDIMR_COMP, tdmac->reg_base + TDIMR); /* enable dma chan */ writel(readl(tdmac->reg_base + TDCR) | TDCR_CHANEN, tdmac->reg_base + TDCR); @@ -163,9 +169,6 @@ static void mmp_tdma_disable_chan(struct mmp_tdma_chan *tdmac) writel(readl(tdmac->reg_base + TDCR) & ~TDCR_CHANEN, tdmac->reg_base + TDCR); - /* disable irq */ - writel(0, tdmac->reg_base + TDIMR); - tdmac->status = DMA_COMPLETE; } @@ -434,6 +437,10 @@ static struct dma_async_tx_descriptor *mmp_tdma_prep_dma_cyclic( i++; } + /* enable interrupt */ + if (flags & DMA_PREP_INTERRUPT) + mmp_tdma_enable_irq(tdmac, true); + tdmac->buf_len = buf_len; tdmac->period_len = period_len; tdmac->pos = 0; @@ -455,6 +462,8 @@ static int mmp_tdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, switch (cmd) { case DMA_TERMINATE_ALL: mmp_tdma_disable_chan(tdmac); + /* disable interrupt */ + mmp_tdma_enable_irq(tdmac, false); break; case DMA_PAUSE: mmp_tdma_pause_chan(tdmac); -- 1.7.0.4
WARNING: multiple messages have this Message-ID (diff)
From: zhouqiao@marvell.com (Qiao Zhou) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] dma: mmp_tdma: add DMA_PREP_INTERRUPT flag support Date: Wed, 10 Sep 2014 16:40:48 +0800 [thread overview] Message-ID: <1410338449-13961-1-git-send-email-zhouqiao@marvell.com> (raw) add DMA_PREP_INTERRUPT flag to support no_period_wakeup, in which user space app doesn't want audio interrupt to wake up audio threads. Signed-off-by: Qiao Zhou <zhouqiao@marvell.com> --- drivers/dma/mmp_tdma.c | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c index 6ad30e2..c6bd015 100644 --- a/drivers/dma/mmp_tdma.c +++ b/drivers/dma/mmp_tdma.c @@ -148,10 +148,16 @@ static void mmp_tdma_chan_set_desc(struct mmp_tdma_chan *tdmac, dma_addr_t phys) tdmac->reg_base + TDCR); } +static void mmp_tdma_enable_irq(struct mmp_tdma_chan *tdmac, bool enable) +{ + if (enable) + writel(TDIMR_COMP, tdmac->reg_base + TDIMR); + else + writel(0, tdmac->reg_base + TDIMR); +} + static void mmp_tdma_enable_chan(struct mmp_tdma_chan *tdmac) { - /* enable irq */ - writel(TDIMR_COMP, tdmac->reg_base + TDIMR); /* enable dma chan */ writel(readl(tdmac->reg_base + TDCR) | TDCR_CHANEN, tdmac->reg_base + TDCR); @@ -163,9 +169,6 @@ static void mmp_tdma_disable_chan(struct mmp_tdma_chan *tdmac) writel(readl(tdmac->reg_base + TDCR) & ~TDCR_CHANEN, tdmac->reg_base + TDCR); - /* disable irq */ - writel(0, tdmac->reg_base + TDIMR); - tdmac->status = DMA_COMPLETE; } @@ -434,6 +437,10 @@ static struct dma_async_tx_descriptor *mmp_tdma_prep_dma_cyclic( i++; } + /* enable interrupt */ + if (flags & DMA_PREP_INTERRUPT) + mmp_tdma_enable_irq(tdmac, true); + tdmac->buf_len = buf_len; tdmac->period_len = period_len; tdmac->pos = 0; @@ -455,6 +462,8 @@ static int mmp_tdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, switch (cmd) { case DMA_TERMINATE_ALL: mmp_tdma_disable_chan(tdmac); + /* disable interrupt */ + mmp_tdma_enable_irq(tdmac, false); break; case DMA_PAUSE: mmp_tdma_pause_chan(tdmac); -- 1.7.0.4
next reply other threads:[~2014-09-10 8:40 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-09-10 8:40 Qiao Zhou [this message] 2014-09-10 8:40 ` [PATCH 1/2] dma: mmp_tdma: add DMA_PREP_INTERRUPT flag support Qiao Zhou 2014-09-10 8:40 ` [PATCH 2/2] ASoC: mmp-pcm: add NO_PERIOD_WAKEUP for PCM INFO Qiao Zhou 2014-09-10 8:40 ` Qiao Zhou 2014-09-10 9:41 ` Mark Brown 2014-09-10 9:41 ` Mark Brown 2014-09-11 5:19 ` Vinod Koul 2014-09-11 5:19 ` Vinod Koul 2014-09-11 5:18 ` [PATCH 1/2] dma: mmp_tdma: add DMA_PREP_INTERRUPT flag support Vinod Koul 2014-09-11 5:18 ` Vinod Koul
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=1410338449-13961-1-git-send-email-zhouqiao@marvell.com \ --to=zhouqiao@marvell.com \ --cc=alsa-devel@alsa-project.org \ --cc=broonie@kernel.org \ --cc=dan.j.williams@intel.com \ --cc=dmaengine@vger.kernel.org \ --cc=eric.y.miao@gmail.com \ --cc=haojian.zhuang@gmail.com \ --cc=lgirdwood@gmail.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux@arm.linux.org.uk \ --cc=perex@perex.cz \ --cc=tiwai@suse.de \ --cc=vinod.koul@intel.com \ --cc=zhangfei.gao@gmail.com \ /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.