linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] ARM: pxa: ssp: prepare for devicetree usage
@ 2013-08-12  8:37 Daniel Mack
  2013-08-12  8:37 ` [PATCH 1/5] ARM: pxa: ssp: remove unnecessary warning on kzalloc() failure Daniel Mack
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Daniel Mack @ 2013-08-12  8:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Haojian,

this is an excerpt of my pxa-dma patches that can be merged
independantly.

In contrast to what I already posted, this one contains a patch to make
ssp ports lookups from device nodes possible. As described in the
Documentation, users of ssp ports just reference the upstream by phandle.

The rest of the dma conversion will take more time anyway, so let's
better merge it step by step.


Thanks,
Daniel


Daniel Mack (5):
  ARM: pxa: ssp: remove unnecessary warning on kzalloc() failure
  ARM: pxa: ssp: add shortcut for &pdev->dev
  ARM: pxa: ssp: add DT bindings
  ARM: pxa: ssp: use devm_ functions
  ARM: pxa: ssp: add pxa_ssp_request_of()

 .../devicetree/bindings/serial/mrvl,pxa-ssp.txt    |  65 ++++++++
 arch/arm/plat-pxa/ssp.c                            | 174 ++++++++++++++-------
 include/linux/pxa2xx_ssp.h                         |  11 ++
 3 files changed, 193 insertions(+), 57 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/serial/mrvl,pxa-ssp.txt

-- 
1.8.3.1

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

* [PATCH 1/5] ARM: pxa: ssp: remove unnecessary warning on kzalloc() failure
  2013-08-12  8:37 [PATCH 0/5] ARM: pxa: ssp: prepare for devicetree usage Daniel Mack
@ 2013-08-12  8:37 ` Daniel Mack
  2013-08-12 10:38   ` Mark Brown
  2013-08-12  8:37 ` [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev Daniel Mack
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Daniel Mack @ 2013-08-12  8:37 UTC (permalink / raw)
  To: linux-arm-kernel

The memory subsystem will already complain loudly enough in such cases.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 arch/arm/plat-pxa/ssp.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index 8e11e96..f746b6a 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -80,10 +80,9 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 	int ret = 0;
 
 	ssp = kzalloc(sizeof(struct ssp_device), GFP_KERNEL);
-	if (ssp == NULL) {
-		dev_err(&pdev->dev, "failed to allocate memory");
+	if (ssp == NULL)
 		return -ENOMEM;
-	}
+
 	ssp->pdev = pdev;
 
 	ssp->clk = clk_get(&pdev->dev, NULL);
-- 
1.8.3.1

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

* [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev
  2013-08-12  8:37 [PATCH 0/5] ARM: pxa: ssp: prepare for devicetree usage Daniel Mack
  2013-08-12  8:37 ` [PATCH 1/5] ARM: pxa: ssp: remove unnecessary warning on kzalloc() failure Daniel Mack
@ 2013-08-12  8:37 ` Daniel Mack
  2013-08-12 10:38   ` Mark Brown
  2013-08-12  8:37 ` [PATCH 3/5] ARM: pxa: ssp: add DT bindings Daniel Mack
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Daniel Mack @ 2013-08-12  8:37 UTC (permalink / raw)
  To: linux-arm-kernel

No functional change, just a cosmetic cleanup.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 arch/arm/plat-pxa/ssp.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index f746b6a..65ba28a 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -77,6 +77,7 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 	const struct platform_device_id *id = platform_get_device_id(pdev);
 	struct resource *res;
 	struct ssp_device *ssp;
+	struct device *dev = &pdev->dev;
 	int ret = 0;
 
 	ssp = kzalloc(sizeof(struct ssp_device), GFP_KERNEL);
@@ -85,7 +86,7 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 
 	ssp->pdev = pdev;
 
-	ssp->clk = clk_get(&pdev->dev, NULL);
+	ssp->clk = clk_get(dev, NULL);
 	if (IS_ERR(ssp->clk)) {
 		ret = PTR_ERR(ssp->clk);
 		goto err_free;
@@ -93,7 +94,7 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
 	if (res == NULL) {
-		dev_err(&pdev->dev, "no SSP RX DRCMR defined\n");
+		dev_err(dev, "no SSP RX DRCMR defined\n");
 		ret = -ENODEV;
 		goto err_free_clk;
 	}
@@ -101,7 +102,7 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
 	if (res == NULL) {
-		dev_err(&pdev->dev, "no SSP TX DRCMR defined\n");
+		dev_err(dev, "no SSP TX DRCMR defined\n");
 		ret = -ENODEV;
 		goto err_free_clk;
 	}
@@ -109,7 +110,7 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (res == NULL) {
-		dev_err(&pdev->dev, "no memory resource defined\n");
+		dev_err(dev, "no memory resource defined\n");
 		ret = -ENODEV;
 		goto err_free_clk;
 	}
@@ -117,7 +118,7 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 	res = request_mem_region(res->start, resource_size(res),
 			pdev->name);
 	if (res == NULL) {
-		dev_err(&pdev->dev, "failed to request memory resource\n");
+		dev_err(dev, "failed to request memory resource\n");
 		ret = -EBUSY;
 		goto err_free_clk;
 	}
@@ -126,14 +127,14 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 
 	ssp->mmio_base = ioremap(res->start, resource_size(res));
 	if (ssp->mmio_base == NULL) {
-		dev_err(&pdev->dev, "failed to ioremap() registers\n");
+		dev_err(dev, "failed to ioremap() registers\n");
 		ret = -ENODEV;
 		goto err_free_mem;
 	}
 
 	ssp->irq = platform_get_irq(pdev, 0);
 	if (ssp->irq < 0) {
-		dev_err(&pdev->dev, "no IRQ resource defined\n");
+		dev_err(dev, "no IRQ resource defined\n");
 		ret = -ENODEV;
 		goto err_free_io;
 	}
-- 
1.8.3.1

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

* [PATCH 3/5] ARM: pxa: ssp: add DT bindings
  2013-08-12  8:37 [PATCH 0/5] ARM: pxa: ssp: prepare for devicetree usage Daniel Mack
  2013-08-12  8:37 ` [PATCH 1/5] ARM: pxa: ssp: remove unnecessary warning on kzalloc() failure Daniel Mack
  2013-08-12  8:37 ` [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev Daniel Mack
@ 2013-08-12  8:37 ` Daniel Mack
  2013-08-12  8:37 ` [PATCH 4/5] ARM: pxa: ssp: use devm_ functions Daniel Mack
  2013-08-12  8:37 ` [PATCH 5/5] ARM: pxa: ssp: add pxa_ssp_request_of() Daniel Mack
  4 siblings, 0 replies; 15+ messages in thread
From: Daniel Mack @ 2013-08-12  8:37 UTC (permalink / raw)
  To: linux-arm-kernel

This patch contains an ugly hack for looking up the the DMA request
number. The problem here is that the implementation as it stands will
allocate the DMA channel from the user of the ssp port, and hence we
cannot allocate a real channel here.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 .../devicetree/bindings/serial/mrvl,pxa-ssp.txt    | 65 ++++++++++++++++
 arch/arm/plat-pxa/ssp.c                            | 90 +++++++++++++++++-----
 2 files changed, 134 insertions(+), 21 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/serial/mrvl,pxa-ssp.txt

diff --git a/Documentation/devicetree/bindings/serial/mrvl,pxa-ssp.txt b/Documentation/devicetree/bindings/serial/mrvl,pxa-ssp.txt
new file mode 100644
index 0000000..669b814
--- /dev/null
+++ b/Documentation/devicetree/bindings/serial/mrvl,pxa-ssp.txt
@@ -0,0 +1,65 @@
+Device tree bindings for Marvell PXA SSP ports
+
+Required properties:
+
+	- compatible:	Must be one of
+				mrvl,pxa25x-ssp
+				mvrl,pxa25x-nssp
+				mrvl,pxa27x-ssp
+				mrvl,pxa3xx-ssp
+				mvrl,pxa168-ssp
+				mrvl,pxa910-ssp
+				mrvl,ce4100-ssp
+				mrvl,lpss-ssp
+
+	- reg:		The memory base
+	- dmas:		Two dma phandles, one for rx, one for tx
+	- dma-names:	Must be "rx", "tx"
+
+
+Example for PXA3xx:
+
+	ssp0: ssp at 41000000 {
+		compatible = "mrvl,pxa3xx-ssp";
+		reg = <0x41000000 0x40>;
+		ssp-id = <1>;
+		interrupts = <24>;
+		clock-names = "pxa27x-ssp.0";
+		dmas = <&dma 13
+			&dma 14>;
+		dma-names = "rx", "tx";
+	};
+
+	ssp1: ssp at 41700000 {
+		compatible = "mrvl,pxa3xx-ssp";
+		reg = <0x41700000 0x40>;
+		ssp-id = <2>;
+		interrupts = <16>;
+		clock-names = "pxa27x-ssp.1";
+		dmas = <&dma 15
+			&dma 16>;
+		dma-names = "rx", "tx";
+	};
+
+	ssp2: ssp at 41900000 {
+		compatibl3 = "mrvl,pxa3xx-ssp";
+		reg = <0x41900000 0x40>;
+		ssp-id = <3>;
+		interrupts = <0>;
+		clock-names = "pxa27x-ssp.2";
+		dmas = <&dma 66
+			&dma 67>;
+		dma-names = "rx", "tx";
+	};
+
+	ssp3: ssp at 41a00000 {
+		compatible = "mrvl,pxa3xx-ssp";
+		reg = <0x41a00000 0x40>;
+		ssp-id = <4>;
+		interrupts = <13>;
+		clock-names = "pxa27x-ssp.3";
+		dmas = <&dma 2
+			&dma 3>;
+		dma-names = "rx", "tx";
+	};
+
diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index 65ba28a..c3afcec 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -30,6 +30,8 @@
 #include <linux/platform_device.h>
 #include <linux/spi/pxa2xx_spi.h>
 #include <linux/io.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
 
 #include <asm/irq.h>
 #include <mach/hardware.h>
@@ -72,9 +74,23 @@ void pxa_ssp_free(struct ssp_device *ssp)
 }
 EXPORT_SYMBOL(pxa_ssp_free);
 
+#ifdef CONFIG_OF
+static const struct of_device_id pxa_ssp_of_ids[] = {
+	{ .compatible = "mrvl,pxa25x-ssp",	.data = (void *) PXA25x_SSP },
+	{ .compatible = "mvrl,pxa25x-nssp",	.data = (void *) PXA25x_NSSP },
+	{ .compatible = "mrvl,pxa27x-ssp",	.data = (void *) PXA27x_SSP },
+	{ .compatible = "mrvl,pxa3xx-ssp",	.data = (void *) PXA3xx_SSP },
+	{ .compatible = "mvrl,pxa168-ssp",	.data = (void *) PXA168_SSP },
+	{ .compatible = "mrvl,pxa910-ssp",	.data = (void *) PXA910_SSP },
+	{ .compatible = "mrvl,ce4100-ssp",	.data = (void *) CE4100_SSP },
+	{ .compatible = "mrvl,lpss-ssp",	.data = (void *) LPSS_SSP },
+	{ },
+};
+MODULE_DEVICE_TABLE(of, pxa_ssp_of_ids);
+#endif
+
 static int pxa_ssp_probe(struct platform_device *pdev)
 {
-	const struct platform_device_id *id = platform_get_device_id(pdev);
 	struct resource *res;
 	struct ssp_device *ssp;
 	struct device *dev = &pdev->dev;
@@ -92,21 +108,42 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 		goto err_free;
 	}
 
-	res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-	if (res == NULL) {
-		dev_err(dev, "no SSP RX DRCMR defined\n");
-		ret = -ENODEV;
-		goto err_free_clk;
-	}
-	ssp->drcmr_rx = res->start;
+	if (dev->of_node) {
+		struct of_phandle_args dma_spec;
+		struct device_node *np = dev->of_node;
+
+		/*
+		 * FIXME: we should allocate the DMA channel from this
+		 * context and pass the channel down to the ssp users.
+		 * For now, we lookup the rx and tx indices manually
+		 */
+
+		/* rx */
+		of_parse_phandle_with_args(np, "dmas", "#dma-cells",
+					   0, &dma_spec);
+		ssp->drcmr_rx = dma_spec.args[0];
+		of_node_put(dma_spec.np);
+
+		/* tx */
+		of_parse_phandle_with_args(np, "dmas", "#dma-cells",
+					   1, &dma_spec);
+		ssp->drcmr_tx = dma_spec.args[0];
+		of_node_put(dma_spec.np);
+	} else {
+		res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
+		if (res == NULL) {
+			dev_err(dev, "no SSP RX DRCMR defined\n");
+			return -ENODEV;
+		}
+		ssp->drcmr_rx = res->start;
 
-	res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
-	if (res == NULL) {
-		dev_err(dev, "no SSP TX DRCMR defined\n");
-		ret = -ENODEV;
-		goto err_free_clk;
+		res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
+		if (res == NULL) {
+			dev_err(dev, "no SSP TX DRCMR defined\n");
+			return -ENODEV;
+		}
+		ssp->drcmr_tx = res->start;
 	}
-	ssp->drcmr_tx = res->start;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (res == NULL) {
@@ -139,12 +176,22 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 		goto err_free_io;
 	}
 
-	/* PXA2xx/3xx SSP ports starts from 1 and the internal pdev->id
-	 * starts from 0, do a translation here
-	 */
-	ssp->port_id = pdev->id + 1;
+	if (dev->of_node) {
+		const struct of_device_id *id =
+			of_match_device(of_match_ptr(pxa_ssp_of_ids), dev);
+		ssp->type = (int) id->data;
+	} else {
+		const struct platform_device_id *id =
+			platform_get_device_id(pdev);
+		ssp->type = (int) id->driver_data;
+
+		/* PXA2xx/3xx SSP ports starts from 1 and the internal pdev->id
+		 * starts from 0, do a translation here
+		 */
+		ssp->port_id = pdev->id + 1;
+	}
+
 	ssp->use_count = 0;
-	ssp->type = (int)id->driver_data;
 
 	mutex_lock(&ssp_lock);
 	list_add(&ssp->node, &ssp_list);
@@ -201,8 +248,9 @@ static struct platform_driver pxa_ssp_driver = {
 	.probe		= pxa_ssp_probe,
 	.remove		= pxa_ssp_remove,
 	.driver		= {
-		.owner	= THIS_MODULE,
-		.name	= "pxa2xx-ssp",
+		.owner		= THIS_MODULE,
+		.name		= "pxa2xx-ssp",
+		.of_match_table	= of_match_ptr(pxa_ssp_of_ids),
 	},
 	.id_table	= ssp_id_table,
 };
-- 
1.8.3.1

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

* [PATCH 4/5] ARM: pxa: ssp: use devm_ functions
  2013-08-12  8:37 [PATCH 0/5] ARM: pxa: ssp: prepare for devicetree usage Daniel Mack
                   ` (2 preceding siblings ...)
  2013-08-12  8:37 ` [PATCH 3/5] ARM: pxa: ssp: add DT bindings Daniel Mack
@ 2013-08-12  8:37 ` Daniel Mack
  2013-08-12  8:37 ` [PATCH 5/5] ARM: pxa: ssp: add pxa_ssp_request_of() Daniel Mack
  4 siblings, 0 replies; 15+ messages in thread
From: Daniel Mack @ 2013-08-12  8:37 UTC (permalink / raw)
  To: linux-arm-kernel

Use devm_ functions to allocate memory, ioremap, clk_get etc to clean up
the error unwind path.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 arch/arm/plat-pxa/ssp.c | 40 ++++++++++++----------------------------
 1 file changed, 12 insertions(+), 28 deletions(-)

diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index c3afcec..f266135 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -94,19 +94,16 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 	struct resource *res;
 	struct ssp_device *ssp;
 	struct device *dev = &pdev->dev;
-	int ret = 0;
 
-	ssp = kzalloc(sizeof(struct ssp_device), GFP_KERNEL);
+	ssp = devm_kzalloc(dev, sizeof(struct ssp_device), GFP_KERNEL);
 	if (ssp == NULL)
 		return -ENOMEM;
 
 	ssp->pdev = pdev;
 
-	ssp->clk = clk_get(dev, NULL);
-	if (IS_ERR(ssp->clk)) {
-		ret = PTR_ERR(ssp->clk);
-		goto err_free;
-	}
+	ssp->clk = devm_clk_get(dev, NULL);
+	if (IS_ERR(ssp->clk))
+		return PTR_ERR(ssp->clk);
 
 	if (dev->of_node) {
 		struct of_phandle_args dma_spec;
@@ -148,32 +145,28 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (res == NULL) {
 		dev_err(dev, "no memory resource defined\n");
-		ret = -ENODEV;
-		goto err_free_clk;
+		return -ENODEV;
 	}
 
-	res = request_mem_region(res->start, resource_size(res),
-			pdev->name);
+	res = devm_request_mem_region(dev, res->start, resource_size(res),
+				      pdev->name);
 	if (res == NULL) {
 		dev_err(dev, "failed to request memory resource\n");
-		ret = -EBUSY;
-		goto err_free_clk;
+		return -EBUSY;
 	}
 
 	ssp->phys_base = res->start;
 
-	ssp->mmio_base = ioremap(res->start, resource_size(res));
+	ssp->mmio_base = devm_ioremap(dev, res->start, resource_size(res));
 	if (ssp->mmio_base == NULL) {
 		dev_err(dev, "failed to ioremap() registers\n");
-		ret = -ENODEV;
-		goto err_free_mem;
+		return -ENODEV;
 	}
 
 	ssp->irq = platform_get_irq(pdev, 0);
 	if (ssp->irq < 0) {
 		dev_err(dev, "no IRQ resource defined\n");
-		ret = -ENODEV;
-		goto err_free_io;
+		return -ENODEV;
 	}
 
 	if (dev->of_node) {
@@ -198,17 +191,8 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 	mutex_unlock(&ssp_lock);
 
 	platform_set_drvdata(pdev, ssp);
-	return 0;
 
-err_free_io:
-	iounmap(ssp->mmio_base);
-err_free_mem:
-	release_mem_region(res->start, resource_size(res));
-err_free_clk:
-	clk_put(ssp->clk);
-err_free:
-	kfree(ssp);
-	return ret;
+	return 0;
 }
 
 static int pxa_ssp_remove(struct platform_device *pdev)
-- 
1.8.3.1

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

* [PATCH 5/5] ARM: pxa: ssp: add pxa_ssp_request_of()
  2013-08-12  8:37 [PATCH 0/5] ARM: pxa: ssp: prepare for devicetree usage Daniel Mack
                   ` (3 preceding siblings ...)
  2013-08-12  8:37 ` [PATCH 4/5] ARM: pxa: ssp: use devm_ functions Daniel Mack
@ 2013-08-12  8:37 ` Daniel Mack
  4 siblings, 0 replies; 15+ messages in thread
From: Daniel Mack @ 2013-08-12  8:37 UTC (permalink / raw)
  To: linux-arm-kernel

Add a function to lookup ssp devices from device tree. This way, users
can reference the ssp devices in order to register to them.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 arch/arm/plat-pxa/ssp.c    | 25 +++++++++++++++++++++++++
 include/linux/pxa2xx_ssp.h | 11 +++++++++++
 2 files changed, 36 insertions(+)

diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index f266135..c83f27b 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -62,6 +62,30 @@ struct ssp_device *pxa_ssp_request(int port, const char *label)
 }
 EXPORT_SYMBOL(pxa_ssp_request);
 
+struct ssp_device *pxa_ssp_request_of(const struct device_node *of_node,
+				      const char *label)
+{
+	struct ssp_device *ssp = NULL;
+
+	mutex_lock(&ssp_lock);
+
+	list_for_each_entry(ssp, &ssp_list, node) {
+		if (ssp->of_node == of_node && ssp->use_count == 0) {
+			ssp->use_count++;
+			ssp->label = label;
+			break;
+		}
+	}
+
+	mutex_unlock(&ssp_lock);
+
+	if (&ssp->node == &ssp_list)
+		return NULL;
+
+	return ssp;
+}
+EXPORT_SYMBOL(pxa_ssp_request_of);
+
 void pxa_ssp_free(struct ssp_device *ssp)
 {
 	mutex_lock(&ssp_lock);
@@ -185,6 +209,7 @@ static int pxa_ssp_probe(struct platform_device *pdev)
 	}
 
 	ssp->use_count = 0;
+	ssp->of_node = dev->of_node;
 
 	mutex_lock(&ssp_lock);
 	list_add(&ssp->node, &ssp_list);
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h
index 467cc63..4944420 100644
--- a/include/linux/pxa2xx_ssp.h
+++ b/include/linux/pxa2xx_ssp.h
@@ -21,6 +21,8 @@
 
 #include <linux/list.h>
 #include <linux/io.h>
+#include <linux/of.h>
+
 
 /*
  * SSP Serial Port Registers
@@ -190,6 +192,8 @@ struct ssp_device {
 	int		irq;
 	int		drcmr_rx;
 	int		drcmr_tx;
+
+	struct device_node	*of_node;
 };
 
 /**
@@ -218,11 +222,18 @@ static inline u32 pxa_ssp_read_reg(struct ssp_device *dev, u32 reg)
 #ifdef CONFIG_ARCH_PXA
 struct ssp_device *pxa_ssp_request(int port, const char *label);
 void pxa_ssp_free(struct ssp_device *);
+struct ssp_device *pxa_ssp_request_of(const struct device_node *of_node,
+				      const char *label);
 #else
 static inline struct ssp_device *pxa_ssp_request(int port, const char *label)
 {
 	return NULL;
 }
+static inline struct ssp_device *pxa_ssp_request_of(const struct device_node *n,
+						    const char *name)
+{
+	return NULL;
+}
 static inline void pxa_ssp_free(struct ssp_device *ssp) {}
 #endif
 
-- 
1.8.3.1

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

* [PATCH 1/5] ARM: pxa: ssp: remove unnecessary warning on kzalloc() failure
  2013-08-12  8:37 ` [PATCH 1/5] ARM: pxa: ssp: remove unnecessary warning on kzalloc() failure Daniel Mack
@ 2013-08-12 10:38   ` Mark Brown
  0 siblings, 0 replies; 15+ messages in thread
From: Mark Brown @ 2013-08-12 10:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 12, 2013 at 10:37:14AM +0200, Daniel Mack wrote:
> The memory subsystem will already complain loudly enough in such cases.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130812/b025b3ca/attachment.sig>

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

* [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev
  2013-08-12  8:37 ` [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev Daniel Mack
@ 2013-08-12 10:38   ` Mark Brown
  2013-08-12 10:41     ` Daniel Mack
  0 siblings, 1 reply; 15+ messages in thread
From: Mark Brown @ 2013-08-12 10:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 12, 2013 at 10:37:15AM +0200, Daniel Mack wrote:
> No functional change, just a cosmetic cleanup.

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130812/24558424/attachment.sig>

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

* [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev
  2013-08-12 10:38   ` Mark Brown
@ 2013-08-12 10:41     ` Daniel Mack
  2013-08-12 10:46       ` Mark Brown
  0 siblings, 1 reply; 15+ messages in thread
From: Daniel Mack @ 2013-08-12 10:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 12.08.2013 12:38, Mark Brown wrote:
> On Mon, Aug 12, 2013 at 10:37:15AM +0200, Daniel Mack wrote:
>> No functional change, just a cosmetic cleanup.
> 
> Applied, thanks.
> 

Which tree will you merge them through? ASoC?

I actually thought Haojian would pick them, but I see there's a build
dependency. So it might make sense if you take them instead.


Daniel

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

* [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev
  2013-08-12 10:41     ` Daniel Mack
@ 2013-08-12 10:46       ` Mark Brown
  2013-08-12 10:50         ` Daniel Mack
  0 siblings, 1 reply; 15+ messages in thread
From: Mark Brown @ 2013-08-12 10:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 12, 2013 at 12:41:41PM +0200, Daniel Mack wrote:

> Which tree will you merge them through? ASoC?

Yes.

> I actually thought Haojian would pick them, but I see there's a build
> dependency. So it might make sense if you take them instead.

They didn't obviously touch arch/arm so I'd expect them to go through
the relevant driver tree.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130812/12b9a500/attachment.sig>

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

* [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev
  2013-08-12 10:46       ` Mark Brown
@ 2013-08-12 10:50         ` Daniel Mack
  2013-08-13  9:02           ` Daniel Mack
  0 siblings, 1 reply; 15+ messages in thread
From: Daniel Mack @ 2013-08-12 10:50 UTC (permalink / raw)
  To: linux-arm-kernel

On 12.08.2013 12:46, Mark Brown wrote:
> On Mon, Aug 12, 2013 at 12:41:41PM +0200, Daniel Mack wrote:
>> I actually thought Haojian would pick them, but I see there's a build
>> dependency. So it might make sense if you take them instead.
> 
> They didn't obviously touch arch/arm

Well yes, *this* series does:

 .../devicetree/bindings/serial/mrvl,pxa-ssp.txt    |  65 ++++++++
 arch/arm/plat-pxa/ssp.c                            | 174
++++++++++++++-------
 include/linux/pxa2xx_ssp.h                         |  11 ++

I posted two series, one is for arch/arm and one is for sound/soc/pxa.
But as they have a dependency via pxa_ssp_request_of(), I'd actually
prefer if you took all of them.


Thanks,
Daniel

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

* [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev
  2013-08-12 10:50         ` Daniel Mack
@ 2013-08-13  9:02           ` Daniel Mack
  2013-08-14 15:30             ` Haojian Zhuang
  0 siblings, 1 reply; 15+ messages in thread
From: Daniel Mack @ 2013-08-13  9:02 UTC (permalink / raw)
  To: linux-arm-kernel

On 12.08.2013 12:50, Daniel Mack wrote:
> On 12.08.2013 12:46, Mark Brown wrote:
>> On Mon, Aug 12, 2013 at 12:41:41PM +0200, Daniel Mack wrote:
>>> I actually thought Haojian would pick them, but I see there's a build
>>> dependency. So it might make sense if you take them instead.
>>
>> They didn't obviously touch arch/arm
> 
> Well yes, *this* series does:
> 
>  .../devicetree/bindings/serial/mrvl,pxa-ssp.txt    |  65 ++++++++
>  arch/arm/plat-pxa/ssp.c                            | 174
> ++++++++++++++-------
>  include/linux/pxa2xx_ssp.h                         |  11 ++
> 
> I posted two series, one is for arch/arm and one is for sound/soc/pxa.
> But as they have a dependency via pxa_ssp_request_of(), I'd actually
> prefer if you took all of them.

Haojian, could you give your Ack on this procedure?


Thanks,
Daniel

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

* [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev
  2013-08-13  9:02           ` Daniel Mack
@ 2013-08-14 15:30             ` Haojian Zhuang
  2013-08-14 18:54               ` Mark Brown
  0 siblings, 1 reply; 15+ messages in thread
From: Haojian Zhuang @ 2013-08-14 15:30 UTC (permalink / raw)
  To: linux-arm-kernel

On 13 August 2013 17:02, Daniel Mack <zonque@gmail.com> wrote:
> On 12.08.2013 12:50, Daniel Mack wrote:
>> On 12.08.2013 12:46, Mark Brown wrote:
>>> On Mon, Aug 12, 2013 at 12:41:41PM +0200, Daniel Mack wrote:
>>>> I actually thought Haojian would pick them, but I see there's a build
>>>> dependency. So it might make sense if you take them instead.
>>>
>>> They didn't obviously touch arch/arm
>>
>> Well yes, *this* series does:
>>
>>  .../devicetree/bindings/serial/mrvl,pxa-ssp.txt    |  65 ++++++++
>>  arch/arm/plat-pxa/ssp.c                            | 174
>> ++++++++++++++-------
>>  include/linux/pxa2xx_ssp.h                         |  11 ++
>>
>> I posted two series, one is for arch/arm and one is for sound/soc/pxa.
>> But as they have a dependency via pxa_ssp_request_of(), I'd actually
>> prefer if you took all of them.
>
> Haojian, could you give your Ack on this procedure?
>
>
> Thanks,
> Daniel
>
>

Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>

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

* [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev
  2013-08-14 15:30             ` Haojian Zhuang
@ 2013-08-14 18:54               ` Mark Brown
  2013-08-14 19:47                 ` Daniel Mack
  0 siblings, 1 reply; 15+ messages in thread
From: Mark Brown @ 2013-08-14 18:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 14, 2013 at 11:30:48PM +0800, Haojian Zhuang wrote:

> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>

Applied, thanks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130814/b5006cc6/attachment.sig>

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

* [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev
  2013-08-14 18:54               ` Mark Brown
@ 2013-08-14 19:47                 ` Daniel Mack
  0 siblings, 0 replies; 15+ messages in thread
From: Daniel Mack @ 2013-08-14 19:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 14.08.2013 20:54, Mark Brown wrote:
> On Wed, Aug 14, 2013 at 11:30:48PM +0800, Haojian Zhuang wrote:
> 
>> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
> 
> Applied, thanks.
> 

Great, thanks. You'll take the pxa/ssp series for ASoC as well then, right?


Daniel

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

end of thread, other threads:[~2013-08-14 19:47 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-12  8:37 [PATCH 0/5] ARM: pxa: ssp: prepare for devicetree usage Daniel Mack
2013-08-12  8:37 ` [PATCH 1/5] ARM: pxa: ssp: remove unnecessary warning on kzalloc() failure Daniel Mack
2013-08-12 10:38   ` Mark Brown
2013-08-12  8:37 ` [PATCH 2/5] ARM: pxa: ssp: add shortcut for &pdev->dev Daniel Mack
2013-08-12 10:38   ` Mark Brown
2013-08-12 10:41     ` Daniel Mack
2013-08-12 10:46       ` Mark Brown
2013-08-12 10:50         ` Daniel Mack
2013-08-13  9:02           ` Daniel Mack
2013-08-14 15:30             ` Haojian Zhuang
2013-08-14 18:54               ` Mark Brown
2013-08-14 19:47                 ` Daniel Mack
2013-08-12  8:37 ` [PATCH 3/5] ARM: pxa: ssp: add DT bindings Daniel Mack
2013-08-12  8:37 ` [PATCH 4/5] ARM: pxa: ssp: use devm_ functions Daniel Mack
2013-08-12  8:37 ` [PATCH 5/5] ARM: pxa: ssp: add pxa_ssp_request_of() Daniel Mack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).