Skip to contentSkip to conversation

dw_dmac: add PCI driver and move dw stuff to its own folder

PATCH In review Andy Shevchenko 3 participants 7 messages Oct 30, 2012

Subsystems (2)
lore
Share & tools
lore

Andy Shevchenko

author reviewer
#0 lore raw

cover dw_dmac: add PCI driver and move dw stuff to its own folder

This is split of the dw_dmac to support different platform devices with one core driver. It uses platform_driver model and weak link to the parent driver. The pros and cons are still under discussion here:
http://www.spinics.net/lists/kernel/msg1408495.html

Andy Shevchenko (2):
dma: move dw_dmac driver to an own directory
MAINTAINERS: add recently created files to dw_dmac section

Heikki Krogerus (1):
dmaengine: dw_dmac: add PCI part of the driver

 MAINTAINERS                         |    3 +-
 drivers/dma/Kconfig                 |    9 +++
 drivers/dma/Makefile                |    2 +-
 drivers/dma/dw/Makefile             |    2 +
 drivers/dma/{ => dw}/dw_dmac.c      |    2 +-
 drivers/dma/dw/dw_dmac_pci.c        |  133 +++++++++++++++++++++++++++++++++++
 drivers/dma/{ => dw}/dw_dmac_regs.h |    0
 7 files changed, 147 insertions(+), 4 deletions(-)
 create mode 100644 drivers/dma/dw/Makefile
 rename drivers/dma/{ => dw}/dw_dmac.c (99%)
 create mode 100644 drivers/dma/dw/dw_dmac_pci.c
 rename drivers/dma/{ => dw}/dw_dmac_regs.h (100%)
Signature · 1 line
1.7.10.4
author reviewer
#1 lore raw

PATCH 1/3 dmaengine: dw_dmac: add PCI part of the driver

From: Heikki Krogerus <[email protected]>

This is the PCI part of the DesignWare DMAC driver. The controller is usually used in the Intel hardware such as Medfield.

---
 drivers/dma/Kconfig       |    9 +++
 drivers/dma/Makefile      |    1 +
 drivers/dma/dw_dmac_pci.c |  133 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 143 insertions(+)
 create mode 100644 drivers/dma/dw_dmac_pci.c
drivers/dma/Kconfig +9 -0
index 6761cc8..ae706ca 100644
@@ -100,6 +100,15 @@ config DW_DMAC_BIG_ENDIAN_IO
 
 	  If unsure, use the default setting.
 
+config DW_DMAC_PCI
+	tristate "Synopsys DesignWare AHB DMA support (PCI bus)"
+	depends on PCI
+	select DW_DMAC
+	help
+	  Support the Synopsys DesignWare AHB DMA controller on the platfroms
+	  that provide it as a PCI device. For example, Intel Medfield has
+	  integrated this GPDMA controller.
+
 config AT_HDMAC
 	tristate "Atmel AHB DMA support"
 	depends on ARCH_AT91
drivers/dma/Makefile +1 -0
index 7428fea..15eef5f 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_FSL_DMA) += fsldma.o
 obj-$(CONFIG_MPC512X_DMA) += mpc512x_dma.o
 obj-$(CONFIG_MV_XOR) += mv_xor.o
 obj-$(CONFIG_DW_DMAC) += dw_dmac.o
+obj-$(CONFIG_DW_DMAC_PCI) += dw_dmac_pci.o
 obj-$(CONFIG_AT_HDMAC) += at_hdmac.o
 obj-$(CONFIG_MX3_IPU) += ipu/
 obj-$(CONFIG_TXX9_DMAC) += txx9dmac.o
drivers/dma/dw_dmac_pci.c new file +133 -0

133 lines not on this page · raw message

Signature · 1 line
1.7.10.4
author reviewer
#2 lore raw

PATCH 2/3 dma: move dw_dmac driver to an own directory

In reply to Andy Shevchenko

The dw_dmac driver contains multiple files. To make a management of them more convenient move it to an own directory.

---
 drivers/dma/Makefile                |    3 +--
 drivers/dma/dw/Makefile             |    2 ++
 drivers/dma/{ => dw}/dw_dmac.c      |    2 +-
 drivers/dma/{ => dw}/dw_dmac_pci.c  |    0
 drivers/dma/{ => dw}/dw_dmac_regs.h |    0
 5 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 drivers/dma/dw/Makefile
 rename drivers/dma/{ => dw}/dw_dmac.c (99%)
 rename drivers/dma/{ => dw}/dw_dmac_pci.c (100%)
 rename drivers/dma/{ => dw}/dw_dmac_regs.h (100%)
drivers/dma/Makefile +1 -2
index 15eef5f..122a48a 100644
@@ -11,8 +11,7 @@ obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o
 obj-$(CONFIG_FSL_DMA) += fsldma.o
 obj-$(CONFIG_MPC512X_DMA) += mpc512x_dma.o
 obj-$(CONFIG_MV_XOR) += mv_xor.o
-obj-$(CONFIG_DW_DMAC) += dw_dmac.o
-obj-$(CONFIG_DW_DMAC_PCI) += dw_dmac_pci.o
+obj-$(CONFIG_DW_DMAC) += dw/
 obj-$(CONFIG_AT_HDMAC) += at_hdmac.o
 obj-$(CONFIG_MX3_IPU) += ipu/
 obj-$(CONFIG_TXX9_DMAC) += txx9dmac.o
