* [RFC][PATCH 2/6] dmaengine: shdma: add chcr_ie_bit
@ 2011-06-17 3:39 Kuninori Morimoto
2011-06-17 4:45 ` Simon Horman
0 siblings, 1 reply; 2+ messages in thread
From: Kuninori Morimoto @ 2011-06-17 3:39 UTC (permalink / raw)
To: linux-sh
IE bit position on CHCR register is not same in all DMAC.
This patch adds new "int chcr_ie_bit" to decide it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
drivers/dma/shdma.c | 11 +++++++++--
drivers/dma/shdma.h | 1 +
include/linux/sh_dma.h | 1 +
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
index 40900c1..9412de3 100644
--- a/drivers/dma/shdma.c
+++ b/drivers/dma/shdma.c
@@ -181,17 +181,19 @@ static void dmae_set_reg(struct sh_dmae_chan *sh_chan, struct sh_dmae_regs *hw)
static void dmae_start(struct sh_dmae_chan *sh_chan)
{
+ struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
u32 chcr = chcr_read(sh_chan);
- chcr |= CHCR_DE | CHCR_IE;
+ chcr |= CHCR_DE | shdev->chcr_ie_bit;
chcr_write(sh_chan, chcr & ~CHCR_TE);
}
static void dmae_halt(struct sh_dmae_chan *sh_chan)
{
+ struct sh_dmae_device *shdev = to_sh_dev(sh_chan);
u32 chcr = chcr_read(sh_chan);
- chcr &= ~(CHCR_DE | CHCR_TE | CHCR_IE);
+ chcr &= ~(CHCR_DE | CHCR_TE | shdev->chcr_ie_bit);
chcr_write(sh_chan, chcr);
}
@@ -1157,6 +1159,11 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
else
shdev->chcr_offset = CHCR;
+ if (pdata->chcr_ie_bit)
+ shdev->chcr_ie_bit = pdata->chcr_ie_bit;
+ else
+ shdev->chcr_ie_bit = CHCR_IE;
+
platform_set_drvdata(pdev, shdev);
pm_runtime_enable(&pdev->dev);
diff --git a/drivers/dma/shdma.h b/drivers/dma/shdma.h
index 1305b67..30fceaf 100644
--- a/drivers/dma/shdma.h
+++ b/drivers/dma/shdma.h
@@ -48,6 +48,7 @@ struct sh_dmae_device {
u32 __iomem *chan_reg;
u16 __iomem *dmars;
u32 chcr_offset;
+ u32 chcr_ie_bit;
};
#define to_sh_chan(chan) container_of(chan, struct sh_dmae_chan, common)
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index 4f2cad9..dab2ddc 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -63,6 +63,7 @@ struct sh_dmae_pdata {
int ts_shift_num;
u16 dmaor_init;
u32 chcr_offset;
+ u32 chcr_ie_bit;
};
/* DMA register */
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-17 4:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-17 3:39 [RFC][PATCH 2/6] dmaengine: shdma: add chcr_ie_bit Kuninori Morimoto
2011-06-17 4:45 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox