All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality
@ 2012-05-04 12:12 ` Dong Aisheng
  0 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: b32955-KZfg59tc24xl57MIdRCFDg, vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	marek.vasut-Re5JQEeQqe8AvxtiuMwx3w,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ

From: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

This can get rid of the mach-dependency.

Cc: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Huang Shijie <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Reviewed-by: Marek Vasut <marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
This patch depends on Wolfram's
[PATCH V2 1/3] lib: add support for stmp-style devices
http://www.spinics.net/lists/arm-kernel/msg166232.html
which is still not in mainline.
---
 drivers/dma/Kconfig   |    1 +
 drivers/dma/mxs-dma.c |   27 +++++++++++++--------------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index ef378b5..aadeb5b 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -238,6 +238,7 @@ config IMX_DMA
 config MXS_DMA
 	bool "MXS DMA support"
 	depends on SOC_IMX23 || SOC_IMX28
+	select STMP_DEVICE
 	select DMA_ENGINE
 	help
 	  Support the MXS DMA engine. This engine including APBH-DMA
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 655d4ce..0fefdd3 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -23,10 +23,9 @@
 #include <linux/dmaengine.h>
 #include <linux/delay.h>
 #include <linux/fsl/mxs-dma.h>
+#include <linux/stmp_device.h>
 
 #include <asm/irq.h>
-#include <mach/mxs.h>
-#include <mach/common.h>
 
 #include "dmaengine.h"
 
@@ -138,10 +137,10 @@ static void mxs_dma_reset_chan(struct mxs_dma_chan *mxs_chan)
 
 	if (dma_is_apbh() && apbh_is_old())
 		writel(1 << (chan_id + BP_APBH_CTRL0_RESET_CHANNEL),
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 	else
 		writel(1 << (chan_id + BP_APBHX_CHANNEL_CTRL_RESET_CHANNEL),
-			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_SET);
 }
 
 static void mxs_dma_enable_chan(struct mxs_dma_chan *mxs_chan)
@@ -170,10 +169,10 @@ static void mxs_dma_pause_chan(struct mxs_dma_chan *mxs_chan)
 	/* freeze the channel */
 	if (dma_is_apbh() && apbh_is_old())
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 	else
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_SET);
 
 	mxs_chan->status = DMA_PAUSED;
 }
@@ -186,10 +185,10 @@ static void mxs_dma_resume_chan(struct mxs_dma_chan *mxs_chan)
 	/* unfreeze the channel */
 	if (dma_is_apbh() && apbh_is_old())
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_CLR_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_CLR);
 	else
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_CLR_ADDR);
+			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_CLR);
 
 	mxs_chan->status = DMA_IN_PROGRESS;
 }
@@ -220,11 +219,11 @@ static irqreturn_t mxs_dma_int_handler(int irq, void *dev_id)
 	/* completion status */
 	stat1 = readl(mxs_dma->base + HW_APBHX_CTRL1);
 	stat1 &= MXS_DMA_CHANNELS_MASK;
-	writel(stat1, mxs_dma->base + HW_APBHX_CTRL1 + MXS_CLR_ADDR);
+	writel(stat1, mxs_dma->base + HW_APBHX_CTRL1 + STMP_OFFSET_REG_CLR);
 
 	/* error status */
 	stat2 = readl(mxs_dma->base + HW_APBHX_CTRL2);
-	writel(stat2, mxs_dma->base + HW_APBHX_CTRL2 + MXS_CLR_ADDR);
+	writel(stat2, mxs_dma->base + HW_APBHX_CTRL2 + STMP_OFFSET_REG_CLR);
 
 	/*
 	 * When both completion and error of termination bits set at the
@@ -567,7 +566,7 @@ static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma)
 	if (ret)
 		return ret;
 
-	ret = mxs_reset_block(mxs_dma->base);
+	ret = stmp_reset_block(mxs_dma->base);
 	if (ret)
 		goto err_out;
 
@@ -580,14 +579,14 @@ static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma)
 	/* enable apbh burst */
 	if (dma_is_apbh()) {
 		writel(BM_APBH_CTRL0_APB_BURST_EN,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 		writel(BM_APBH_CTRL0_APB_BURST8_EN,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 	}
 
 	/* enable irq for all the channels */
 	writel(MXS_DMA_CHANNELS_MASK << MXS_DMA_CHANNELS,
-		mxs_dma->base + HW_APBHX_CTRL1 + MXS_SET_ADDR);
+		mxs_dma->base + HW_APBHX_CTRL1 + STMP_OFFSET_REG_SET);
 
 err_out:
 	clk_disable_unprepare(mxs_dma->clk);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality
@ 2012-05-04 12:12 ` Dong Aisheng
  0 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel

From: Dong Aisheng <dong.aisheng@linaro.org>

This can get rid of the mach-dependency.

Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Huang Shijie <b32955@freescale.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
This patch depends on Wolfram's
[PATCH V2 1/3] lib: add support for stmp-style devices
http://www.spinics.net/lists/arm-kernel/msg166232.html
which is still not in mainline.
---
 drivers/dma/Kconfig   |    1 +
 drivers/dma/mxs-dma.c |   27 +++++++++++++--------------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index ef378b5..aadeb5b 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -238,6 +238,7 @@ config IMX_DMA
 config MXS_DMA
 	bool "MXS DMA support"
 	depends on SOC_IMX23 || SOC_IMX28
+	select STMP_DEVICE
 	select DMA_ENGINE
 	help
 	  Support the MXS DMA engine. This engine including APBH-DMA
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 655d4ce..0fefdd3 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -23,10 +23,9 @@
 #include <linux/dmaengine.h>
 #include <linux/delay.h>
 #include <linux/fsl/mxs-dma.h>
+#include <linux/stmp_device.h>
 
 #include <asm/irq.h>
-#include <mach/mxs.h>
-#include <mach/common.h>
 
 #include "dmaengine.h"
 
@@ -138,10 +137,10 @@ static void mxs_dma_reset_chan(struct mxs_dma_chan *mxs_chan)
 
 	if (dma_is_apbh() && apbh_is_old())
 		writel(1 << (chan_id + BP_APBH_CTRL0_RESET_CHANNEL),
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 	else
 		writel(1 << (chan_id + BP_APBHX_CHANNEL_CTRL_RESET_CHANNEL),
-			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_SET);
 }
 
 static void mxs_dma_enable_chan(struct mxs_dma_chan *mxs_chan)
@@ -170,10 +169,10 @@ static void mxs_dma_pause_chan(struct mxs_dma_chan *mxs_chan)
 	/* freeze the channel */
 	if (dma_is_apbh() && apbh_is_old())
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 	else
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_SET);
 
 	mxs_chan->status = DMA_PAUSED;
 }
@@ -186,10 +185,10 @@ static void mxs_dma_resume_chan(struct mxs_dma_chan *mxs_chan)
 	/* unfreeze the channel */
 	if (dma_is_apbh() && apbh_is_old())
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_CLR_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_CLR);
 	else
 		writel(1 << chan_id,
-			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + MXS_CLR_ADDR);
+			mxs_dma->base + HW_APBHX_CHANNEL_CTRL + STMP_OFFSET_REG_CLR);
 
 	mxs_chan->status = DMA_IN_PROGRESS;
 }
@@ -220,11 +219,11 @@ static irqreturn_t mxs_dma_int_handler(int irq, void *dev_id)
 	/* completion status */
 	stat1 = readl(mxs_dma->base + HW_APBHX_CTRL1);
 	stat1 &= MXS_DMA_CHANNELS_MASK;
-	writel(stat1, mxs_dma->base + HW_APBHX_CTRL1 + MXS_CLR_ADDR);
+	writel(stat1, mxs_dma->base + HW_APBHX_CTRL1 + STMP_OFFSET_REG_CLR);
 
 	/* error status */
 	stat2 = readl(mxs_dma->base + HW_APBHX_CTRL2);
-	writel(stat2, mxs_dma->base + HW_APBHX_CTRL2 + MXS_CLR_ADDR);
+	writel(stat2, mxs_dma->base + HW_APBHX_CTRL2 + STMP_OFFSET_REG_CLR);
 
 	/*
 	 * When both completion and error of termination bits set at the
@@ -567,7 +566,7 @@ static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma)
 	if (ret)
 		return ret;
 
-	ret = mxs_reset_block(mxs_dma->base);
+	ret = stmp_reset_block(mxs_dma->base);
 	if (ret)
 		goto err_out;
 
@@ -580,14 +579,14 @@ static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma)
 	/* enable apbh burst */
 	if (dma_is_apbh()) {
 		writel(BM_APBH_CTRL0_APB_BURST_EN,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 		writel(BM_APBH_CTRL0_APB_BURST8_EN,
-			mxs_dma->base + HW_APBHX_CTRL0 + MXS_SET_ADDR);
+			mxs_dma->base + HW_APBHX_CTRL0 + STMP_OFFSET_REG_SET);
 	}
 
 	/* enable irq for all the channels */
 	writel(MXS_DMA_CHANNELS_MASK << MXS_DMA_CHANNELS,
-		mxs_dma->base + HW_APBHX_CTRL1 + MXS_SET_ADDR);
+		mxs_dma->base + HW_APBHX_CTRL1 + STMP_OFFSET_REG_SET);
 
 err_out:
 	clk_disable_unprepare(mxs_dma->clk);
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
  2012-05-04 12:12 ` Dong Aisheng
@ 2012-05-04 12:12   ` Dong Aisheng
  -1 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: b32955, vinod.koul, devicetree-discuss, rob.herring,
	grant.likely, marek.vasut, kernel, dan.j.williams, s.hauer,
	shawn.guo

From: Dong Aisheng <dong.aisheng@linaro.org>

Rewrite mxs_dma_is_apbh and mxs_dma_is_apbx in order to support
other SoCs like imx6q and reform the platform_device_id for the
better further dt support.

Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Huang Shijie <b32955@freescale.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
ChangeLog v1->v2:
* remove using mxs_dma->version
* other minor fixes suggested by Shawn.
---
 arch/arm/mach-mxs/clock-mx23.c           |    4 +-
 arch/arm/mach-mxs/clock-mx28.c           |    4 +-
 arch/arm/mach-mxs/devices/platform-dma.c |   14 ++--
 drivers/dma/mxs-dma.c                    |  115 ++++++++++++++++++++---------
 include/linux/fsl/mxs-dma.h              |   12 +---
 5 files changed, 93 insertions(+), 56 deletions(-)

diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
index e3ac52c..1e67b85 100644
--- a/arch/arm/mach-mxs/clock-mx23.c
+++ b/arch/arm/mach-mxs/clock-mx23.c
@@ -427,8 +427,8 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK("duart", NULL, uart_clk)
 	_REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
