sudmac: add support for SUDMAC
PATCH v7 2/2 sudmac: add support for SUDMAC
Some Renesas USB modules have SUDMAC. This patch supports it using the shdma-base driver.
---
about v7:
- rebase this patch on the current remotes/origin/next branch of slave-dma.git.
- change year of copyright from 2012 to 2013.
- remove non user friendly variables.
- change sudmac_dma_halt() as inline function.
- remove original copyright in include/linux/sudmac.h
drivers/dma/Makefile | 1 + drivers/dma/sh/Kconfig | 8 + drivers/dma/sh/Makefile | 1 + drivers/dma/sh/sudmac.c | 428 +++++++++++++++++++++++++++++++++++++++++++++++ include/linux/sudmac.h | 52 ++++++ 5 files changed, 490 insertions(+), 0 deletions(-) create mode 100644 drivers/dma/sh/sudmac.c create mode 100644 include/linux/sudmac.h
drivers/dma/Makefile +1 -0
@@ -20,6 +20,7 @@ obj-$(CONFIG_AT_HDMAC) += at_hdmac.o obj-$(CONFIG_MX3_IPU) += ipu/ obj-$(CONFIG_TXX9_DMAC) += txx9dmac.o obj-$(CONFIG_SH_DMAE) += sh/ +obj-$(CONFIG_SUDMAC) += sh/ obj-$(CONFIG_COH901318) += coh901318.o coh901318_lli.o obj-$(CONFIG_AMCC_PPC440SPE_ADMA) += ppc4xx/ obj-$(CONFIG_IMX_SDMA) += imx-sdma.o
drivers/dma/sh/Kconfig +8 -0
@@ -9,3 +9,11 @@ config SH_DMAE select DMA_ENGINE help Enable support for the Renesas SuperH DMA controllers. + +config SUDMAC + tristate "Renesas SUDMAC support" + depends on (SUPERH && SH_DMA) || (ARM && ARCH_SHMOBILE) + depends on !SH_DMA_API + select DMA_ENGINE + help + Enable support for the Renesas SUDMAC controllers.
drivers/dma/sh/Makefile +1 -0
@@ -1,2 +1,3 @@ obj-$(CONFIG_SH_DMAE) += shdma-base.o obj-$(CONFIG_SH_DMAE) += shdma.o +obj-$(CONFIG_SUDMAC) += shdma-base.o sudmac.o
drivers/dma/sh/sudmac.c new file +428 -0
428 lines not on this page · raw message
include/linux/sudmac.h new file +52 -0
52 lines not on this page · raw message
Signature · 1 line
1.7.1
Hi Shimoda-san
Thank you for your patches.
Quoted 6 lines
Some Renesas USB modules have SUDMAC. This patch supports it using the shdma-base driver.
Signed-off-by Yoshihiro Shimoda <[email protected]>Reviewed-by Guennadi Liakhovetski <[email protected]>---
(snip)
Quoted 12 lines
drivers/dma/sh/Kconfig +7
-0+config SUDMAC + tristate "Renesas SUDMAC support" + depends on (SUPERH && SH_DMA) || (ARM && ARCH_SHMOBILE) + depends on !SH_DMA_API + select DMA_ENGINE + help + Enable support for the Renesas SUDMAC controllers.drivers/dma/sh/Makefile +0
-0
drivers/dma/sh/Makefile line 3
Quoted 3 lines
drivers/dma/sh/Makefile +1
-0@@ -1,2 +1,3 @@ obj-$(CONFIG_SH_DMAE) += shdma-base.o obj-$(CONFIG_SH_DMAE) += shdma.o +obj-$(CONFIG_SUDMAC) += shdma-base.o sudmac.o
I'm not sure detail of it, but, I thought we can do like this. Is it possible ?
--- Kconfig ---
config SH_DMAE_BASE
xxx
config SH_DMAE
xxx
depends on SH_DMAE_BASE
config SH_SUDMAC
xxx
depends on SH_DMAE_BASE
--- Makefile ---
obj-$(CONFIG_SH_DMAE_BASE) += shdma-base.o
obj-$(CONFIG_SH_DMAE) += shdma.o
obj-$(CONFIG_SUDMAC) += sudmac.o
Best regards
---
Kuninori Morimoto
Hi Morimoto-san,
Thank you for the comment.
(2013/04/23 9:41), Kuninori Morimoto wrote:
< snip >
Quoted 11 lines
drivers/dma/sh/Makefile line 3
Quoted 8 lines
drivers/dma/sh/Makefile +1
-0@@ -1,2 +1,3 @@ obj-$(CONFIG_SH_DMAE) += shdma-base.o obj-$(CONFIG_SH_DMAE) += shdma.o +obj-$(CONFIG_SUDMAC) += shdma-base.o sudmac.oI'm not sure detail of it, but, I thought we can do like this. Is it possible ?
It is possible, I think.
But,
Quoted 11 lines
---
Kconfig---
configSH_DMAE_BASE
xxxconfig
SH_DMAE
xxx
depends onSH_DMAE_BASEconfig
SH_SUDMAC
xxx
depends onSH_DMAE_BASE
it can choose the SH_DMAE_BASE only, but we will use "SH_DMAE_BASE && SH_DMAE" or "SH_DMAE_BASE && SH_SUDMAC". So, I intend to modify the Kconfig like the "config DMA_ENGINE":
--- Kconfig ---
config SH_DMAE
xxx
select SH_DMAE_BASE
config SUDMAC
xxx
select SH_DMAE_BASE
---------------
What do you think about this?
Quoted 5 lines
---
Makefile---obj-$(CONFIG_SH_DMAE_BASE) += shdma-base.o
obj-$(CONFIG_SH_DMAE) += shdma.o
obj-$(CONFIG_SUDMAC) += sudmac.o
I think it is nice.
Best regards,
Yoshihiro Shimoda
Quoted 4 lines
Best regards
---
Kuninori Morimoto
Hi Shimoda-san
Quoted 9 lines
it can choose the
SH_DMAE_BASEonly, but we will use "SH_DMAE_BASE&&SH_DMAE" or "SH_DMAE_BASE&&SH_SUDMAC". So, I intend to modify theKconfiglike the "configDMA_ENGINE":---
Kconfig---
configSH_DMAE
xxx
selectSH_DMAE_BASE
Quoted 6 lines
config SUDMAC
xxx
selectSH_DMAE_BASE
---------------What do you think about this?
Thank you
Selecting SH_DMAE_BASE only is not so strange for me, and (as you mentioned F2F), some driver already depends on it. So this SH_DMAE_BASE should be y, and SH_DMAE/SUDMAC should depend on it.
I guess this is naturally Kconfig for me
config SH_DMAE_BASE
bool xxx default y if (SH_MOBLE && SH)
config SH_DMAE
xxxx
depends on SH_DMAE_BASE
config SUDMAC
xxxx
depends on SH_DMAE_BASE
BTW, "SH_DMAE" is mismatch naming, I guess "SHDMAC" is better ?
Best regards
---
Kuninori Morimoto
Quoted 20 lines · Kuninori Morimoto
Hi Shimoda-san
Quoted 9 lines
it can choose the
SH_DMAE_BASEonly, but we will use "SH_DMAE_BASE&&SH_DMAE" or "SH_DMAE_BASE&&SH_SUDMAC". So, I intend to modify theKconfiglike the "configDMA_ENGINE":---
Kconfig---
configSH_DMAE
xxx
selectSH_DMAE_BASEQuoted 6 lines
config SUDMAC
xxx
selectSH_DMAE_BASE
---------------What do you think about this?
Quoted 6 lines
Thank you
Selecting
SH_DMAE_BASEonly is not so strange for me, and (as you mentioned F2F), some driver already depends on it. So thisSH_DMAE_BASEshould be y, and SH_DMAE/SUDMAC should depend on it.
What I would expect a decent config to do is have the driver symbol slect whatever it needs
something like
config SH_BASE
config SH_DMAE
config SUDMAC
select SH_DMAE
select SH_BASE
etc, its nice to have simpler config and driver options. Driver selects all that it needs :)
Btw the driver patch looks sane to me. So once you have sorted what you guys want here, I think its good for merge.
--
~Vinod
Quoted 20 lines
I guess this is naturally
Kconfigfor meconfig
SH_DMAE_BASEbool xxx default y if (SH_MOBLE && SH)config
SH_DMAE
xxxx
depends onSH_DMAE_BASEconfig SUDMAC
xxxx
depends onSH_DMAE_BASEBTW, "
SH_DMAE" is mismatch naming, I guess "SHDMAC" is better ?Best regards
---
Kuninori Morimoto
Hi Vinod,
Quoted 1 line · Vinod Koul
On Mon, Apr 22, 2013 at 10:08:45PM -0700, Kuninori Morimoto wrote:
< snip >
Quoted 16 lines
Quoted 4 lines
Selecting
SH_DMAE_BASEonly is not so strange for me, and (as you mentioned F2F), some driver already depends on it. So thisSH_DMAE_BASEshould be y, and SH_DMAE/SUDMAC should depend on it.What I would expect a decent config to do is have the driver symbol slect whatever it needs
something like
configSH_BASEconfig
SH_DMAEconfig SUDMAC
selectSH_DMAE
selectSH_BASE
Quoted 5 lines
etc, its nice to have simpler config and driver options. Driver selects all that it needs :)
Btw the driver patch looks sane to me. So once you have sorted what you guys want here, I think its good for merge.
Thank you for the comment. I will send new patches soon.
Best regards,
Yoshihiro shimoda
Quoted 23 lines
--
~VinodQuoted 20 lines
I guess this is naturally
Kconfigfor meconfig
SH_DMAE_BASEbool xxx default y if (SH_MOBLE && SH)config
SH_DMAE
xxxx
depends onSH_DMAE_BASEconfig SUDMAC
xxxx
depends onSH_DMAE_BASEBTW, "
SH_DMAE" is mismatch naming, I guess "SHDMAC" is better ?Best regards
---
Kuninori Morimoto