drivers/dma/dw/Makefile new file +2 -0
new file mode 100644
index 0000000..2edfb24
@@ -0,0 +1,2 @@
+obj-$(CONFIG_DW_DMAC) += dw_dmac.o
+obj-$(CONFIG_DW_DMAC_PCI) += dw_dmac_pci.o
drivers/dma/dw/dw_dmac.c renamed from drivers/dma/dw_dmac.c +1 -1
similarity index 99%
rename from drivers/dma/dw_dmac.c
rename to drivers/dma/dw/dw_dmac.c
index 2c8096d..29aa9d86 100644
@@ -23,8 +23,8 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
+#include "../dmaengine.h"
 #include "dw_dmac_regs.h"
-#include "dmaengine.h"
 
 /*
  * This supports the Synopsys "DesignWare AHB Central DMA Controller",
drivers/dma/dw/dw_dmac_pci.c renamed from drivers/dma/dw_dmac_pci.c +0 -0
similarity index 100%
rename from drivers/dma/dw_dmac_pci.c
rename to drivers/dma/dw/dw_dmac_pci.c
drivers/dma/dw/dw_dmac_regs.h renamed from drivers/dma/dw_dmac_regs.h +0 -0
similarity index 100%
rename from drivers/dma/dw_dmac_regs.h
rename to drivers/dma/dw/dw_dmac_regs.h
Signature · 1 line
1.7.10.4
#3 lore raw

Re: [PATCH 2/3] dma: move dw_dmac driver to an own directory

Hi,

Quoted 23 lines · Andy Shevchenko

The dw_dmac driver contains multiple files. To make a management of them more convenient move it to an own directory.

---
 drivers/dma/Makefile                |    3 +--
 drivers/dma/dw/Makefile             |    2 ++
 drivers/dma/{ => dw}/dw_dmac.c      |    2 +-
 drivers/dma/{ => dw}/dw_dmac_pci.c  |    0
 drivers/dma/{ => dw}/dw_dmac_regs.h |    0
 5 files changed, 4 insertions(+), 3 deletions(-)
 create mode 100644 drivers/dma/dw/Makefile
 rename drivers/dma/{ => dw}/dw_dmac.c (99%)
 rename drivers/dma/{ => dw}/dw_dmac_pci.c (100%)
 rename drivers/dma/{ => dw}/dw_dmac_regs.h (100%)
drivers/dma/Makefile +0 -0
index 15eef5f..122a48a 100644

drivers/dma/Makefile obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o · line 14

Quoted 6 lines
drivers/dma/Makefile +1 -2
@@ -11,8 +11,7 @@ obj-$(CONFIG_INTEL_IOP_ADMA) += iop-adma.o
 obj-$(CONFIG_FSL_DMA) += fsldma.o
 obj-$(CONFIG_MPC512X_DMA) += mpc512x_dma.o
 obj-$(CONFIG_MV_XOR) += mv_xor.o
-obj-$(CONFIG_DW_DMAC) += dw_dmac.o
-obj-$(CONFIG_DW_DMAC_PCI) += dw_dmac_pci.o
+obj-$(CONFIG_DW_DMAC) += dw/

this is wrong, I guess. If you want dw_dmac_pci.o to be statically built-in, but dw_dmac.o to be a dynamic module, according to this Makefile entry, dw_dmac_pci.o will be linked to vmlinux.

Signature · 1 line
balbi
#4 lore raw
In reply to Andy Shevchenko
Quoted 4 lines · Andy Shevchenko

This is split of the dw_dmac to support different platform devices with one core driver. It uses platform_driver model and weak link to the parent driver. The pros and cons are still under discussion here:
http://www.spinics.net/lists/kernel/msg1408495.html

This was the last discussion on earlier thread.

http://www.mail-archive.com/[email protected]/msg327998.html

This is highly discouraged in kernel mailing lists. You must have closed the earlier thread before pushing these patches again for review. This is waste of time for people who are involved in review.

Please close the earlier thread first. I really hoped you agreed to my and Vinod's view there. :)

--
viresh

author reviewer
#5 lore raw

PATCH 3/3 MAINTAINERS: add recently created files to dw_dmac section

In reply to Andy Shevchenko

The DesignWare DMAC driver is moved to an own directory. The patch updates MAINTAINERS file accordingly.

---
 MAINTAINERS |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
MAINTAINERS +1 -2
index a2a3434..edf99d0 100644
@@ -6293,8 +6293,7 @@ SYNOPSYS DESIGNWARE DMAC DRIVER
 M:	Viresh Kumar <[email protected]>
 S:	Maintained
 F:	include/linux/dw_dmac.h
-F:	drivers/dma/dw_dmac_regs.h
-F:	drivers/dma/dw_dmac.c
+F:	drivers/dma/dw/
 
 TIMEKEEPING, NTP
 M:	John Stultz <[email protected]>
Signature · 1 line
1.7.10.4
#6 lore raw

Re: [PATCH 3/3] MAINTAINERS: add recently created files to dw_dmac section

Quoted 7 lines · Andy Shevchenko

The DesignWare DMAC driver is moved to an own directory. The patch updates MAINTAINERS file accordingly.

---
 MAINTAINERS |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

I don't agree with the order of patches. Why create *pci.c file first and then move it
to some other folder.

I would have done following:
PATCH 1/2: Merge of your 2/3 and 3/3
PATCH 2/2: Your 1/3

--
viresh