-	_REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
-	_REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
+	_REGISTER_CLOCK("imx23-dma-apbh", NULL, hbus_clk)
+	_REGISTER_CLOCK("imx23-dma-apbx", NULL, xbus_clk)
 	_REGISTER_CLOCK("mxs-mmc.0", NULL, ssp_clk)
 	_REGISTER_CLOCK("mxs-mmc.1", NULL, ssp_clk)
 	_REGISTER_CLOCK(NULL, "usb", usb_clk)
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index 1867a17..cca2cf7 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -625,8 +625,8 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK("mxs-auart.4", NULL, uart_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK("pll2", NULL, pll2_clk)
-	_REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
-	_REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
+	_REGISTER_CLOCK("imx28-dma-apbh", NULL, hbus_clk)
+	_REGISTER_CLOCK("imx28-dma-apbx", NULL, xbus_clk)
 	_REGISTER_CLOCK("mxs-mmc.0", NULL, ssp0_clk)
 	_REGISTER_CLOCK("mxs-mmc.1", NULL, ssp1_clk)
 	_REGISTER_CLOCK("mxs-mmc.2", NULL, ssp2_clk)
diff --git a/arch/arm/mach-mxs/devices/platform-dma.c b/arch/arm/mach-mxs/devices/platform-dma.c
index 6a0202b..aff4813 100644
--- a/arch/arm/mach-mxs/devices/platform-dma.c
+++ b/arch/arm/mach-mxs/devices/platform-dma.c
@@ -32,17 +32,19 @@ static struct platform_device *__init mxs_add_dma(const char *devid,
 
 static int __init mxs_add_mxs_dma(void)
 {
-	char *apbh = "mxs-dma-apbh";
-	char *apbx = "mxs-dma-apbx";
+	char *mx23_apbh = "imx23-dma-apbh";
+	char *mx23_apbx = "imx23-dma-apbx";
+	char *mx28_apbh = "imx28-dma-apbh";
+	char *mx28_apbx = "imx28-dma-apbx";
 
 	if (cpu_is_mx23()) {
-		mxs_add_dma(apbh, MX23_APBH_DMA_BASE_ADDR);
-		mxs_add_dma(apbx, MX23_APBX_DMA_BASE_ADDR);
+		mxs_add_dma(mx23_apbh, MX23_APBH_DMA_BASE_ADDR);
+		mxs_add_dma(mx23_apbx, MX23_APBX_DMA_BASE_ADDR);
 	}
 
 	if (cpu_is_mx28()) {
-		mxs_add_dma(apbh, MX28_APBH_DMA_BASE_ADDR);
-		mxs_add_dma(apbx, MX28_APBX_DMA_BASE_ADDR);
+		mxs_add_dma(mx28_apbh, MX28_APBH_DMA_BASE_ADDR);
+		mxs_add_dma(mx28_apbx, MX28_APBX_DMA_BASE_ADDR);
 	}
 
 	return 0;
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 0fefdd3..d8505d3 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -35,12 +35,8 @@
  * dma can program the controller registers of peripheral devices.
  */
 
-#define MXS_DMA_APBH		0
-#define MXS_DMA_APBX		1
-#define dma_is_apbh()		(mxs_dma->dev_id == MXS_DMA_APBH)
-
-#define APBH_VERSION_LATEST	3
-#define apbh_is_old()		(mxs_dma->version < APBH_VERSION_LATEST)
+#define dma_is_apbh()		(mxs_dma->type == MXS_DMA_APBH)
+#define apbh_is_old()		(mxs_dma->dev_id == IMX23_DMA)
 
 #define HW_APBHX_CTRL0				0x000
 #define BM_APBH_CTRL0_APB_BURST8_EN		(1 << 29)
@@ -50,9 +46,6 @@
 #define HW_APBHX_CTRL2				0x020
 #define HW_APBHX_CHANNEL_CTRL			0x030
 #define BP_APBHX_CHANNEL_CTRL_RESET_CHANNEL	16
-#define HW_APBH_VERSION				(cpu_is_mx23() ? 0x3f0 : 0x800)
-#define HW_APBX_VERSION				0x800
-#define BP_APBHX_VERSION_MAJOR			24
 #define HW_APBHX_CHn_NXTCMDAR(n) \
 	(((dma_is_apbh() && apbh_is_old()) ? 0x050 : 0x110) + (n) * 0x70)
 #define HW_APBHX_CHn_SEMA(n) \
@@ -120,9 +113,19 @@ struct mxs_dma_chan {
 #define MXS_DMA_CHANNELS		16
 #define MXS_DMA_CHANNELS_MASK		0xffff
 
+enum mxs_dma_devtype {
+	MXS_DMA_APBH,
+	MXS_DMA_APBX,
+};
+
+enum mxs_dma_id {
+	IMX23_DMA,
+	IMX28_DMA,
+};
+
 struct mxs_dma_engine {
-	int				dev_id;
-	unsigned int			version;
+	enum mxs_dma_id			dev_id;
+	enum mxs_dma_devtype		type;
 	void __iomem			*base;
 	struct clk			*clk;
 	struct dma_device		dma_device;
@@ -130,6 +133,66 @@ struct mxs_dma_engine {
 	struct mxs_dma_chan		mxs_chans[MXS_DMA_CHANNELS];
 };
 
+struct mxs_dma_type {
+	enum mxs_dma_id id;
+	enum mxs_dma_devtype type;
+};
+
+static struct mxs_dma_type mxs_dma_types[] = {
+	{
+		.id = IMX23_DMA,
+		.type = MXS_DMA_APBH,
+	}, {
+		.id = IMX23_DMA,
+		.type = MXS_DMA_APBX,
+	}, {
+		.id = IMX28_DMA,
+		.type = MXS_DMA_APBH,
+	}, {
+		.id = IMX28_DMA,
+		.type = MXS_DMA_APBX,
+	}
+};
+
+static struct platform_device_id mxs_dma_ids[] = {
+	{
+		.name = "imx23-dma-apbh",
+		.driver_data = (kernel_ulong_t) &mxs_dma_types[0],
+	}, {
+		.name = "imx23-dma-apbx",
+		.driver_data = (kernel_ulong_t) &mxs_dma_types[1],
+	}, {
+		.name = "imx28-dma-apbh",
+		.driver_data = (kernel_ulong_t) &mxs_dma_types[2],
+	}, {
+		.name = "imx28-dma-apbx",
+		.driver_data = (kernel_ulong_t) &mxs_dma_types[3],
+	}, {
+		/* end of list */
+	}
+};
+
+static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)
+{
+	return container_of(chan, struct mxs_dma_chan, chan);
+}
+
+int mxs_dma_is_apbh(struct dma_chan *chan)
+{
+	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
+	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
+
+	return dma_is_apbh();
+}
+
+int mxs_dma_is_apbx(struct dma_chan *chan)
+{
+	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
+	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
+
+	return !dma_is_apbh();
+}
+
 static void mxs_dma_reset_chan(struct mxs_dma_chan *mxs_chan)
 {
 	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
@@ -193,11 +256,6 @@ static void mxs_dma_resume_chan(struct mxs_dma_chan *mxs_chan)
 	mxs_chan->status = DMA_IN_PROGRESS;
 }
 
-static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)
-{
-	return container_of(chan, struct mxs_dma_chan, chan);
-}
-
 static dma_cookie_t mxs_dma_tx_submit(struct dma_async_tx_descriptor *tx)
 {
 	return dma_cookie_assign(tx);
@@ -570,12 +628,6 @@ static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma)
 	if (ret)
 		goto err_out;
 
-	/* only major version matters */
-	mxs_dma->version = readl(mxs_dma->base +
-				((mxs_dma->dev_id == MXS_DMA_APBX) ?
-				HW_APBX_VERSION : HW_APBH_VERSION)) >>
-				BP_APBHX_VERSION_MAJOR;
-
 	/* enable apbh burst */
 	if (dma_is_apbh()) {
 		writel(BM_APBH_CTRL0_APB_BURST_EN,
@@ -597,6 +649,8 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
 {
 	const struct platform_device_id *id_entry =
 				platform_get_device_id(pdev);
+	const struct mxs_dma_type *dma_type =
+			(struct mxs_dma_type *)id_entry->driver_data;
 	struct mxs_dma_engine *mxs_dma;
 	struct resource *iores;
 	int ret, i;
@@ -605,7 +659,8 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
 	if (!mxs_dma)
 		return -ENOMEM;
 
-	mxs_dma->dev_id = id_entry->driver_data;
+	mxs_dma->dev_id = dma_type->id;
+	mxs_dma->type = dma_type->type;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
@@ -688,23 +743,11 @@ err_request_region:
 	return ret;
 }
 
-static struct platform_device_id mxs_dma_type[] = {
-	{
-		.name = "mxs-dma-apbh",
-		.driver_data = MXS_DMA_APBH,
-	}, {
-		.name = "mxs-dma-apbx",
-		.driver_data = MXS_DMA_APBX,
-	}, {
-		/* end of list */
-	}
-};
-
 static struct platform_driver mxs_dma_driver = {
 	.driver		= {
 		.name	= "mxs-dma",
 	},
-	.id_table	= mxs_dma_type,
+	.id_table	= mxs_dma_ids,
 };
 
 static int __init mxs_dma_module_init(void)
diff --git a/include/linux/fsl/mxs-dma.h b/include/linux/fsl/mxs-dma.h
index 203d7c4..55d8702 100644
--- a/include/linux/fsl/mxs-dma.h
+++ b/include/linux/fsl/mxs-dma.h
@@ -15,14 +15,6 @@ struct mxs_dma_data {
 	int chan_irq;
 };
 
-static inline int mxs_dma_is_apbh(struct dma_chan *chan)
-{
-	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbh");
-}
-
-static inline int mxs_dma_is_apbx(struct dma_chan *chan)
-{
-	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbx");
-}
-
+extern int mxs_dma_is_apbh(struct dma_chan *chan);
+extern int mxs_dma_is_apbx(struct dma_chan *chan);
 #endif /* __MACH_MXS_DMA_H__ */
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
@ 2012-05-04 12:12   ` Dong Aisheng
  0 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel

From: Dong Aisheng <dong.aisheng@linaro.org>

Rewrite mxs_dma_is_apbh and mxs_dma_is_apbx in order to support
other SoCs like imx6q and reform the platform_device_id for the
better further dt support.

Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Huang Shijie <b32955@freescale.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
ChangeLog v1->v2:
* remove using mxs_dma->version
* other minor fixes suggested by Shawn.
---
 arch/arm/mach-mxs/clock-mx23.c           |    4 +-
 arch/arm/mach-mxs/clock-mx28.c           |    4 +-
 arch/arm/mach-mxs/devices/platform-dma.c |   14 ++--
 drivers/dma/mxs-dma.c                    |  115 ++++++++++++++++++++---------
 include/linux/fsl/mxs-dma.h              |   12 +---
 5 files changed, 93 insertions(+), 56 deletions(-)

diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c
index e3ac52c..1e67b85 100644
--- a/arch/arm/mach-mxs/clock-mx23.c
+++ b/arch/arm/mach-mxs/clock-mx23.c
@@ -427,8 +427,8 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK("duart", NULL, uart_clk)
 	_REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
-	_REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
-	_REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
+	_REGISTER_CLOCK("imx23-dma-apbh", NULL, hbus_clk)
+	_REGISTER_CLOCK("imx23-dma-apbx", NULL, xbus_clk)
 	_REGISTER_CLOCK("mxs-mmc.0", NULL, ssp_clk)
 	_REGISTER_CLOCK("mxs-mmc.1", NULL, ssp_clk)
 	_REGISTER_CLOCK(NULL, "usb", usb_clk)
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index 1867a17..cca2cf7 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -625,8 +625,8 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK("mxs-auart.4", NULL, uart_clk)
 	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
 	_REGISTER_CLOCK("pll2", NULL, pll2_clk)
-	_REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
-	_REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
+	_REGISTER_CLOCK("imx28-dma-apbh", NULL, hbus_clk)
+	_REGISTER_CLOCK("imx28-dma-apbx", NULL, xbus_clk)
 	_REGISTER_CLOCK("mxs-mmc.0", NULL, ssp0_clk)
 	_REGISTER_CLOCK("mxs-mmc.1", NULL, ssp1_clk)
 	_REGISTER_CLOCK("mxs-mmc.2", NULL, ssp2_clk)
diff --git a/arch/arm/mach-mxs/devices/platform-dma.c b/arch/arm/mach-mxs/devices/platform-dma.c
index 6a0202b..aff4813 100644
--- a/arch/arm/mach-mxs/devices/platform-dma.c
+++ b/arch/arm/mach-mxs/devices/platform-dma.c
@@ -32,17 +32,19 @@ static struct platform_device *__init mxs_add_dma(const char *devid,
 
 static int __init mxs_add_mxs_dma(void)
 {
-	char *apbh = "mxs-dma-apbh";
-	char *apbx = "mxs-dma-apbx";
+	char *mx23_apbh = "imx23-dma-apbh";
+	char *mx23_apbx = "imx23-dma-apbx";
+	char *mx28_apbh = "imx28-dma-apbh";
+	char *mx28_apbx = "imx28-dma-apbx";
 
 	if (cpu_is_mx23()) {
-		mxs_add_dma(apbh, MX23_APBH_DMA_BASE_ADDR);
-		mxs_add_dma(apbx, MX23_APBX_DMA_BASE_ADDR);
+		mxs_add_dma(mx23_apbh, MX23_APBH_DMA_BASE_ADDR);
+		mxs_add_dma(mx23_apbx, MX23_APBX_DMA_BASE_ADDR);
 	}
 
 	if (cpu_is_mx28()) {
-		mxs_add_dma(apbh, MX28_APBH_DMA_BASE_ADDR);
-		mxs_add_dma(apbx, MX28_APBX_DMA_BASE_ADDR);
+		mxs_add_dma(mx28_apbh, MX28_APBH_DMA_BASE_ADDR);
+		mxs_add_dma(mx28_apbx, MX28_APBX_DMA_BASE_ADDR);
 	}
 
 	return 0;
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 0fefdd3..d8505d3 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -35,12 +35,8 @@
  * dma can program the controller registers of peripheral devices.
  */
 
-#define MXS_DMA_APBH		0
-#define MXS_DMA_APBX		1
-#define dma_is_apbh()		(mxs_dma->dev_id == MXS_DMA_APBH)
-
-#define APBH_VERSION_LATEST	3
-#define apbh_is_old()		(mxs_dma->version < APBH_VERSION_LATEST)
+#define dma_is_apbh()		(mxs_dma->type == MXS_DMA_APBH)
+#define apbh_is_old()		(mxs_dma->dev_id == IMX23_DMA)
 
 #define HW_APBHX_CTRL0				0x000
 #define BM_APBH_CTRL0_APB_BURST8_EN		(1 << 29)
@@ -50,9 +46,6 @@
 #define HW_APBHX_CTRL2				0x020
 #define HW_APBHX_CHANNEL_CTRL			0x030
 #define BP_APBHX_CHANNEL_CTRL_RESET_CHANNEL	16
-#define HW_APBH_VERSION				(cpu_is_mx23() ? 0x3f0 : 0x800)
-#define HW_APBX_VERSION				0x800
-#define BP_APBHX_VERSION_MAJOR			24
 #define HW_APBHX_CHn_NXTCMDAR(n) \
 	(((dma_is_apbh() && apbh_is_old()) ? 0x050 : 0x110) + (n) * 0x70)
 #define HW_APBHX_CHn_SEMA(n) \
@@ -120,9 +113,19 @@ struct mxs_dma_chan {
 #define MXS_DMA_CHANNELS		16
 #define MXS_DMA_CHANNELS_MASK		0xffff
 
+enum mxs_dma_devtype {
+	MXS_DMA_APBH,
+	MXS_DMA_APBX,
+};
+
+enum mxs_dma_id {
+	IMX23_DMA,
+	IMX28_DMA,
+};
+
 struct mxs_dma_engine {
-	int				dev_id;
-	unsigned int			version;
+	enum mxs_dma_id			dev_id;
+	enum mxs_dma_devtype		type;
 	void __iomem			*base;
 	struct clk			*clk;
 	struct dma_device		dma_device;
@@ -130,6 +133,66 @@ struct mxs_dma_engine {
 	struct mxs_dma_chan		mxs_chans[MXS_DMA_CHANNELS];
 };
 
+struct mxs_dma_type {
+	enum mxs_dma_id id;
+	enum mxs_dma_devtype type;
+};
+
+static struct mxs_dma_type mxs_dma_types[] = {
+	{
+		.id = IMX23_DMA,
+		.type = MXS_DMA_APBH,
+	}, {
+		.id = IMX23_DMA,
+		.type = MXS_DMA_APBX,
+	}, {
+		.id = IMX28_DMA,
+		.type = MXS_DMA_APBH,
+	}, {
+		.id = IMX28_DMA,
+		.type = MXS_DMA_APBX,
+	}
+};
+
+static struct platform_device_id mxs_dma_ids[] = {
+	{
+		.name = "imx23-dma-apbh",
+		.driver_data = (kernel_ulong_t) &mxs_dma_types[0],
+	}, {
+		.name = "imx23-dma-apbx",
+		.driver_data = (kernel_ulong_t) &mxs_dma_types[1],
+	}, {
+		.name = "imx28-dma-apbh",
+		.driver_data = (kernel_ulong_t) &mxs_dma_types[2],
+	}, {
+		.name = "imx28-dma-apbx",
+		.driver_data = (kernel_ulong_t) &mxs_dma_types[3],
+	}, {
+		/* end of list */
+	}
+};
+
+static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)
+{
+	return container_of(chan, struct mxs_dma_chan, chan);
+}
+
+int mxs_dma_is_apbh(struct dma_chan *chan)
+{
+	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
+	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
+
+	return dma_is_apbh();
+}
+
+int mxs_dma_is_apbx(struct dma_chan *chan)
+{
+	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
+	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
+
+	return !dma_is_apbh();
+}
+
 static void mxs_dma_reset_chan(struct mxs_dma_chan *mxs_chan)
 {
 	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
@@ -193,11 +256,6 @@ static void mxs_dma_resume_chan(struct mxs_dma_chan *mxs_chan)
 	mxs_chan->status = DMA_IN_PROGRESS;
 }
 
-static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)
-{
-	return container_of(chan, struct mxs_dma_chan, chan);
-}
-
 static dma_cookie_t mxs_dma_tx_submit(struct dma_async_tx_descriptor *tx)
 {
 	return dma_cookie_assign(tx);
@@ -570,12 +628,6 @@ static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma)
 	if (ret)
 		goto err_out;
 
-	/* only major version matters */
-	mxs_dma->version = readl(mxs_dma->base +
-				((mxs_dma->dev_id == MXS_DMA_APBX) ?
-				HW_APBX_VERSION : HW_APBH_VERSION)) >>
-				BP_APBHX_VERSION_MAJOR;
-
 	/* enable apbh burst */
 	if (dma_is_apbh()) {
 		writel(BM_APBH_CTRL0_APB_BURST_EN,
@@ -597,6 +649,8 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
 {
 	const struct platform_device_id *id_entry =
 				platform_get_device_id(pdev);
+	const struct mxs_dma_type *dma_type =
+			(struct mxs_dma_type *)id_entry->driver_data;
 	struct mxs_dma_engine *mxs_dma;
 	struct resource *iores;
 	int ret, i;
@@ -605,7 +659,8 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
 	if (!mxs_dma)
 		return -ENOMEM;
 
-	mxs_dma->dev_id = id_entry->driver_data;
+	mxs_dma->dev_id = dma_type->id;
+	mxs_dma->type = dma_type->type;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
@@ -688,23 +743,11 @@ err_request_region:
 	return ret;
 }
 
-static struct platform_device_id mxs_dma_type[] = {
-	{
-		.name = "mxs-dma-apbh",
-		.driver_data = MXS_DMA_APBH,
-	}, {
-		.name = "mxs-dma-apbx",
-		.driver_data = MXS_DMA_APBX,
-	}, {
-		/* end of list */
-	}
-};
-
 static struct platform_driver mxs_dma_driver = {
 	.driver		= {
 		.name	= "mxs-dma",
 	},
-	.id_table	= mxs_dma_type,
+	.id_table	= mxs_dma_ids,
 };
 
 static int __init mxs_dma_module_init(void)
diff --git a/include/linux/fsl/mxs-dma.h b/include/linux/fsl/mxs-dma.h
index 203d7c4..55d8702 100644
--- a/include/linux/fsl/mxs-dma.h
+++ b/include/linux/fsl/mxs-dma.h
@@ -15,14 +15,6 @@ struct mxs_dma_data {
 	int chan_irq;
 };
 
-static inline int mxs_dma_is_apbh(struct dma_chan *chan)
-{
-	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbh");
-}
-
-static inline int mxs_dma_is_apbx(struct dma_chan *chan)
-{
-	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbx");
-}
-
+extern int mxs_dma_is_apbh(struct dma_chan *chan);
+extern int mxs_dma_is_apbx(struct dma_chan *chan);
 #endif /* __MACH_MXS_DMA_H__ */
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 3/5] dma: mxs-dma: add device tree probe support
  2012-05-04 12:12 ` Dong Aisheng
@ 2012-05-04 12:12   ` Dong Aisheng
  -1 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: b32955, vinod.koul, devicetree-discuss, rob.herring,
	grant.likely, marek.vasut, kernel, dan.j.williams, s.hauer,
	shawn.guo

From: Dong Aisheng <dong.aisheng@linaro.org>

Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Rob Landley <rob@landley.net>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Huang Shijie <b32955@freescale.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
ChangeLog v1->v2:
* remove #ifdef CONFIG_OF for mxs_dma_dt_ids based on Shawn's
  suggestion.
---
 .../devicetree/bindings/dma/fsl-mxs-dma.txt        |   19 +++++++++++++
 drivers/dma/mxs-dma.c                              |   29 ++++++++++++++++---
 2 files changed, 43 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt

diff --git a/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
new file mode 100644
index 0000000..ded0398
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
@@ -0,0 +1,19 @@
+* Freescale MXS DMA
+
+Required properties:
+- compatible : Should be "fsl,<chip>-dma-apbh" or "fsl,<chip>-dma-apbx"
+- reg : Should contain registers location and length
+
+Supported chips:
+imx23, imx28.
+
+Examples:
+dma-apbh@80004000 {
+	compatible = "fsl,imx28-dma-apbh";
+	reg = <0x80004000 2000>;
+};
+
+dma-apbx@80024000 {
+	compatible = "fsl,imx28-dma-apbx";
+	reg = <0x80024000 2000>;
+};
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index d8505d3..f6a3bf6 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -22,8 +22,11 @@
 #include <linux/platform_device.h>
 #include <linux/dmaengine.h>
 #include <linux/delay.h>
+#include <linux/module.h>
 #include <linux/fsl/mxs-dma.h>
 #include <linux/stmp_device.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 
 #include <asm/irq.h>
 
@@ -172,6 +175,15 @@ static struct platform_device_id mxs_dma_ids[] = {
 	}
 };
 
+static const struct of_device_id mxs_dma_dt_ids[] = {
+	{ .compatible = "fsl,imx23-dma-apbh", .data = &mxs_dma_ids[0], },
+	{ .compatible = "fsl,imx23-dma-apbx", .data = &mxs_dma_ids[1], },
+	{ .compatible = "fsl,imx28-dma-apbh", .data = &mxs_dma_ids[2], },
+	{ .compatible = "fsl,imx28-dma-apbx", .data = &mxs_dma_ids[3], },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, mxs_dma_dt_ids);
+
 static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)
 {
 	return container_of(chan, struct mxs_dma_chan, chan);
@@ -647,10 +659,9 @@ err_out:
 
 static int __init mxs_dma_probe(struct platform_device *pdev)
 {
-	const struct platform_device_id *id_entry =
-				platform_get_device_id(pdev);
-	const struct mxs_dma_type *dma_type =
-			(struct mxs_dma_type *)id_entry->driver_data;
+	const struct platform_device_id *id_entry;
+	const struct of_device_id *of_id;
+	const struct mxs_dma_type *dma_type;
 	struct mxs_dma_engine *mxs_dma;
 	struct resource *iores;
 	int ret, i;
@@ -659,8 +670,15 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
 	if (!mxs_dma)
 		return -ENOMEM;
 
-	mxs_dma->dev_id = dma_type->id;
+	of_id = of_match_device(mxs_dma_dt_ids, &pdev->dev);
+	if (of_id)
+		id_entry = of_id->data;
+	else
+		id_entry = platform_get_device_id(pdev);
+
+	dma_type = (struct mxs_dma_type *)id_entry->driver_data;
 	mxs_dma->type = dma_type->type;
+	mxs_dma->dev_id = dma_type->id;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
@@ -746,6 +764,7 @@ err_request_region:
 static struct platform_driver mxs_dma_driver = {
 	.driver		= {
 		.name	= "mxs-dma",
+		.of_match_table = mxs_dma_dt_ids,
 	},
 	.id_table	= mxs_dma_ids,
 };
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 3/5] dma: mxs-dma: add device tree probe support
@ 2012-05-04 12:12   ` Dong Aisheng
  0 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel

From: Dong Aisheng <dong.aisheng@linaro.org>

Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Rob Landley <rob@landley.net>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Huang Shijie <b32955@freescale.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
ChangeLog v1->v2:
* remove #ifdef CONFIG_OF for mxs_dma_dt_ids based on Shawn's
  suggestion.
---
 .../devicetree/bindings/dma/fsl-mxs-dma.txt        |   19 +++++++++++++
 drivers/dma/mxs-dma.c                              |   29 ++++++++++++++++---
 2 files changed, 43 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt

diff --git a/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
new file mode 100644
index 0000000..ded0398
--- /dev/null
+++ b/Documentation/devicetree/bindings/dma/fsl-mxs-dma.txt
@@ -0,0 +1,19 @@
+* Freescale MXS DMA
+
+Required properties:
+- compatible : Should be "fsl,<chip>-dma-apbh" or "fsl,<chip>-dma-apbx"
+- reg : Should contain registers location and length
+
+Supported chips:
+imx23, imx28.
+
+Examples:
+dma-apbh at 80004000 {
+	compatible = "fsl,imx28-dma-apbh";
+	reg = <0x80004000 2000>;
+};
+
+dma-apbx at 80024000 {
+	compatible = "fsl,imx28-dma-apbx";
+	reg = <0x80024000 2000>;
+};
diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index d8505d3..f6a3bf6 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -22,8 +22,11 @@
 #include <linux/platform_device.h>
 #include <linux/dmaengine.h>
 #include <linux/delay.h>
+#include <linux/module.h>
 #include <linux/fsl/mxs-dma.h>
 #include <linux/stmp_device.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 
 #include <asm/irq.h>
 
@@ -172,6 +175,15 @@ static struct platform_device_id mxs_dma_ids[] = {
 	}
 };
 
+static const struct of_device_id mxs_dma_dt_ids[] = {
+	{ .compatible = "fsl,imx23-dma-apbh", .data = &mxs_dma_ids[0], },
+	{ .compatible = "fsl,imx23-dma-apbx", .data = &mxs_dma_ids[1], },
+	{ .compatible = "fsl,imx28-dma-apbh", .data = &mxs_dma_ids[2], },
+	{ .compatible = "fsl,imx28-dma-apbx", .data = &mxs_dma_ids[3], },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, mxs_dma_dt_ids);
+
 static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)
 {
 	return container_of(chan, struct mxs_dma_chan, chan);
@@ -647,10 +659,9 @@ err_out:
 
 static int __init mxs_dma_probe(struct platform_device *pdev)
 {
-	const struct platform_device_id *id_entry =
-				platform_get_device_id(pdev);
-	const struct mxs_dma_type *dma_type =
-			(struct mxs_dma_type *)id_entry->driver_data;
+	const struct platform_device_id *id_entry;
+	const struct of_device_id *of_id;
+	const struct mxs_dma_type *dma_type;
 	struct mxs_dma_engine *mxs_dma;
 	struct resource *iores;
 	int ret, i;
@@ -659,8 +670,15 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
 	if (!mxs_dma)
 		return -ENOMEM;
 
-	mxs_dma->dev_id = dma_type->id;
+	of_id = of_match_device(mxs_dma_dt_ids, &pdev->dev);
+	if (of_id)
+		id_entry = of_id->data;
+	else
+		id_entry = platform_get_device_id(pdev);
+
+	dma_type = (struct mxs_dma_type *)id_entry->driver_data;
 	mxs_dma->type = dma_type->type;
+	mxs_dma->dev_id = dma_type->id;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
@@ -746,6 +764,7 @@ err_request_region:
 static struct platform_driver mxs_dma_driver = {
 	.driver		= {
 		.name	= "mxs-dma",
+		.of_match_table = mxs_dma_dt_ids,
 	},
 	.id_table	= mxs_dma_ids,
 };
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 4/5] ARM: mxs: do not add dma device by default
  2012-05-04 12:12 ` Dong Aisheng
@ 2012-05-04 12:12     ` Dong Aisheng
  -1 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: b32955-KZfg59tc24xl57MIdRCFDg, vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	marek.vasut-Re5JQEeQqe8AvxtiuMwx3w,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ

From: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

This will cause conflict when dt is enabled.
So let each platform add dma devices respectively.

Cc: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Huang Shijie <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Reviewed-by: Marek Vasut <marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
ChangeLog v2->v3:
 * introduce mx23/mx28_soc_init()
ChangeLog v1->v2:
 * Add the missed mx28_add_dma() for mx28evk.c.
---
 arch/arm/mach-mxs/devices/platform-dma.c |   23 +----------------------
 arch/arm/mach-mxs/include/mach/common.h  |    4 ++++
 arch/arm/mach-mxs/mach-apx4devkit.c      |    2 ++
 arch/arm/mach-mxs/mach-m28evk.c          |    2 ++
 arch/arm/mach-mxs/mach-mx23evk.c         |    2 ++
 arch/arm/mach-mxs/mach-mx28evk.c         |    2 ++
 arch/arm/mach-mxs/mach-stmp378x_devb.c   |    2 ++
 arch/arm/mach-mxs/mach-tx28.c            |    2 ++
 arch/arm/mach-mxs/mm.c                   |   12 ++++++++++++
 9 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-mxs/devices/platform-dma.c b/arch/arm/mach-mxs/devices/platform-dma.c
index aff4813..4682450 100644
--- a/arch/arm/mach-mxs/devices/platform-dma.c
+++ b/arch/arm/mach-mxs/devices/platform-dma.c
@@ -14,7 +14,7 @@
 #include <mach/mx28.h>
 #include <mach/devices-common.h>
 
-static struct platform_device *__init mxs_add_dma(const char *devid,
+struct platform_device *__init mxs_add_dma(const char *devid,
 						resource_size_t base)
 {
 	struct resource res[] = {
@@ -29,24 +29,3 @@ static struct platform_device *__init mxs_add_dma(const char *devid,
 				res, ARRAY_SIZE(res), NULL, 0,
 				DMA_BIT_MASK(32));
 }
-
-static int __init mxs_add_mxs_dma(void)
-{
-	char *mx23_apbh = "imx23-dma-apbh";
-	char *mx23_apbx = "imx23-dma-apbx";
-	char *mx28_apbh = "imx28-dma-apbh";
-	char *mx28_apbx = "imx28-dma-apbx";
-
-	if (cpu_is_mx23()) {
-		mxs_add_dma(mx23_apbh, MX23_APBH_DMA_BASE_ADDR);
-		mxs_add_dma(mx23_apbx, MX23_APBX_DMA_BASE_ADDR);
-	}
-
-	if (cpu_is_mx28()) {
-		mxs_add_dma(mx28_apbh, MX28_APBH_DMA_BASE_ADDR);
-		mxs_add_dma(mx28_apbx, MX28_APBX_DMA_BASE_ADDR);
-	}
-
-	return 0;
-}
-arch_initcall(mxs_add_mxs_dma);
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
index c50c3ea..b212553 100644
--- a/arch/arm/mach-mxs/include/mach/common.h
+++ b/arch/arm/mach-mxs/include/mach/common.h
@@ -19,11 +19,13 @@ extern void mxs_timer_init(struct clk *, int);
 extern void mxs_restart(char, const char *);
 extern int mxs_saif_clkmux_select(unsigned int clkmux);
 
+extern void mx23_soc_init(void);
 extern int mx23_register_gpios(void);
 extern int mx23_clocks_init(void);
 extern void mx23_map_io(void);
 extern void mx23_init_irq(void);
 
+extern void mx28_soc_init(void);
 extern int mx28_register_gpios(void);
 extern int mx28_clocks_init(void);
 extern void mx28_map_io(void);
@@ -33,4 +35,6 @@ extern void icoll_init_irq(void);
 
 extern int mxs_clkctrl_timeout(unsigned int reg_offset, unsigned int mask);
 
+extern struct platform_device *mxs_add_dma(const char *devid,
+						resource_size_t base);
 #endif /* __MACH_MXS_COMMON_H__ */
diff --git a/arch/arm/mach-mxs/mach-apx4devkit.c b/arch/arm/mach-mxs/mach-apx4devkit.c
index 48a7fab..5e90b9d 100644
--- a/arch/arm/mach-mxs/mach-apx4devkit.c
+++ b/arch/arm/mach-mxs/mach-apx4devkit.c
@@ -207,6 +207,8 @@ static int apx4devkit_phy_fixup(struct phy_device *phy)
 
 static void __init apx4devkit_init(void)
 {
+	mx28_soc_init();
+
 	mxs_iomux_setup_multiple_pads(apx4devkit_pads,
 			ARRAY_SIZE(apx4devkit_pads));
 
diff --git a/arch/arm/mach-mxs/mach-m28evk.c b/arch/arm/mach-mxs/mach-m28evk.c
index 06d7996..4c00c87 100644
--- a/arch/arm/mach-mxs/mach-m28evk.c
+++ b/arch/arm/mach-mxs/mach-m28evk.c
@@ -319,6 +319,8 @@ static struct mxs_mmc_platform_data m28evk_mmc_pdata[] __initdata = {
 
 static void __init m28evk_init(void)
 {
+	mx28_soc_init();
+
 	mxs_iomux_setup_multiple_pads(m28evk_pads, ARRAY_SIZE(m28evk_pads));
 
 	mx28_add_duart();
diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c
index 5ea1c57..e7272a4 100644
--- a/arch/arm/mach-mxs/mach-mx23evk.c
+++ b/arch/arm/mach-mxs/mach-mx23evk.c
@@ -141,6 +141,8 @@ static void __init mx23evk_init(void)
 {
 	int ret;
 
+	mx23_soc_init();
+
 	mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads));
 
 	mx23_add_duart();
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
index e386c14..da4610e 100644
--- a/arch/arm/mach-mxs/mach-mx28evk.c
+++ b/arch/arm/mach-mxs/mach-mx28evk.c
@@ -413,6 +413,8 @@ static void __init mx28evk_init(void)
 {
 	int ret;
 
+	mx28_soc_init();
+
 	mxs_iomux_setup_multiple_pads(mx28evk_pads, ARRAY_SIZE(mx28evk_pads));
 
 	mx28_add_duart();
diff --git a/arch/arm/mach-mxs/mach-stmp378x_devb.c b/arch/arm/mach-mxs/mach-stmp378x_devb.c
index a626c07..6548965 100644
--- a/arch/arm/mach-mxs/mach-stmp378x_devb.c
+++ b/arch/arm/mach-mxs/mach-stmp378x_devb.c
@@ -85,6 +85,8 @@ static void __init stmp378x_dvb_init(void)
 {
 	int ret;
 
+	mx23_soc_init();
+
 	mxs_iomux_setup_multiple_pads(stmp378x_dvb_pads,
 			ARRAY_SIZE(stmp378x_dvb_pads));
 
diff --git a/arch/arm/mach-mxs/mach-tx28.c b/arch/arm/mach-mxs/mach-tx28.c
index 2c0862e..8837029 100644
--- a/arch/arm/mach-mxs/mach-tx28.c
+++ b/arch/arm/mach-mxs/mach-tx28.c
@@ -146,6 +146,8 @@ static struct mxs_mmc_platform_data tx28_mmc0_pdata __initdata = {
 
 static void __init tx28_stk5v3_init(void)
 {
+	mx28_soc_init();
+
 	mxs_iomux_setup_multiple_pads(tx28_stk5v3_pads,
 			ARRAY_SIZE(tx28_stk5v3_pads));
 
diff --git a/arch/arm/mach-mxs/mm.c b/arch/arm/mach-mxs/mm.c
index 50af5ce..6a1acad 100644
--- a/arch/arm/mach-mxs/mm.c
+++ b/arch/arm/mach-mxs/mm.c
@@ -61,3 +61,15 @@ void __init mx28_init_irq(void)
 {
 	icoll_init_irq();
 }
+
+void __init mx23_soc_init(void)
+{
+	mxs_add_dma("imx23-dma-apbh", MX23_APBH_DMA_BASE_ADDR);
+	mxs_add_dma("imx23-dma-apbx", MX23_APBX_DMA_BASE_ADDR);
+}
+
+void __init mx28_soc_init(void)
+{
+	mxs_add_dma("imx28-dma-apbh", MX23_APBH_DMA_BASE_ADDR);
+	mxs_add_dma("imx28-dma-apbx", MX23_APBX_DMA_BASE_ADDR);
+}
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 4/5] ARM: mxs: do not add dma device by default
@ 2012-05-04 12:12     ` Dong Aisheng
  0 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel

From: Dong Aisheng <dong.aisheng@linaro.org>

This will cause conflict when dt is enabled.
So let each platform add dma devices respectively.

Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Huang Shijie <b32955@freescale.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
ChangeLog v2->v3:
 * introduce mx23/mx28_soc_init()
ChangeLog v1->v2:
 * Add the missed mx28_add_dma() for mx28evk.c.
---
 arch/arm/mach-mxs/devices/platform-dma.c |   23 +----------------------
 arch/arm/mach-mxs/include/mach/common.h  |    4 ++++
 arch/arm/mach-mxs/mach-apx4devkit.c      |    2 ++
 arch/arm/mach-mxs/mach-m28evk.c          |    2 ++
 arch/arm/mach-mxs/mach-mx23evk.c         |    2 ++
 arch/arm/mach-mxs/mach-mx28evk.c         |    2 ++
 arch/arm/mach-mxs/mach-stmp378x_devb.c   |    2 ++
 arch/arm/mach-mxs/mach-tx28.c            |    2 ++
 arch/arm/mach-mxs/mm.c                   |   12 ++++++++++++
 9 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-mxs/devices/platform-dma.c b/arch/arm/mach-mxs/devices/platform-dma.c
index aff4813..4682450 100644
--- a/arch/arm/mach-mxs/devices/platform-dma.c
+++ b/arch/arm/mach-mxs/devices/platform-dma.c
@@ -14,7 +14,7 @@
 #include <mach/mx28.h>
 #include <mach/devices-common.h>
 
-static struct platform_device *__init mxs_add_dma(const char *devid,
+struct platform_device *__init mxs_add_dma(const char *devid,
 						resource_size_t base)
 {
 	struct resource res[] = {
@@ -29,24 +29,3 @@ static struct platform_device *__init mxs_add_dma(const char *devid,
 				res, ARRAY_SIZE(res), NULL, 0,
 				DMA_BIT_MASK(32));
 }
-
-static int __init mxs_add_mxs_dma(void)
-{
-	char *mx23_apbh = "imx23-dma-apbh";
-	char *mx23_apbx = "imx23-dma-apbx";
-	char *mx28_apbh = "imx28-dma-apbh";
-	char *mx28_apbx = "imx28-dma-apbx";
-
-	if (cpu_is_mx23()) {
-		mxs_add_dma(mx23_apbh, MX23_APBH_DMA_BASE_ADDR);
-		mxs_add_dma(mx23_apbx, MX23_APBX_DMA_BASE_ADDR);
-	}
-
-	if (cpu_is_mx28()) {
-		mxs_add_dma(mx28_apbh, MX28_APBH_DMA_BASE_ADDR);
-		mxs_add_dma(mx28_apbx, MX28_APBX_DMA_BASE_ADDR);
-	}
-
-	return 0;
-}
-arch_initcall(mxs_add_mxs_dma);
diff --git a/arch/arm/mach-mxs/include/mach/common.h b/arch/arm/mach-mxs/include/mach/common.h
index c50c3ea..b212553 100644
--- a/arch/arm/mach-mxs/include/mach/common.h
+++ b/arch/arm/mach-mxs/include/mach/common.h
@@ -19,11 +19,13 @@ extern void mxs_timer_init(struct clk *, int);
 extern void mxs_restart(char, const char *);
 extern int mxs_saif_clkmux_select(unsigned int clkmux);
 
+extern void mx23_soc_init(void);
 extern int mx23_register_gpios(void);
 extern int mx23_clocks_init(void);
 extern void mx23_map_io(void);
 extern void mx23_init_irq(void);
 
+extern void mx28_soc_init(void);
 extern int mx28_register_gpios(void);
 extern int mx28_clocks_init(void);
 extern void mx28_map_io(void);
@@ -33,4 +35,6 @@ extern void icoll_init_irq(void);
 
 extern int mxs_clkctrl_timeout(unsigned int reg_offset, unsigned int mask);
 
+extern struct platform_device *mxs_add_dma(const char *devid,
+						resource_size_t base);
 #endif /* __MACH_MXS_COMMON_H__ */
diff --git a/arch/arm/mach-mxs/mach-apx4devkit.c b/arch/arm/mach-mxs/mach-apx4devkit.c
index 48a7fab..5e90b9d 100644
--- a/arch/arm/mach-mxs/mach-apx4devkit.c
+++ b/arch/arm/mach-mxs/mach-apx4devkit.c
@@ -207,6 +207,8 @@ static int apx4devkit_phy_fixup(struct phy_device *phy)
 
 static void __init apx4devkit_init(void)
 {
+	mx28_soc_init();
+
 	mxs_iomux_setup_multiple_pads(apx4devkit_pads,
 			ARRAY_SIZE(apx4devkit_pads));
 
diff --git a/arch/arm/mach-mxs/mach-m28evk.c b/arch/arm/mach-mxs/mach-m28evk.c
index 06d7996..4c00c87 100644
--- a/arch/arm/mach-mxs/mach-m28evk.c
+++ b/arch/arm/mach-mxs/mach-m28evk.c
@@ -319,6 +319,8 @@ static struct mxs_mmc_platform_data m28evk_mmc_pdata[] __initdata = {
 
 static void __init m28evk_init(void)
 {
+	mx28_soc_init();
+
 	mxs_iomux_setup_multiple_pads(m28evk_pads, ARRAY_SIZE(m28evk_pads));
 
 	mx28_add_duart();
diff --git a/arch/arm/mach-mxs/mach-mx23evk.c b/arch/arm/mach-mxs/mach-mx23evk.c
index 5ea1c57..e7272a4 100644
--- a/arch/arm/mach-mxs/mach-mx23evk.c
+++ b/arch/arm/mach-mxs/mach-mx23evk.c
@@ -141,6 +141,8 @@ static void __init mx23evk_init(void)
 {
 	int ret;
 
+	mx23_soc_init();
+
 	mxs_iomux_setup_multiple_pads(mx23evk_pads, ARRAY_SIZE(mx23evk_pads));
 
 	mx23_add_duart();
diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c
index e386c14..da4610e 100644
--- a/arch/arm/mach-mxs/mach-mx28evk.c
+++ b/arch/arm/mach-mxs/mach-mx28evk.c
@@ -413,6 +413,8 @@ static void __init mx28evk_init(void)
 {
 	int ret;
 
+	mx28_soc_init();
+
 	mxs_iomux_setup_multiple_pads(mx28evk_pads, ARRAY_SIZE(mx28evk_pads));
 
 	mx28_add_duart();
diff --git a/arch/arm/mach-mxs/mach-stmp378x_devb.c b/arch/arm/mach-mxs/mach-stmp378x_devb.c
index a626c07..6548965 100644
--- a/arch/arm/mach-mxs/mach-stmp378x_devb.c
+++ b/arch/arm/mach-mxs/mach-stmp378x_devb.c
@@ -85,6 +85,8 @@ static void __init stmp378x_dvb_init(void)
 {
 	int ret;
 
+	mx23_soc_init();
+
 	mxs_iomux_setup_multiple_pads(stmp378x_dvb_pads,
 			ARRAY_SIZE(stmp378x_dvb_pads));
 
diff --git a/arch/arm/mach-mxs/mach-tx28.c b/arch/arm/mach-mxs/mach-tx28.c
index 2c0862e..8837029 100644
--- a/arch/arm/mach-mxs/mach-tx28.c
+++ b/arch/arm/mach-mxs/mach-tx28.c
@@ -146,6 +146,8 @@ static struct mxs_mmc_platform_data tx28_mmc0_pdata __initdata = {
 
 static void __init tx28_stk5v3_init(void)
 {
+	mx28_soc_init();
+
 	mxs_iomux_setup_multiple_pads(tx28_stk5v3_pads,
 			ARRAY_SIZE(tx28_stk5v3_pads));
 
diff --git a/arch/arm/mach-mxs/mm.c b/arch/arm/mach-mxs/mm.c
index 50af5ce..6a1acad 100644
--- a/arch/arm/mach-mxs/mm.c
+++ b/arch/arm/mach-mxs/mm.c
@@ -61,3 +61,15 @@ void __init mx28_init_irq(void)
 {
 	icoll_init_irq();
 }
+
+void __init mx23_soc_init(void)
+{
+	mxs_add_dma("imx23-dma-apbh", MX23_APBH_DMA_BASE_ADDR);
+	mxs_add_dma("imx23-dma-apbx", MX23_APBX_DMA_BASE_ADDR);
+}
+
+void __init mx28_soc_init(void)
+{
+	mxs_add_dma("imx28-dma-apbh", MX23_APBH_DMA_BASE_ADDR);
+	mxs_add_dma("imx28-dma-apbx", MX23_APBX_DMA_BASE_ADDR);
+}
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 5/5] ARM: mx28evk: add mxs-dma dt support
  2012-05-04 12:12 ` Dong Aisheng
@ 2012-05-04 12:12   ` Dong Aisheng
  -1 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: b32955, vinod.koul, devicetree-discuss, rob.herring,
	grant.likely, marek.vasut, kernel, dan.j.williams, s.hauer,
	shawn.guo

From: Dong Aisheng <dong.aisheng@linaro.org>

Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Huang Shijie <b32955@freescale.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
 arch/arm/boot/dts/imx28.dtsi   |    4 ++--
 arch/arm/mach-mxs/clock-mx28.c |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index d1f4f8c..5f61777 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -52,8 +52,8 @@
 			};
 
 			dma-apbh@80004000 {
+				compatible = "fsl,imx28-dma-apbh";
 				reg = <0x80004000 2000>;
-				status = "disabled";
 			};
 
 			perfmon@80006000 {
@@ -115,8 +115,8 @@
 			};
 
 			dma-apbx@80024000 {
+				compatible = "fsl,imx28-dma-apbx";
 				reg = <0x80024000 2000>;
-				status = "disabled";
 			};
 
 			dcp@80028000 {
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index cca2cf7..9c926b6 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -652,6 +652,8 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK("80074000.serial", NULL, uart_clk)
 	_REGISTER_CLOCK("800f0000.ethernet", NULL, fec_clk)
 	_REGISTER_CLOCK("800f4000.ethernet", NULL, fec_clk)
+	_REGISTER_CLOCK("80004000.dma-apbh", NULL, hbus_clk)
+	_REGISTER_CLOCK("80024000.dma-apbx", NULL, xbus_clk)
 };
 
 static int clk_misc_init(void)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 5/5] ARM: mx28evk: add mxs-dma dt support
@ 2012-05-04 12:12   ` Dong Aisheng
  0 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-04 12:12 UTC (permalink / raw)
  To: linux-arm-kernel

From: Dong Aisheng <dong.aisheng@linaro.org>

Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Huang Shijie <b32955@freescale.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
---
 arch/arm/boot/dts/imx28.dtsi   |    4 ++--
 arch/arm/mach-mxs/clock-mx28.c |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi
index d1f4f8c..5f61777 100644
--- a/arch/arm/boot/dts/imx28.dtsi
+++ b/arch/arm/boot/dts/imx28.dtsi
@@ -52,8 +52,8 @@
 			};
 
 			dma-apbh at 80004000 {
+				compatible = "fsl,imx28-dma-apbh";
 				reg = <0x80004000 2000>;
-				status = "disabled";
 			};
 
 			perfmon at 80006000 {
@@ -115,8 +115,8 @@
 			};
 
 			dma-apbx at 80024000 {
+				compatible = "fsl,imx28-dma-apbx";
 				reg = <0x80024000 2000>;
-				status = "disabled";
 			};
 
 			dcp at 80028000 {
diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index cca2cf7..9c926b6 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -652,6 +652,8 @@ static struct clk_lookup lookups[] = {
 	_REGISTER_CLOCK("80074000.serial", NULL, uart_clk)
 	_REGISTER_CLOCK("800f0000.ethernet", NULL, fec_clk)
 	_REGISTER_CLOCK("800f4000.ethernet", NULL, fec_clk)
+	_REGISTER_CLOCK("80004000.dma-apbh", NULL, hbus_clk)
+	_REGISTER_CLOCK("80024000.dma-apbx", NULL, xbus_clk)
 };
 
 static int clk_misc_init(void)
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
  2012-05-04 12:12   ` Dong Aisheng
@ 2012-05-04 12:15       ` Marek Vasut
  -1 siblings, 0 replies; 34+ messages in thread
From: Marek Vasut @ 2012-05-04 12:15 UTC (permalink / raw)
  To: Dong Aisheng
  Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	b32955-KZfg59tc24xl57MIdRCFDg, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Dear Dong Aisheng,

> From: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 
> Rewrite mxs_dma_is_apbh and mxs_dma_is_apbx in order to support
> other SoCs like imx6q and reform the platform_device_id for the
> better further dt support.
> 
> Cc: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Cc: Huang Shijie <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> Reviewed-by: Marek Vasut <marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
> ChangeLog v1->v2:
> * remove using mxs_dma->version
> * other minor fixes suggested by Shawn.
> ---
>  arch/arm/mach-mxs/clock-mx23.c           |    4 +-
>  arch/arm/mach-mxs/clock-mx28.c           |    4 +-
>  arch/arm/mach-mxs/devices/platform-dma.c |   14 ++--
>  drivers/dma/mxs-dma.c                    |  115
> ++++++++++++++++++++--------- include/linux/fsl/mxs-dma.h              |  
> 12 +---
>  5 files changed, 93 insertions(+), 56 deletions(-)
> 
> diff --git a/arch/arm/mach-mxs/clock-mx23.c
> b/arch/arm/mach-mxs/clock-mx23.c index e3ac52c..1e67b85 100644
> --- a/arch/arm/mach-mxs/clock-mx23.c
> +++ b/arch/arm/mach-mxs/clock-mx23.c
> @@ -427,8 +427,8 @@ static struct clk_lookup lookups[] = {
>  	_REGISTER_CLOCK("duart", NULL, uart_clk)
>  	_REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk)
>  	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
> -	_REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
> -	_REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
> +	_REGISTER_CLOCK("imx23-dma-apbh", NULL, hbus_clk)
> +	_REGISTER_CLOCK("imx23-dma-apbx", NULL, xbus_clk)
>  	_REGISTER_CLOCK("mxs-mmc.0", NULL, ssp_clk)
>  	_REGISTER_CLOCK("mxs-mmc.1", NULL, ssp_clk)
>  	_REGISTER_CLOCK(NULL, "usb", usb_clk)
> diff --git a/arch/arm/mach-mxs/clock-mx28.c
> b/arch/arm/mach-mxs/clock-mx28.c index 1867a17..cca2cf7 100644
> --- a/arch/arm/mach-mxs/clock-mx28.c
> +++ b/arch/arm/mach-mxs/clock-mx28.c
> @@ -625,8 +625,8 @@ static struct clk_lookup lookups[] = {
>  	_REGISTER_CLOCK("mxs-auart.4", NULL, uart_clk)
>  	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
>  	_REGISTER_CLOCK("pll2", NULL, pll2_clk)
> -	_REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
> -	_REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
> +	_REGISTER_CLOCK("imx28-dma-apbh", NULL, hbus_clk)
> +	_REGISTER_CLOCK("imx28-dma-apbx", NULL, xbus_clk)
>  	_REGISTER_CLOCK("mxs-mmc.0", NULL, ssp0_clk)
>  	_REGISTER_CLOCK("mxs-mmc.1", NULL, ssp1_clk)
>  	_REGISTER_CLOCK("mxs-mmc.2", NULL, ssp2_clk)
> diff --git a/arch/arm/mach-mxs/devices/platform-dma.c
> b/arch/arm/mach-mxs/devices/platform-dma.c index 6a0202b..aff4813 100644
> --- a/arch/arm/mach-mxs/devices/platform-dma.c
> +++ b/arch/arm/mach-mxs/devices/platform-dma.c
> @@ -32,17 +32,19 @@ static struct platform_device *__init mxs_add_dma(const
> char *devid,
> 
>  static int __init mxs_add_mxs_dma(void)
>  {
> -	char *apbh = "mxs-dma-apbh";
> -	char *apbx = "mxs-dma-apbx";
> +	char *mx23_apbh = "imx23-dma-apbh";
> +	char *mx23_apbx = "imx23-dma-apbx";
> +	char *mx28_apbh = "imx28-dma-apbh";
> +	char *mx28_apbx = "imx28-dma-apbx";

Wild guess ... but const char * won't hurt here ?

> 
>  	if (cpu_is_mx23()) {
> -		mxs_add_dma(apbh, MX23_APBH_DMA_BASE_ADDR);
> -		mxs_add_dma(apbx, MX23_APBX_DMA_BASE_ADDR);
> +		mxs_add_dma(mx23_apbh, MX23_APBH_DMA_BASE_ADDR);
> +		mxs_add_dma(mx23_apbx, MX23_APBX_DMA_BASE_ADDR);
>  	}
> 
>  	if (cpu_is_mx28()) {
> -		mxs_add_dma(apbh, MX28_APBH_DMA_BASE_ADDR);
> -		mxs_add_dma(apbx, MX28_APBX_DMA_BASE_ADDR);
> +		mxs_add_dma(mx28_apbh, MX28_APBH_DMA_BASE_ADDR);
> +		mxs_add_dma(mx28_apbx, MX28_APBX_DMA_BASE_ADDR);
>  	}
> 
>  	return 0;
> diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
> index 0fefdd3..d8505d3 100644
> --- a/drivers/dma/mxs-dma.c
> +++ b/drivers/dma/mxs-dma.c
> @@ -35,12 +35,8 @@
>   * dma can program the controller registers of peripheral devices.
>   */
> 
> -#define MXS_DMA_APBH		0
> -#define MXS_DMA_APBX		1
> -#define dma_is_apbh()		(mxs_dma->dev_id == MXS_DMA_APBH)
> -
> -#define APBH_VERSION_LATEST	3
> -#define apbh_is_old()		(mxs_dma->version < APBH_VERSION_LATEST)
> +#define dma_is_apbh()		(mxs_dma->type == MXS_DMA_APBH)
> +#define apbh_is_old()		(mxs_dma->dev_id == IMX23_DMA)
> 
>  #define HW_APBHX_CTRL0				0x000
>  #define BM_APBH_CTRL0_APB_BURST8_EN		(1 << 29)
> @@ -50,9 +46,6 @@
>  #define HW_APBHX_CTRL2				0x020
>  #define HW_APBHX_CHANNEL_CTRL			0x030
>  #define BP_APBHX_CHANNEL_CTRL_RESET_CHANNEL	16
> -#define HW_APBH_VERSION				(cpu_is_mx23() ? 0x3f0 : 
0x800)
> -#define HW_APBX_VERSION				0x800
> -#define BP_APBHX_VERSION_MAJOR			24
>  #define HW_APBHX_CHn_NXTCMDAR(n) \
>  	(((dma_is_apbh() && apbh_is_old()) ? 0x050 : 0x110) + (n) * 0x70)
>  #define HW_APBHX_CHn_SEMA(n) \
> @@ -120,9 +113,19 @@ struct mxs_dma_chan {
>  #define MXS_DMA_CHANNELS		16
>  #define MXS_DMA_CHANNELS_MASK		0xffff
> 
> +enum mxs_dma_devtype {
> +	MXS_DMA_APBH,
> +	MXS_DMA_APBX,
> +};
> +
> +enum mxs_dma_id {
> +	IMX23_DMA,
> +	IMX28_DMA,
> +};
> +
>  struct mxs_dma_engine {
> -	int				dev_id;
> -	unsigned int			version;
> +	enum mxs_dma_id			dev_id;
> +	enum mxs_dma_devtype		type;
>  	void __iomem			*base;
>  	struct clk			*clk;
>  	struct dma_device		dma_device;
> @@ -130,6 +133,66 @@ struct mxs_dma_engine {
>  	struct mxs_dma_chan		mxs_chans[MXS_DMA_CHANNELS];
>  };
> 
> +struct mxs_dma_type {
> +	enum mxs_dma_id id;
> +	enum mxs_dma_devtype type;
> +};
> +
> +static struct mxs_dma_type mxs_dma_types[] = {
> +	{
> +		.id = IMX23_DMA,
> +		.type = MXS_DMA_APBH,
> +	}, {
> +		.id = IMX23_DMA,
> +		.type = MXS_DMA_APBX,
> +	}, {
> +		.id = IMX28_DMA,
> +		.type = MXS_DMA_APBH,
> +	}, {
> +		.id = IMX28_DMA,
> +		.type = MXS_DMA_APBX,
> +	}
> +};
> +
> +static struct platform_device_id mxs_dma_ids[] = {
> +	{
> +		.name = "imx23-dma-apbh",
> +		.driver_data = (kernel_ulong_t) &mxs_dma_types[0],
> +	}, {
> +		.name = "imx23-dma-apbx",
> +		.driver_data = (kernel_ulong_t) &mxs_dma_types[1],
> +	}, {
> +		.name = "imx28-dma-apbh",
> +		.driver_data = (kernel_ulong_t) &mxs_dma_types[2],
> +	}, {
> +		.name = "imx28-dma-apbx",
> +		.driver_data = (kernel_ulong_t) &mxs_dma_types[3],
> +	}, {
> +		/* end of list */
> +	}
> +};
> +
> +static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)
> +{
> +	return container_of(chan, struct mxs_dma_chan, chan);
> +}
> +
> +int mxs_dma_is_apbh(struct dma_chan *chan)
> +{
> +	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
> +	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;

Do you need the above here ? :)

> +
> +	return dma_is_apbh();
> +}
> +
> +int mxs_dma_is_apbx(struct dma_chan *chan)
> +{
> +	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
> +	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
> +

Dtto ?

> +	return !dma_is_apbh();
> +}
> +
>  static void mxs_dma_reset_chan(struct mxs_dma_chan *mxs_chan)
>  {
>  	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
> @@ -193,11 +256,6 @@ static void mxs_dma_resume_chan(struct mxs_dma_chan
> *mxs_chan) mxs_chan->status = DMA_IN_PROGRESS;
>  }
> 
> -static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)
> -{
> -	return container_of(chan, struct mxs_dma_chan, chan);
> -}
> -
>  static dma_cookie_t mxs_dma_tx_submit(struct dma_async_tx_descriptor *tx)
>  {
>  	return dma_cookie_assign(tx);
> @@ -570,12 +628,6 @@ static int __init mxs_dma_init(struct mxs_dma_engine
> *mxs_dma) if (ret)
>  		goto err_out;
> 
> -	/* only major version matters */
> -	mxs_dma->version = readl(mxs_dma->base +
> -				((mxs_dma->dev_id == MXS_DMA_APBX) ?
> -				HW_APBX_VERSION : HW_APBH_VERSION)) >>
> -				BP_APBHX_VERSION_MAJOR;
> -
>  	/* enable apbh burst */
>  	if (dma_is_apbh()) {
>  		writel(BM_APBH_CTRL0_APB_BURST_EN,
> @@ -597,6 +649,8 @@ static int __init mxs_dma_probe(struct platform_device
> *pdev) {
>  	const struct platform_device_id *id_entry =
>  				platform_get_device_id(pdev);
> +	const struct mxs_dma_type *dma_type =
> +			(struct mxs_dma_type *)id_entry->driver_data;
>  	struct mxs_dma_engine *mxs_dma;
>  	struct resource *iores;
>  	int ret, i;
> @@ -605,7 +659,8 @@ static int __init mxs_dma_probe(struct platform_device
> *pdev) if (!mxs_dma)
>  		return -ENOMEM;
> 
> -	mxs_dma->dev_id = id_entry->driver_data;
> +	mxs_dma->dev_id = dma_type->id;
> +	mxs_dma->type = dma_type->type;
> 
>  	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> 
> @@ -688,23 +743,11 @@ err_request_region:
>  	return ret;
>  }
> 
> -static struct platform_device_id mxs_dma_type[] = {
> -	{
> -		.name = "mxs-dma-apbh",
> -		.driver_data = MXS_DMA_APBH,
> -	}, {
> -		.name = "mxs-dma-apbx",
> -		.driver_data = MXS_DMA_APBX,
> -	}, {
> -		/* end of list */
> -	}
> -};
> -
>  static struct platform_driver mxs_dma_driver = {
>  	.driver		= {
>  		.name	= "mxs-dma",
>  	},
> -	.id_table	= mxs_dma_type,
> +	.id_table	= mxs_dma_ids,
>  };
> 
>  static int __init mxs_dma_module_init(void)
> diff --git a/include/linux/fsl/mxs-dma.h b/include/linux/fsl/mxs-dma.h
> index 203d7c4..55d8702 100644
> --- a/include/linux/fsl/mxs-dma.h
> +++ b/include/linux/fsl/mxs-dma.h
> @@ -15,14 +15,6 @@ struct mxs_dma_data {
>  	int chan_irq;
>  };
> 
> -static inline int mxs_dma_is_apbh(struct dma_chan *chan)
> -{
> -	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbh");
> -}
> -
> -static inline int mxs_dma_is_apbx(struct dma_chan *chan)
> -{
> -	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbx");
> -}
> -
> +extern int mxs_dma_is_apbh(struct dma_chan *chan);
> +extern int mxs_dma_is_apbx(struct dma_chan *chan);
>  #endif /* __MACH_MXS_DMA_H__ */

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
@ 2012-05-04 12:15       ` Marek Vasut
  0 siblings, 0 replies; 34+ messages in thread
From: Marek Vasut @ 2012-05-04 12:15 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Dong Aisheng,

> From: Dong Aisheng <dong.aisheng@linaro.org>
> 
> Rewrite mxs_dma_is_apbh and mxs_dma_is_apbx in order to support
> other SoCs like imx6q and reform the platform_device_id for the
> better further dt support.
> 
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Huang Shijie <b32955@freescale.com>
> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
> Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
> ---
> ChangeLog v1->v2:
> * remove using mxs_dma->version
> * other minor fixes suggested by Shawn.
> ---
>  arch/arm/mach-mxs/clock-mx23.c           |    4 +-
>  arch/arm/mach-mxs/clock-mx28.c           |    4 +-
>  arch/arm/mach-mxs/devices/platform-dma.c |   14 ++--
>  drivers/dma/mxs-dma.c                    |  115
> ++++++++++++++++++++--------- include/linux/fsl/mxs-dma.h              |  
> 12 +---
>  5 files changed, 93 insertions(+), 56 deletions(-)
> 
> diff --git a/arch/arm/mach-mxs/clock-mx23.c
> b/arch/arm/mach-mxs/clock-mx23.c index e3ac52c..1e67b85 100644
> --- a/arch/arm/mach-mxs/clock-mx23.c
> +++ b/arch/arm/mach-mxs/clock-mx23.c
> @@ -427,8 +427,8 @@ static struct clk_lookup lookups[] = {
>  	_REGISTER_CLOCK("duart", NULL, uart_clk)
>  	_REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk)
>  	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
> -	_REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
> -	_REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
> +	_REGISTER_CLOCK("imx23-dma-apbh", NULL, hbus_clk)
> +	_REGISTER_CLOCK("imx23-dma-apbx", NULL, xbus_clk)
>  	_REGISTER_CLOCK("mxs-mmc.0", NULL, ssp_clk)
>  	_REGISTER_CLOCK("mxs-mmc.1", NULL, ssp_clk)
>  	_REGISTER_CLOCK(NULL, "usb", usb_clk)
> diff --git a/arch/arm/mach-mxs/clock-mx28.c
> b/arch/arm/mach-mxs/clock-mx28.c index 1867a17..cca2cf7 100644
> --- a/arch/arm/mach-mxs/clock-mx28.c
> +++ b/arch/arm/mach-mxs/clock-mx28.c
> @@ -625,8 +625,8 @@ static struct clk_lookup lookups[] = {
>  	_REGISTER_CLOCK("mxs-auart.4", NULL, uart_clk)
>  	_REGISTER_CLOCK("rtc", NULL, rtc_clk)
>  	_REGISTER_CLOCK("pll2", NULL, pll2_clk)
> -	_REGISTER_CLOCK("mxs-dma-apbh", NULL, hbus_clk)
> -	_REGISTER_CLOCK("mxs-dma-apbx", NULL, xbus_clk)
> +	_REGISTER_CLOCK("imx28-dma-apbh", NULL, hbus_clk)
> +	_REGISTER_CLOCK("imx28-dma-apbx", NULL, xbus_clk)
>  	_REGISTER_CLOCK("mxs-mmc.0", NULL, ssp0_clk)
>  	_REGISTER_CLOCK("mxs-mmc.1", NULL, ssp1_clk)
>  	_REGISTER_CLOCK("mxs-mmc.2", NULL, ssp2_clk)
> diff --git a/arch/arm/mach-mxs/devices/platform-dma.c
> b/arch/arm/mach-mxs/devices/platform-dma.c index 6a0202b..aff4813 100644
> --- a/arch/arm/mach-mxs/devices/platform-dma.c
> +++ b/arch/arm/mach-mxs/devices/platform-dma.c
> @@ -32,17 +32,19 @@ static struct platform_device *__init mxs_add_dma(const
> char *devid,
> 
>  static int __init mxs_add_mxs_dma(void)
>  {
> -	char *apbh = "mxs-dma-apbh";
> -	char *apbx = "mxs-dma-apbx";
> +	char *mx23_apbh = "imx23-dma-apbh";
> +	char *mx23_apbx = "imx23-dma-apbx";
> +	char *mx28_apbh = "imx28-dma-apbh";
> +	char *mx28_apbx = "imx28-dma-apbx";

Wild guess ... but const char * won't hurt here ?

> 
>  	if (cpu_is_mx23()) {
> -		mxs_add_dma(apbh, MX23_APBH_DMA_BASE_ADDR);
> -		mxs_add_dma(apbx, MX23_APBX_DMA_BASE_ADDR);
> +		mxs_add_dma(mx23_apbh, MX23_APBH_DMA_BASE_ADDR);
> +		mxs_add_dma(mx23_apbx, MX23_APBX_DMA_BASE_ADDR);
>  	}
> 
>  	if (cpu_is_mx28()) {
> -		mxs_add_dma(apbh, MX28_APBH_DMA_BASE_ADDR);
> -		mxs_add_dma(apbx, MX28_APBX_DMA_BASE_ADDR);
> +		mxs_add_dma(mx28_apbh, MX28_APBH_DMA_BASE_ADDR);
> +		mxs_add_dma(mx28_apbx, MX28_APBX_DMA_BASE_ADDR);
>  	}
> 
>  	return 0;
> diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
> index 0fefdd3..d8505d3 100644
> --- a/drivers/dma/mxs-dma.c
> +++ b/drivers/dma/mxs-dma.c
> @@ -35,12 +35,8 @@
>   * dma can program the controller registers of peripheral devices.
>   */
> 
> -#define MXS_DMA_APBH		0
> -#define MXS_DMA_APBX		1
> -#define dma_is_apbh()		(mxs_dma->dev_id == MXS_DMA_APBH)
> -
> -#define APBH_VERSION_LATEST	3
> -#define apbh_is_old()		(mxs_dma->version < APBH_VERSION_LATEST)
> +#define dma_is_apbh()		(mxs_dma->type == MXS_DMA_APBH)
> +#define apbh_is_old()		(mxs_dma->dev_id == IMX23_DMA)
> 
>  #define HW_APBHX_CTRL0				0x000
>  #define BM_APBH_CTRL0_APB_BURST8_EN		(1 << 29)
> @@ -50,9 +46,6 @@
>  #define HW_APBHX_CTRL2				0x020
>  #define HW_APBHX_CHANNEL_CTRL			0x030
>  #define BP_APBHX_CHANNEL_CTRL_RESET_CHANNEL	16
> -#define HW_APBH_VERSION				(cpu_is_mx23() ? 0x3f0 : 
0x800)
> -#define HW_APBX_VERSION				0x800
> -#define BP_APBHX_VERSION_MAJOR			24
>  #define HW_APBHX_CHn_NXTCMDAR(n) \
>  	(((dma_is_apbh() && apbh_is_old()) ? 0x050 : 0x110) + (n) * 0x70)
>  #define HW_APBHX_CHn_SEMA(n) \
> @@ -120,9 +113,19 @@ struct mxs_dma_chan {
>  #define MXS_DMA_CHANNELS		16
>  #define MXS_DMA_CHANNELS_MASK		0xffff
> 
> +enum mxs_dma_devtype {
> +	MXS_DMA_APBH,
> +	MXS_DMA_APBX,
> +};
> +
> +enum mxs_dma_id {
> +	IMX23_DMA,
> +	IMX28_DMA,
> +};
> +
>  struct mxs_dma_engine {
> -	int				dev_id;
> -	unsigned int			version;
> +	enum mxs_dma_id			dev_id;
> +	enum mxs_dma_devtype		type;
>  	void __iomem			*base;
>  	struct clk			*clk;
>  	struct dma_device		dma_device;
> @@ -130,6 +133,66 @@ struct mxs_dma_engine {
>  	struct mxs_dma_chan		mxs_chans[MXS_DMA_CHANNELS];
>  };
> 
> +struct mxs_dma_type {
> +	enum mxs_dma_id id;
> +	enum mxs_dma_devtype type;
> +};
> +
> +static struct mxs_dma_type mxs_dma_types[] = {
> +	{
> +		.id = IMX23_DMA,
> +		.type = MXS_DMA_APBH,
> +	}, {
> +		.id = IMX23_DMA,
> +		.type = MXS_DMA_APBX,
> +	}, {
> +		.id = IMX28_DMA,
> +		.type = MXS_DMA_APBH,
> +	}, {
> +		.id = IMX28_DMA,
> +		.type = MXS_DMA_APBX,
> +	}
> +};
> +
> +static struct platform_device_id mxs_dma_ids[] = {
> +	{
> +		.name = "imx23-dma-apbh",
> +		.driver_data = (kernel_ulong_t) &mxs_dma_types[0],
> +	}, {
> +		.name = "imx23-dma-apbx",
> +		.driver_data = (kernel_ulong_t) &mxs_dma_types[1],
> +	}, {
> +		.name = "imx28-dma-apbh",
> +		.driver_data = (kernel_ulong_t) &mxs_dma_types[2],
> +	}, {
> +		.name = "imx28-dma-apbx",
> +		.driver_data = (kernel_ulong_t) &mxs_dma_types[3],
> +	}, {
> +		/* end of list */
> +	}
> +};
> +
> +static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)
> +{
> +	return container_of(chan, struct mxs_dma_chan, chan);
> +}
> +
> +int mxs_dma_is_apbh(struct dma_chan *chan)
> +{
> +	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
> +	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;

Do you need the above here ? :)

> +
> +	return dma_is_apbh();
> +}
> +
> +int mxs_dma_is_apbx(struct dma_chan *chan)
> +{
> +	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
> +	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
> +

Dtto ?

> +	return !dma_is_apbh();
> +}
> +
>  static void mxs_dma_reset_chan(struct mxs_dma_chan *mxs_chan)
>  {
>  	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
> @@ -193,11 +256,6 @@ static void mxs_dma_resume_chan(struct mxs_dma_chan
> *mxs_chan) mxs_chan->status = DMA_IN_PROGRESS;
>  }
> 
> -static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)
> -{
> -	return container_of(chan, struct mxs_dma_chan, chan);
> -}
> -
>  static dma_cookie_t mxs_dma_tx_submit(struct dma_async_tx_descriptor *tx)
>  {
>  	return dma_cookie_assign(tx);
> @@ -570,12 +628,6 @@ static int __init mxs_dma_init(struct mxs_dma_engine
> *mxs_dma) if (ret)
>  		goto err_out;
> 
> -	/* only major version matters */
> -	mxs_dma->version = readl(mxs_dma->base +
> -				((mxs_dma->dev_id == MXS_DMA_APBX) ?
> -				HW_APBX_VERSION : HW_APBH_VERSION)) >>
> -				BP_APBHX_VERSION_MAJOR;
> -
>  	/* enable apbh burst */
>  	if (dma_is_apbh()) {
>  		writel(BM_APBH_CTRL0_APB_BURST_EN,
> @@ -597,6 +649,8 @@ static int __init mxs_dma_probe(struct platform_device
> *pdev) {
>  	const struct platform_device_id *id_entry =
>  				platform_get_device_id(pdev);
> +	const struct mxs_dma_type *dma_type =
> +			(struct mxs_dma_type *)id_entry->driver_data;
>  	struct mxs_dma_engine *mxs_dma;
>  	struct resource *iores;
>  	int ret, i;
> @@ -605,7 +659,8 @@ static int __init mxs_dma_probe(struct platform_device
> *pdev) if (!mxs_dma)
>  		return -ENOMEM;
> 
> -	mxs_dma->dev_id = id_entry->driver_data;
> +	mxs_dma->dev_id = dma_type->id;
> +	mxs_dma->type = dma_type->type;
> 
>  	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> 
> @@ -688,23 +743,11 @@ err_request_region:
>  	return ret;
>  }
> 
> -static struct platform_device_id mxs_dma_type[] = {
> -	{
> -		.name = "mxs-dma-apbh",
> -		.driver_data = MXS_DMA_APBH,
> -	}, {
> -		.name = "mxs-dma-apbx",
> -		.driver_data = MXS_DMA_APBX,
> -	}, {
> -		/* end of list */
> -	}
> -};
> -
>  static struct platform_driver mxs_dma_driver = {
>  	.driver		= {
>  		.name	= "mxs-dma",
>  	},
> -	.id_table	= mxs_dma_type,
> +	.id_table	= mxs_dma_ids,
>  };
> 
>  static int __init mxs_dma_module_init(void)
> diff --git a/include/linux/fsl/mxs-dma.h b/include/linux/fsl/mxs-dma.h
> index 203d7c4..55d8702 100644
> --- a/include/linux/fsl/mxs-dma.h
> +++ b/include/linux/fsl/mxs-dma.h
> @@ -15,14 +15,6 @@ struct mxs_dma_data {
>  	int chan_irq;
>  };
> 
> -static inline int mxs_dma_is_apbh(struct dma_chan *chan)
> -{
> -	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbh");
> -}
> -
> -static inline int mxs_dma_is_apbx(struct dma_chan *chan)
> -{
> -	return !strcmp(dev_name(chan->device->dev), "mxs-dma-apbx");
> -}
> -
> +extern int mxs_dma_is_apbh(struct dma_chan *chan);
> +extern int mxs_dma_is_apbx(struct dma_chan *chan);
>  #endif /* __MACH_MXS_DMA_H__ */

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
  2012-05-04 12:15       ` Marek Vasut
@ 2012-05-04 14:34           ` Shawn Guo
  -1 siblings, 0 replies; 34+ messages in thread
From: Shawn Guo @ 2012-05-04 14:34 UTC (permalink / raw)
  To: Marek Vasut
  Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	b32955-KZfg59tc24xl57MIdRCFDg, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, May 04, 2012 at 02:15:03PM +0200, Marek Vasut wrote:
> >  static int __init mxs_add_mxs_dma(void)
> >  {
> > -	char *apbh = "mxs-dma-apbh";
> > -	char *apbx = "mxs-dma-apbx";
> > +	char *mx23_apbh = "imx23-dma-apbh";
> > +	char *mx23_apbx = "imx23-dma-apbx";
> > +	char *mx28_apbh = "imx28-dma-apbh";
> > +	char *mx28_apbx = "imx28-dma-apbx";
> 
> Wild guess ... but const char * won't hurt here ?
> 
Right.  I guess it just followed how the existing code looks like.
Considering this whole function will be removed patch #4, it should
not be a big problem, I guess.

> > -#define MXS_DMA_APBH		0
> > -#define MXS_DMA_APBX		1
> > -#define dma_is_apbh()		(mxs_dma->dev_id == MXS_DMA_APBH)
> > -
> > -#define APBH_VERSION_LATEST	3
> > -#define apbh_is_old()		(mxs_dma->version < APBH_VERSION_LATEST)
> > +#define dma_is_apbh()		(mxs_dma->type == MXS_DMA_APBH)
> > +#define apbh_is_old()		(mxs_dma->dev_id == IMX23_DMA)
> > 
...
> > +int mxs_dma_is_apbh(struct dma_chan *chan)
> > +{
> > +	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
> > +	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
> 
> Do you need the above here ? :)
> 
I have to confess it's my bad.  I made the code hard to read when I
created the driver.  The dma_is_apbh() should really takes mxs_dma
as a parameter than hiding it in the macro.

While I agree this is something should be improved, it may be better
to do it in another patch?

> > +
> > +	return dma_is_apbh();
> > +}

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
@ 2012-05-04 14:34           ` Shawn Guo
  0 siblings, 0 replies; 34+ messages in thread
From: Shawn Guo @ 2012-05-04 14:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 04, 2012 at 02:15:03PM +0200, Marek Vasut wrote:
> >  static int __init mxs_add_mxs_dma(void)
> >  {
> > -	char *apbh = "mxs-dma-apbh";
> > -	char *apbx = "mxs-dma-apbx";
> > +	char *mx23_apbh = "imx23-dma-apbh";
> > +	char *mx23_apbx = "imx23-dma-apbx";
> > +	char *mx28_apbh = "imx28-dma-apbh";
> > +	char *mx28_apbx = "imx28-dma-apbx";
> 
> Wild guess ... but const char * won't hurt here ?
> 
Right.  I guess it just followed how the existing code looks like.
Considering this whole function will be removed patch #4, it should
not be a big problem, I guess.

> > -#define MXS_DMA_APBH		0
> > -#define MXS_DMA_APBX		1
> > -#define dma_is_apbh()		(mxs_dma->dev_id == MXS_DMA_APBH)
> > -
> > -#define APBH_VERSION_LATEST	3
> > -#define apbh_is_old()		(mxs_dma->version < APBH_VERSION_LATEST)
> > +#define dma_is_apbh()		(mxs_dma->type == MXS_DMA_APBH)
> > +#define apbh_is_old()		(mxs_dma->dev_id == IMX23_DMA)
> > 
...
> > +int mxs_dma_is_apbh(struct dma_chan *chan)
> > +{
> > +	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
> > +	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
> 
> Do you need the above here ? :)
> 
I have to confess it's my bad.  I made the code hard to read when I
created the driver.  The dma_is_apbh() should really takes mxs_dma
as a parameter than hiding it in the macro.

While I agree this is something should be improved, it may be better
to do it in another patch?

> > +
> > +	return dma_is_apbh();
> > +}

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality
  2012-05-04 12:12 ` Dong Aisheng
@ 2012-05-04 14:44     ` Shawn Guo
  -1 siblings, 0 replies; 34+ messages in thread
From: Shawn Guo @ 2012-05-04 14:44 UTC (permalink / raw)
  To: Dong Aisheng
  Cc: marek.vasut-Re5JQEeQqe8AvxtiuMwx3w,
	vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	b32955-KZfg59tc24xl57MIdRCFDg, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, May 04, 2012 at 08:12:15PM +0800, Dong Aisheng wrote:
>  #include <asm/irq.h>
> -#include <mach/mxs.h>

I do not think you can remove this inclusion in this patch, since the
use of cpu_is_mx23() does not get removed from mxs-dma driver until
patch #2.

You do not have to resend the series, if there are no other outstanding
comments coming up.  I expect the series will go through arm-soc tree
to ease the merging.  I can fix it when applying the series.

Hi Vinod,

Please let me know if you have problem with the series going through
arm-soc than dma tree.  Thanks.

> -#include <mach/common.h>

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality
@ 2012-05-04 14:44     ` Shawn Guo
  0 siblings, 0 replies; 34+ messages in thread
From: Shawn Guo @ 2012-05-04 14:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 04, 2012 at 08:12:15PM +0800, Dong Aisheng wrote:
>  #include <asm/irq.h>
> -#include <mach/mxs.h>

I do not think you can remove this inclusion in this patch, since the
use of cpu_is_mx23() does not get removed from mxs-dma driver until
patch #2.

You do not have to resend the series, if there are no other outstanding
comments coming up.  I expect the series will go through arm-soc tree
to ease the merging.  I can fix it when applying the series.

Hi Vinod,

Please let me know if you have problem with the series going through
arm-soc than dma tree.  Thanks.

> -#include <mach/common.h>

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality
  2012-05-04 12:12 ` Dong Aisheng
@ 2012-05-04 16:02     ` Wolfram Sang
  -1 siblings, 0 replies; 34+ messages in thread
From: Wolfram Sang @ 2012-05-04 16:02 UTC (permalink / raw)
  To: Dong Aisheng
  Cc: b32955-KZfg59tc24xl57MIdRCFDg, vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	marek.vasut-Re5JQEeQqe8AvxtiuMwx3w,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r


[-- Attachment #1.1: Type: text/plain, Size: 979 bytes --]

On Fri, May 04, 2012 at 08:12:15PM +0800, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> 
> This can get rid of the mach-dependency.
> 
> Cc: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Dan Williams <dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Cc: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> Cc: Huang Shijie <b32955-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> Reviewed-by: Marek Vasut <marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Dong Aisheng <dong.aisheng-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

Looks good to me, thanks!

Acked-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality
@ 2012-05-04 16:02     ` Wolfram Sang
  0 siblings, 0 replies; 34+ messages in thread
From: Wolfram Sang @ 2012-05-04 16:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 04, 2012 at 08:12:15PM +0800, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
> 
> This can get rid of the mach-dependency.
> 
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Huang Shijie <b32955@freescale.com>
> Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
> Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>

Looks good to me, thanks!

Acked-by: Wolfram Sang <w.sang@pengutronix.de>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120504/f0910967/attachment.sig>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
  2012-05-04 14:34           ` Shawn Guo
@ 2012-05-05 13:12               ` Marek Vasut
  -1 siblings, 0 replies; 34+ messages in thread
From: Marek Vasut @ 2012-05-05 13:12 UTC (permalink / raw)
  To: Shawn Guo
  Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	b32955-KZfg59tc24xl57MIdRCFDg, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Dear Shawn Guo,

> On Fri, May 04, 2012 at 02:15:03PM +0200, Marek Vasut wrote:
> > >  static int __init mxs_add_mxs_dma(void)
> > >  {
> > > 
> > > -	char *apbh = "mxs-dma-apbh";
> > > -	char *apbx = "mxs-dma-apbx";
> > > +	char *mx23_apbh = "imx23-dma-apbh";
> > > +	char *mx23_apbx = "imx23-dma-apbx";
> > > +	char *mx28_apbh = "imx28-dma-apbh";
> > > +	char *mx28_apbx = "imx28-dma-apbx";
> > 
> > Wild guess ... but const char * won't hurt here ?
> 
> Right.  I guess it just followed how the existing code looks like.
> Considering this whole function will be removed patch #4, it should
> not be a big problem, I guess.

Can't the patches be reordered then to avoid adding this altogether?

> > > -#define MXS_DMA_APBH		0
> > > -#define MXS_DMA_APBX		1
> > > -#define dma_is_apbh()		(mxs_dma->dev_id == MXS_DMA_APBH)
> > > -
> > > -#define APBH_VERSION_LATEST	3
> > > -#define apbh_is_old()		(mxs_dma->version < APBH_VERSION_LATEST)
> > > +#define dma_is_apbh()		(mxs_dma->type == MXS_DMA_APBH)
> > > +#define apbh_is_old()		(mxs_dma->dev_id == IMX23_DMA)
> 
> ...
> 
> > > +int mxs_dma_is_apbh(struct dma_chan *chan)
> > > +{
> > > +	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
> > > +	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
> > 
> > Do you need the above here ? :)
> 
> I have to confess it's my bad.  I made the code hard to read when I
> created the driver.  The dma_is_apbh() should really takes mxs_dma
> as a parameter than hiding it in the macro.
> 
> While I agree this is something should be improved, it may be better
> to do it in another patch?

You don't have to add dead code in this patch and re-add it when needed. Or fix 
the macro to take the parameter then, though I don't understand why you'd want 
to take it and then hide it.

> > > +
> > > +	return dma_is_apbh();
> > > +}

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
@ 2012-05-05 13:12               ` Marek Vasut
  0 siblings, 0 replies; 34+ messages in thread
From: Marek Vasut @ 2012-05-05 13:12 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Shawn Guo,

> On Fri, May 04, 2012 at 02:15:03PM +0200, Marek Vasut wrote:
> > >  static int __init mxs_add_mxs_dma(void)
> > >  {
> > > 
> > > -	char *apbh = "mxs-dma-apbh";
> > > -	char *apbx = "mxs-dma-apbx";
> > > +	char *mx23_apbh = "imx23-dma-apbh";
> > > +	char *mx23_apbx = "imx23-dma-apbx";
> > > +	char *mx28_apbh = "imx28-dma-apbh";
> > > +	char *mx28_apbx = "imx28-dma-apbx";
> > 
> > Wild guess ... but const char * won't hurt here ?
> 
> Right.  I guess it just followed how the existing code looks like.
> Considering this whole function will be removed patch #4, it should
> not be a big problem, I guess.

Can't the patches be reordered then to avoid adding this altogether?

> > > -#define MXS_DMA_APBH		0
> > > -#define MXS_DMA_APBX		1
> > > -#define dma_is_apbh()		(mxs_dma->dev_id == MXS_DMA_APBH)
> > > -
> > > -#define APBH_VERSION_LATEST	3
> > > -#define apbh_is_old()		(mxs_dma->version < APBH_VERSION_LATEST)
> > > +#define dma_is_apbh()		(mxs_dma->type == MXS_DMA_APBH)
> > > +#define apbh_is_old()		(mxs_dma->dev_id == IMX23_DMA)
> 
> ...
> 
> > > +int mxs_dma_is_apbh(struct dma_chan *chan)
> > > +{
> > > +	struct mxs_dma_chan *mxs_chan = to_mxs_dma_chan(chan);
> > > +	struct mxs_dma_engine *mxs_dma = mxs_chan->mxs_dma;
> > 
> > Do you need the above here ? :)
> 
> I have to confess it's my bad.  I made the code hard to read when I
> created the driver.  The dma_is_apbh() should really takes mxs_dma
> as a parameter than hiding it in the macro.
> 
> While I agree this is something should be improved, it may be better
> to do it in another patch?

You don't have to add dead code in this patch and re-add it when needed. Or fix 
the macro to take the parameter then, though I don't understand why you'd want 
to take it and then hide it.

> > > +
> > > +	return dma_is_apbh();
> > > +}

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
  2012-05-05 13:12               ` Marek Vasut
@ 2012-05-05 13:25                   ` Shawn Guo
  -1 siblings, 0 replies; 34+ messages in thread
From: Shawn Guo @ 2012-05-05 13:25 UTC (permalink / raw)
  To: Marek Vasut
  Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	b32955-KZfg59tc24xl57MIdRCFDg, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 5 May 2012 21:12, Marek Vasut <marex-ynQEQJNshbs@public.gmane.org> wrote:
> Can't the patches be reordered then to avoid adding this altogether?
>
Maybe.  But I do not think it's really worth the effort.

> You don't have to add dead code in this patch and re-add it when needed. Or fix
> the macro to take the parameter then, though I don't understand why you'd want
> to take it and then hide it.
>
I do not completely understand the comment.  My point is the problem
is in the existing code.  It's not introduced by Dong's patch.  The
problem should be fixed in another patch, and we do not want to do
several things in one patch.

Regards,
Shawn

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
@ 2012-05-05 13:25                   ` Shawn Guo
  0 siblings, 0 replies; 34+ messages in thread
From: Shawn Guo @ 2012-05-05 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 5 May 2012 21:12, Marek Vasut <marex@denx.de> wrote:
> Can't the patches be reordered then to avoid adding this altogether?
>
Maybe.  But I do not think it's really worth the effort.

> You don't have to add dead code in this patch and re-add it when needed. Or fix
> the macro to take the parameter then, though I don't understand why you'd want
> to take it and then hide it.
>
I do not completely understand the comment.  My point is the problem
is in the existing code.  It's not introduced by Dong's patch.  The
problem should be fixed in another patch, and we do not want to do
several things in one patch.

Regards,
Shawn

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
  2012-05-05 13:25                   ` Shawn Guo
@ 2012-05-05 14:32                       ` Marek Vasut
  -1 siblings, 0 replies; 34+ messages in thread
From: Marek Vasut @ 2012-05-05 14:32 UTC (permalink / raw)
  To: Shawn Guo
  Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ,
	b32955-KZfg59tc24xl57MIdRCFDg, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Dear Shawn Guo,

> On 5 May 2012 21:12, Marek Vasut <marex-ynQEQJNshbs@public.gmane.org> wrote:
> > Can't the patches be reordered then to avoid adding this altogether?
> 
> Maybe.  But I do not think it's really worth the effort.
> 
> > You don't have to add dead code in this patch and re-add it when needed.
> > Or fix the macro to take the parameter then, though I don't understand
> > why you'd want to take it and then hide it.
> 
> I do not completely understand the comment.  My point is the problem
> is in the existing code.  It's not introduced by Dong's patch.  The
> problem should be fixed in another patch, and we do not want to do
> several things in one patch.

Then order such a patch before Dong's series then? It'd all be clear, without 
compromises.

> 
> Regards,
> Shawn

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
@ 2012-05-05 14:32                       ` Marek Vasut
  0 siblings, 0 replies; 34+ messages in thread
From: Marek Vasut @ 2012-05-05 14:32 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Shawn Guo,

> On 5 May 2012 21:12, Marek Vasut <marex@denx.de> wrote:
> > Can't the patches be reordered then to avoid adding this altogether?
> 
> Maybe.  But I do not think it's really worth the effort.
> 
> > You don't have to add dead code in this patch and re-add it when needed.
> > Or fix the macro to take the parameter then, though I don't understand
> > why you'd want to take it and then hide it.
> 
> I do not completely understand the comment.  My point is the problem
> is in the existing code.  It's not introduced by Dong's patch.  The
> problem should be fixed in another patch, and we do not want to do
> several things in one patch.

Then order such a patch before Dong's series then? It'd all be clear, without 
compromises.

> 
> Regards,
> Shawn

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality
  2012-05-04 14:44     ` Shawn Guo
@ 2012-05-07  3:20         ` Dong Aisheng
  -1 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-07  3:20 UTC (permalink / raw)
  To: Shawn Guo
  Cc: marek.vasut-Re5JQEeQqe8AvxtiuMwx3w,
	vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, Huang Shijie-B32955,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Fri, May 04, 2012 at 10:44:56PM +0800, Shawn Guo wrote:
> On Fri, May 04, 2012 at 08:12:15PM +0800, Dong Aisheng wrote:
> >  #include <asm/irq.h>
> > -#include <mach/mxs.h>
> 
> I do not think you can remove this inclusion in this patch, since the
> use of cpu_is_mx23() does not get removed from mxs-dma driver until
> patch #2.
> 
Yes. I missed somehow.

> You do not have to resend the series, if there are no other outstanding
> comments coming up.  I expect the series will go through arm-soc tree
> to ease the merging.  I can fix it when applying the series.
> 
Thanks.

Regards
Dong Aisheng

> Hi Vinod,
> 
> Please let me know if you have problem with the series going through
> arm-soc than dma tree.  Thanks.
> 
> > -#include <mach/common.h>
> 
> -- 
> Regards,
> Shawn
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality
@ 2012-05-07  3:20         ` Dong Aisheng
  0 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-07  3:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, May 04, 2012 at 10:44:56PM +0800, Shawn Guo wrote:
> On Fri, May 04, 2012 at 08:12:15PM +0800, Dong Aisheng wrote:
> >  #include <asm/irq.h>
> > -#include <mach/mxs.h>
> 
> I do not think you can remove this inclusion in this patch, since the
> use of cpu_is_mx23() does not get removed from mxs-dma driver until
> patch #2.
> 
Yes. I missed somehow.

> You do not have to resend the series, if there are no other outstanding
> comments coming up.  I expect the series will go through arm-soc tree
> to ease the merging.  I can fix it when applying the series.
> 
Thanks.

Regards
Dong Aisheng

> Hi Vinod,
> 
> Please let me know if you have problem with the series going through
> arm-soc than dma tree.  Thanks.
> 
> > -#include <mach/common.h>
> 
> -- 
> Regards,
> Shawn
> 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
  2012-05-07  3:55                           ` Dong Aisheng
@ 2012-05-07  3:52                               ` Shawn Guo
  -1 siblings, 0 replies; 34+ messages in thread
From: Shawn Guo @ 2012-05-07  3:52 UTC (permalink / raw)
  To: Dong Aisheng
  Cc: Marek Vasut, vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, Huang Shijie-B32955,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 7 May 2012 11:55, Dong Aisheng <aisheng.dong-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
> Hmm, although not a big issue, but i can re-oder it to make most people happy with
> the patch.
>
I will take care of it, since I will need to rebase the series on
mxs-common-clk series anyway.  Hopefully, I can get it out today.

Regard,
Shawn

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
@ 2012-05-07  3:52                               ` Shawn Guo
  0 siblings, 0 replies; 34+ messages in thread
From: Shawn Guo @ 2012-05-07  3:52 UTC (permalink / raw)
  To: linux-arm-kernel

On 7 May 2012 11:55, Dong Aisheng <aisheng.dong@freescale.com> wrote:
> Hmm, although not a big issue, but i can re-oder it to make most people happy with
> the patch.
>
I will take care of it, since I will need to rebase the series on
mxs-common-clk series anyway.  Hopefully, I can get it out today.

Regard,
Shawn

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
  2012-05-05 14:32                       ` Marek Vasut
@ 2012-05-07  3:55                           ` Dong Aisheng
  -1 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-07  3:55 UTC (permalink / raw)
  To: Marek Vasut
  Cc: vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, Huang Shijie-B32955,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Sat, May 05, 2012 at 10:32:14PM +0800, Marek Vasut wrote:
> Dear Shawn Guo,
> 
> > On 5 May 2012 21:12, Marek Vasut <marex-ynQEQJNshbs@public.gmane.org> wrote:
> > > Can't the patches be reordered then to avoid adding this altogether?
> > 
> > Maybe.  But I do not think it's really worth the effort.
> > 
> > > You don't have to add dead code in this patch and re-add it when needed.
> > > Or fix the macro to take the parameter then, though I don't understand
> > > why you'd want to take it and then hide it.
> > 
> > I do not completely understand the comment.  My point is the problem
> > is in the existing code.  It's not introduced by Dong's patch.  The
> > problem should be fixed in another patch, and we do not want to do
> > several things in one patch.
> 
> Then order such a patch before Dong's series then? It'd all be clear, without 
> compromises.
> 
Hmm, although not a big issue, but i can re-oder it to make most people happy with
the patch.

Thanks

Regards
Dong Aisheng

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
@ 2012-05-07  3:55                           ` Dong Aisheng
  0 siblings, 0 replies; 34+ messages in thread
From: Dong Aisheng @ 2012-05-07  3:55 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, May 05, 2012 at 10:32:14PM +0800, Marek Vasut wrote:
> Dear Shawn Guo,
> 
> > On 5 May 2012 21:12, Marek Vasut <marex@denx.de> wrote:
> > > Can't the patches be reordered then to avoid adding this altogether?
> > 
> > Maybe.  But I do not think it's really worth the effort.
> > 
> > > You don't have to add dead code in this patch and re-add it when needed.
> > > Or fix the macro to take the parameter then, though I don't understand
> > > why you'd want to take it and then hide it.
> > 
> > I do not completely understand the comment.  My point is the problem
> > is in the existing code.  It's not introduced by Dong's patch.  The
> > problem should be fixed in another patch, and we do not want to do
> > several things in one patch.
> 
> Then order such a patch before Dong's series then? It'd all be clear, without 
> compromises.
> 
Hmm, although not a big issue, but i can re-oder it to make most people happy with
the patch.

Thanks

Regards
Dong Aisheng

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
  2012-05-07  3:52                               ` Shawn Guo
@ 2012-05-07  4:07                                   ` Marek Vasut
  -1 siblings, 0 replies; 34+ messages in thread
From: Marek Vasut @ 2012-05-07  4:07 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Dong Aisheng, vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, Huang Shijie-B32955,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Dear Shawn Guo,

> On 7 May 2012 11:55, Dong Aisheng <aisheng.dong-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
> > Hmm, although not a big issue, but i can re-oder it to make most people
> > happy with the patch.
> 
> I will take care of it, since I will need to rebase the series on
> mxs-common-clk series anyway.  Hopefully, I can get it out today.

Why do I get the feeling I'm the bad guy here ? :-)

> 
> Regard,
> Shawn

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
@ 2012-05-07  4:07                                   ` Marek Vasut
  0 siblings, 0 replies; 34+ messages in thread
From: Marek Vasut @ 2012-05-07  4:07 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Shawn Guo,

> On 7 May 2012 11:55, Dong Aisheng <aisheng.dong@freescale.com> wrote:
> > Hmm, although not a big issue, but i can re-oder it to make most people
> > happy with the patch.
> 
> I will take care of it, since I will need to rebase the series on
> mxs-common-clk series anyway.  Hopefully, I can get it out today.

Why do I get the feeling I'm the bad guy here ? :-)

> 
> Regard,
> Shawn

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
  2012-05-07  4:07                                   ` Marek Vasut
@ 2012-05-07  4:14                                       ` Shawn Guo
  -1 siblings, 0 replies; 34+ messages in thread
From: Shawn Guo @ 2012-05-07  4:14 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Dong Aisheng, vinod.koul-ral2JQCrhuEAvxtiuMwx3w,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	rob.herring-bsGFqQB8/DxBDgjK7y7TUQ, Huang Shijie-B32955,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	dan.j.williams-ral2JQCrhuEAvxtiuMwx3w,
	s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 7 May 2012 12:07, Marek Vasut <marex-ynQEQJNshbs@public.gmane.org> wrote:
> Why do I get the feeling I'm the bad guy here ? :-)
>
The "bad" buy is asking for good code, so welcome :)

Regards,
Shawn

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic
@ 2012-05-07  4:14                                       ` Shawn Guo
  0 siblings, 0 replies; 34+ messages in thread
From: Shawn Guo @ 2012-05-07  4:14 UTC (permalink / raw)
  To: linux-arm-kernel

On 7 May 2012 12:07, Marek Vasut <marex@denx.de> wrote:
> Why do I get the feeling I'm the bad guy here ? :-)
>
The "bad" buy is asking for good code, so welcome :)

Regards,
Shawn

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2012-05-07  4:14 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-04 12:12 [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality Dong Aisheng
2012-05-04 12:12 ` Dong Aisheng
2012-05-04 12:12 ` [PATCH v2 2/5] dma: mxs-dma: make platform_device_id more generic Dong Aisheng
2012-05-04 12:12   ` Dong Aisheng
     [not found]   ` <1336133539-13465-2-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-05-04 12:15     ` Marek Vasut
2012-05-04 12:15       ` Marek Vasut
     [not found]       ` <201205041415.04095.marek.vasut-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-05-04 14:34         ` Shawn Guo
2012-05-04 14:34           ` Shawn Guo
     [not found]           ` <20120504143442.GL2194-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-05-05 13:12             ` Marek Vasut
2012-05-05 13:12               ` Marek Vasut
     [not found]               ` <201205051512.17972.marex-ynQEQJNshbs@public.gmane.org>
2012-05-05 13:25                 ` Shawn Guo
2012-05-05 13:25                   ` Shawn Guo
     [not found]                   ` <CAAQ0ZWTztNaqwjVA257N+42PByhH1k1Gswi18S9G=dHEaO5PhQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-05 14:32                     ` Marek Vasut
2012-05-05 14:32                       ` Marek Vasut
     [not found]                       ` <201205051632.14882.marex-ynQEQJNshbs@public.gmane.org>
2012-05-07  3:55                         ` Dong Aisheng
2012-05-07  3:55                           ` Dong Aisheng
     [not found]                           ` <20120507035558.GB31245-Fb7DQEYuewWctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-05-07  3:52                             ` Shawn Guo
2012-05-07  3:52                               ` Shawn Guo
     [not found]                               ` <CAAQ0ZWSh8PL36VAQHY1NJLr+0fubkWY-LpNKZk6HOu+Hbxngiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-05-07  4:07                                 ` Marek Vasut
2012-05-07  4:07                                   ` Marek Vasut
     [not found]                                   ` <201205070607.58855.marex-ynQEQJNshbs@public.gmane.org>
2012-05-07  4:14                                     ` Shawn Guo
2012-05-07  4:14                                       ` Shawn Guo
2012-05-04 12:12 ` [PATCH v2 3/5] dma: mxs-dma: add device tree probe support Dong Aisheng
2012-05-04 12:12   ` Dong Aisheng
2012-05-04 12:12 ` [PATCH v2 5/5] ARM: mx28evk: add mxs-dma dt support Dong Aisheng
2012-05-04 12:12   ` Dong Aisheng
     [not found] ` <1336133539-13465-1-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-05-04 12:12   ` [PATCH v2 4/5] ARM: mxs: do not add dma device by default Dong Aisheng
2012-05-04 12:12     ` Dong Aisheng
2012-05-04 14:44   ` [PATCH v2 1/5] dma: mxs-dma: use global stmp_device functionality Shawn Guo
2012-05-04 14:44     ` Shawn Guo
     [not found]     ` <20120504144453.GM2194-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2012-05-07  3:20       ` Dong Aisheng
2012-05-07  3:20         ` Dong Aisheng
2012-05-04 16:02   ` Wolfram Sang
2012-05-04 16:02     ` Wolfram Sang

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.