linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set
       [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
@ 2013-03-07  3:26 ` Wenyou Yang
  2013-03-07 12:17   ` Sergei Shtylyov
       [not found]   ` <1362626815-6628-1-git-send-email-wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
  2013-03-07  3:27 ` [PATCH v6 02/16] spi/spi-atmel: detect the capabilities of SPI core by reading the VERSION register Wenyou Yang
                   ` (9 subsequent siblings)
  10 siblings, 2 replies; 23+ messages in thread
From: Wenyou Yang @ 2013-03-07  3:26 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: grant.likely, nicolas.ferre, plagnioj, richard.genoud, JM.Lin,
	Wenyou Yang, spi-devel-general, linux-kernel

commit: 059b8ffeee5b427949872bb6ed5db5ae0788054e
cause the atmel spi probing failure.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
---
 drivers/spi/spi-atmel.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 656d137..1eca815 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -846,9 +846,9 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
 			}
 		}
 
-		/* FIXME implement these protocol options!! */
-		if (xfer->speed_hz) {
-			dev_dbg(&spi->dev, "no protocol options yet\n");
+		if (xfer->speed_hz < spi->max_speed_hz) {
+			dev_dbg(&spi->dev,
+				"speed in transfer less than bus speed\n");
 			return -ENOPROTOOPT;
 		}
 
-- 
1.7.9.5

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

* [PATCH v6 02/16] spi/spi-atmel: detect the capabilities of SPI core by reading the VERSION register.
       [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
  2013-03-07  3:26 ` [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set Wenyou Yang
@ 2013-03-07  3:27 ` Wenyou Yang
  2013-03-07  3:28 ` [PATCH v6 03/16] spi/spi-atmel: add support transfer on CS1,2,3, not only on CS0 Wenyou Yang
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Wenyou Yang @ 2013-03-07  3:27 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: grant.likely, nicolas.ferre, plagnioj, richard.genoud, JM.Lin,
	wenyou.yang, spi-devel-general, linux-kernel

The "has_dma_support" needed for future use with dmaengine driver.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
---
 drivers/spi/spi-atmel.c |   66 +++++++++++++++++++++++++++++++++++------------
 1 file changed, 50 insertions(+), 16 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 1eca815..8724157 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -22,9 +22,8 @@
 #include <linux/platform_data/atmel.h>
 #include <linux/of.h>
 
-#include <asm/io.h>
-#include <asm/gpio.h>
-#include <mach/cpu.h>
+#include <linux/io.h>
+#include <linux/gpio.h>
 
 /* SPI register offsets */
 #define SPI_CR					0x0000
@@ -39,6 +38,7 @@
 #define SPI_CSR1				0x0034
 #define SPI_CSR2				0x0038
 #define SPI_CSR3				0x003c
+#define SPI_VERSION				0x00fc
 #define SPI_RPR					0x0100
 #define SPI_RCR					0x0104
 #define SPI_TPR					0x0108
@@ -71,6 +71,8 @@
 #define SPI_FDIV_SIZE				1
 #define SPI_MODFDIS_OFFSET			4
 #define SPI_MODFDIS_SIZE			1
+#define SPI_WDRBT_OFFSET			5
+#define SPI_WDRBT_SIZE				1
 #define SPI_LLB_OFFSET				7
 #define SPI_LLB_SIZE				1
 #define SPI_PCS_OFFSET				16
@@ -180,6 +182,11 @@
 #define spi_writel(port,reg,value) \
 	__raw_writel((value), (port)->regs + SPI_##reg)
 
+struct atmel_spi_caps {
+	bool	is_spi2;
+	bool	has_wdrbt;
+	bool	has_dma_support;
+};
 
 /*
  * The core SPI transfer engine just talks to a register bank to set up
@@ -204,6 +211,8 @@ struct atmel_spi {
 
 	void			*buffer;
 	dma_addr_t		buffer_dma;
+
+	struct atmel_spi_caps	caps;
 };
 
 /* Controller-specific per-slave state */
@@ -222,14 +231,10 @@ struct atmel_spi_device {
  *  - SPI_SR.TXEMPTY, SPI_SR.NSSR (and corresponding irqs)
  *  - SPI_CSRx.CSAAT
  *  - SPI_CSRx.SBCR allows faster clocking
- *
- * We can determine the controller version by reading the VERSION
- * register, but I haven't checked that it exists on all chips, and
- * this is cheaper anyway.
  */
-static bool atmel_spi_is_v2(void)
+static bool atmel_spi_is_v2(struct atmel_spi *as)
 {
-	return !cpu_is_at91rm9200();
+	return as->caps.is_spi2;
 }
 
 /*
@@ -263,15 +268,20 @@ static void cs_activate(struct atmel_spi *as, struct spi_device *spi)
 	unsigned active = spi->mode & SPI_CS_HIGH;
 	u32 mr;
 
-	if (atmel_spi_is_v2()) {
+	if (atmel_spi_is_v2(as)) {
 		/*
 		 * Always use CSR0. This ensures that the clock
 		 * switches to the correct idle polarity before we
 		 * toggle the CS.
 		 */
 		spi_writel(as, CSR0, asd->csr);
-		spi_writel(as, MR, SPI_BF(PCS, 0x0e) | SPI_BIT(MODFDIS)
+		if (as->caps.has_wdrbt) {
+			spi_writel(as, MR, SPI_BF(PCS, 0x0e) | SPI_BIT(WDRBT)
+				| SPI_BIT(MODFDIS) | SPI_BIT(MSTR));
+		} else {
+			spi_writel(as, MR, SPI_BF(PCS, 0x0e) | SPI_BIT(MODFDIS)
 				| SPI_BIT(MSTR));
+		}
 		mr = spi_readl(as, MR);
 		gpio_set_value(asd->npcs_pin, active);
 	} else {
@@ -318,7 +328,7 @@ static void cs_deactivate(struct atmel_spi *as, struct spi_device *spi)
 			asd->npcs_pin, active ? " (low)" : "",
 			mr);
 
-	if (atmel_spi_is_v2() || spi->chip_select != 0)
+	if (atmel_spi_is_v2(as) || spi->chip_select != 0)
 		gpio_set_value(asd->npcs_pin, !active);
 }
 
@@ -719,7 +729,7 @@ static int atmel_spi_setup(struct spi_device *spi)
 	}
 
 	/* see notes above re chipselect */
-	if (!atmel_spi_is_v2()
+	if (!atmel_spi_is_v2(as)
 			&& spi->chip_select == 0
 			&& (spi->mode & SPI_CS_HIGH)) {
 		dev_dbg(&spi->dev, "setup: can't be active-high\n");
@@ -728,7 +738,7 @@ static int atmel_spi_setup(struct spi_device *spi)
 
 	/* v1 chips start out at half the peripheral bus speed. */
 	bus_hz = clk_get_rate(as->clk);
-	if (!atmel_spi_is_v2())
+	if (!atmel_spi_is_v2(as))
 		bus_hz /= 2;
 
 	if (spi->max_speed_hz) {
@@ -804,7 +814,7 @@ static int atmel_spi_setup(struct spi_device *spi)
 		"setup: %lu Hz bpw %u mode 0x%x -> csr%d %08x\n",
 		bus_hz / scbr, bits, spi->mode, spi->chip_select, csr);
 
-	if (!atmel_spi_is_v2())
+	if (!atmel_spi_is_v2(as))
 		spi_writel(as, CSR0 + 4 * spi->chip_select, csr);
 
 	return 0;
@@ -910,6 +920,23 @@ static void atmel_spi_cleanup(struct spi_device *spi)
 	kfree(asd);
 }
 
+static inline unsigned int atmel_get_version(struct atmel_spi *as)
+{
+	return spi_readl(as, VERSION) & 0x00000fff;
+}
+
+static void atmel_get_caps(struct atmel_spi *as)
+{
+	unsigned int version;
+
+	version = atmel_get_version(as);
+	dev_info(&as->pdev->dev, "version: 0x%x\n", version);
+
+	as->caps.is_spi2 = (version > 0x121) ? true : false;
+	as->caps.has_wdrbt = (version >= 0x210) ? true : false;
+	as->caps.has_dma_support = (version >= 0x212) ? true : false;
+}
+
 /*-------------------------------------------------------------------------*/
 
 static int atmel_spi_probe(struct platform_device *pdev)
@@ -970,6 +997,8 @@ static int atmel_spi_probe(struct platform_device *pdev)
 	as->irq = irq;
 	as->clk = clk;
 
+	atmel_get_caps(as);
+
 	ret = request_irq(irq, atmel_spi_interrupt, 0,
 			dev_name(&pdev->dev), master);
 	if (ret)
@@ -979,7 +1008,12 @@ static int atmel_spi_probe(struct platform_device *pdev)
 	clk_enable(clk);
 	spi_writel(as, CR, SPI_BIT(SWRST));
 	spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */
-	spi_writel(as, MR, SPI_BIT(MSTR) | SPI_BIT(MODFDIS));
+	if (as->caps.has_wdrbt) {
+		spi_writel(as, MR, SPI_BIT(WDRBT) | SPI_BIT(MODFDIS)
+				| SPI_BIT(MSTR));
+	} else {
+		spi_writel(as, MR, SPI_BIT(MSTR) | SPI_BIT(MODFDIS));
+	}
 	spi_writel(as, PTCR, SPI_BIT(RXTDIS) | SPI_BIT(TXTDIS));
 	spi_writel(as, CR, SPI_BIT(SPIEN));
 
-- 
1.7.9.5

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

* [PATCH v6 03/16] spi/spi-atmel: add support transfer on CS1,2,3, not only on CS0
       [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
  2013-03-07  3:26 ` [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set Wenyou Yang
  2013-03-07  3:27 ` [PATCH v6 02/16] spi/spi-atmel: detect the capabilities of SPI core by reading the VERSION register Wenyou Yang
@ 2013-03-07  3:28 ` Wenyou Yang
  2013-03-07  3:28 ` [PATCH v6 04/16] spi/spi-atmel: add physical base address Wenyou Yang
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Wenyou Yang @ 2013-03-07  3:28 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: grant.likely, nicolas.ferre, plagnioj, richard.genoud, JM.Lin,
	wenyou.yang, spi-devel-general, linux-kernel

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
---
 drivers/spi/spi-atmel.c |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 8724157..e05aa8c 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -255,11 +255,6 @@ static bool atmel_spi_is_v2(struct atmel_spi *as)
  * Master on Chip Select 0.")  No workaround exists for that ... so for
  * nCS0 on that chip, we (a) don't use the GPIO, (b) can't support CS_HIGH,
  * and (c) will trigger that first erratum in some cases.
- *
- * TODO: Test if the atmel_spi_is_v2() branch below works on
- * AT91RM9200 if we use some other register than CSR0. However, don't
- * do this unconditionally since AP7000 has an errata where the BITS
- * field in CSR0 overrides all other CSRs.
  */
 
 static void cs_activate(struct atmel_spi *as, struct spi_device *spi)
@@ -269,18 +264,22 @@ static void cs_activate(struct atmel_spi *as, struct spi_device *spi)
 	u32 mr;
 
 	if (atmel_spi_is_v2(as)) {
-		/*
-		 * Always use CSR0. This ensures that the clock
-		 * switches to the correct idle polarity before we
-		 * toggle the CS.
+		spi_writel(as, CSR0 + 4 * spi->chip_select, asd->csr);
+		/* For the low SPI version, there is a issue that PDC transfer
+		 * on CS1,2,3 needs SPI_CSR0.BITS config as SPI_CSR1,2,3.BITS
 		 */
 		spi_writel(as, CSR0, asd->csr);
 		if (as->caps.has_wdrbt) {
-			spi_writel(as, MR, SPI_BF(PCS, 0x0e) | SPI_BIT(WDRBT)
-				| SPI_BIT(MODFDIS) | SPI_BIT(MSTR));
+			spi_writel(as, MR,
+					SPI_BF(PCS, ~(0x01 << spi->chip_select))
+					| SPI_BIT(WDRBT)
+					| SPI_BIT(MODFDIS)
+					| SPI_BIT(MSTR));
 		} else {
-			spi_writel(as, MR, SPI_BF(PCS, 0x0e) | SPI_BIT(MODFDIS)
-				| SPI_BIT(MSTR));
+			spi_writel(as, MR,
+					SPI_BF(PCS, ~(0x01 << spi->chip_select))
+					| SPI_BIT(MODFDIS)
+					| SPI_BIT(MSTR));
 		}
 		mr = spi_readl(as, MR);
 		gpio_set_value(asd->npcs_pin, active);
-- 
1.7.9.5

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

* [PATCH v6 04/16] spi/spi-atmel: add physical base address
       [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
                   ` (2 preceding siblings ...)
  2013-03-07  3:28 ` [PATCH v6 03/16] spi/spi-atmel: add support transfer on CS1,2,3, not only on CS0 Wenyou Yang
@ 2013-03-07  3:28 ` Wenyou Yang
  2013-03-07  3:29 ` [PATCH v6 05/16] spi/spi-atmel: call unmapping on transfers buffers Wenyou Yang
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Wenyou Yang @ 2013-03-07  3:28 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: grant.likely, nicolas.ferre, plagnioj, richard.genoud, JM.Lin,
	wenyou.yang, spi-devel-general, linux-kernel

From: Nicolas Ferre <nicolas.ferre@atmel.com>

Needed for future use with dmaengine enabled driver.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
[wenyou.yang@atmel.com: submit the patch]
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
 drivers/spi/spi-atmel.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index e05aa8c..ce9c894 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -196,6 +196,7 @@ struct atmel_spi_caps {
 struct atmel_spi {
 	spinlock_t		lock;
 
+	resource_size_t		phybase;
 	void __iomem		*regs;
 	int			irq;
 	struct clk		*clk;
@@ -993,6 +994,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
 	as->regs = ioremap(regs->start, resource_size(regs));
 	if (!as->regs)
 		goto out_free_buffer;
+	as->phybase = regs->start;
 	as->irq = irq;
 	as->clk = clk;
 
-- 
1.7.9.5

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

* [PATCH v6 05/16] spi/spi-atmel: call unmapping on transfers buffers
       [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
                   ` (3 preceding siblings ...)
  2013-03-07  3:28 ` [PATCH v6 04/16] spi/spi-atmel: add physical base address Wenyou Yang
@ 2013-03-07  3:29 ` Wenyou Yang
  2013-03-07  3:29 ` [PATCH v6 06/16] spi/spi-atmel: status information passed through controller data Wenyou Yang
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Wenyou Yang @ 2013-03-07  3:29 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: grant.likely, nicolas.ferre, plagnioj, richard.genoud, JM.Lin,
	wenyou.yang, spi-devel-general, linux-kernel

From: Nicolas Ferre <nicolas.ferre@atmel.com>

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
[wenyou.yang@atmel.com: submit the patch]
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
 drivers/spi/spi-atmel.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index ce9c894..2f61a80 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1049,6 +1049,7 @@ static int atmel_spi_remove(struct platform_device *pdev)
 	struct spi_master	*master = platform_get_drvdata(pdev);
 	struct atmel_spi	*as = spi_master_get_devdata(master);
 	struct spi_message	*msg;
+	struct spi_transfer	*xfer;
 
 	/* reset the hardware and block queue progress */
 	spin_lock_irq(&as->lock);
@@ -1060,9 +1061,10 @@ static int atmel_spi_remove(struct platform_device *pdev)
 
 	/* Terminate remaining queued transfers */
 	list_for_each_entry(msg, &as->queue, queue) {
-		/* REVISIT unmapping the dma is a NOP on ARM and AVR32
-		 * but we shouldn't depend on that...
-		 */
+		list_for_each_entry(xfer, &msg->transfers, transfer_list) {
+			if (!msg->is_dma_mapped)
+				atmel_spi_dma_unmap_xfer(master, xfer);
+		}
 		msg->status = -ESHUTDOWN;
 		msg->complete(msg->context);
 	}
-- 
1.7.9.5

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

* [PATCH v6 06/16] spi/spi-atmel: status information passed through controller data
       [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
                   ` (4 preceding siblings ...)
  2013-03-07  3:29 ` [PATCH v6 05/16] spi/spi-atmel: call unmapping on transfers buffers Wenyou Yang
@ 2013-03-07  3:29 ` Wenyou Yang
  2013-03-07  3:30 ` [PATCH v6 07/16] spi/spi-atmel: add flag to controller data for lock operations Wenyou Yang
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Wenyou Yang @ 2013-03-07  3:29 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: grant.likely, nicolas.ferre, plagnioj, richard.genoud, JM.Lin,
	wenyou.yang, spi-devel-general, linux-kernel

From: Nicolas Ferre <nicolas.ferre@atmel.com>

The status of transfer is stored in controller data structure
so that it can be used not only by atmel_spi_msg_done() function.
This will be useful for upcoming dmaengine enabled driver.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
[wenyou.yang@atmel.com: submit the patch]
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
 drivers/spi/spi-atmel.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 2f61a80..5c91408 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -209,6 +209,7 @@ struct atmel_spi {
 	unsigned long		current_remaining_bytes;
 	struct spi_transfer	*next_transfer;
 	unsigned long		next_remaining_bytes;
+	int			done_status;
 
 	void			*buffer;
 	dma_addr_t		buffer_dma;
@@ -554,15 +555,15 @@ static void atmel_spi_dma_unmap_xfer(struct spi_master *master,
 
 static void
 atmel_spi_msg_done(struct spi_master *master, struct atmel_spi *as,
-		struct spi_message *msg, int status, int stay)
+		struct spi_message *msg, int stay)
 {
-	if (!stay || status < 0)
+	if (!stay || as->done_status < 0)
 		cs_deactivate(as, msg->spi);
 	else
 		as->stay = msg->spi;
 
 	list_del(&msg->queue);
-	msg->status = status;
+	msg->status = as->done_status;
 
 	dev_dbg(master->dev.parent,
 		"xfer complete: %u bytes transferred\n",
@@ -574,6 +575,7 @@ atmel_spi_msg_done(struct spi_master *master, struct atmel_spi *as,
 
 	as->current_transfer = NULL;
 	as->next_transfer = NULL;
+	as->done_status = 0;
 
 	/* continue if needed */
 	if (list_empty(&as->queue) || as->stopping)
@@ -651,7 +653,8 @@ atmel_spi_interrupt(int irq, void *dev_id)
 		/* Clear any overrun happening while cleaning up */
 		spi_readl(as, SR);
 
-		atmel_spi_msg_done(master, as, msg, -EIO, 0);
+		as->done_status = -EIO;
+		atmel_spi_msg_done(master, as, msg, 0);
 	} else if (pending & (SPI_BIT(RXBUFF) | SPI_BIT(ENDRX))) {
 		ret = IRQ_HANDLED;
 
@@ -669,7 +672,7 @@ atmel_spi_interrupt(int irq, void *dev_id)
 
 			if (atmel_spi_xfer_is_last(msg, xfer)) {
 				/* report completed message */
-				atmel_spi_msg_done(master, as, msg, 0,
+				atmel_spi_msg_done(master, as, msg,
 						xfer->cs_change);
 			} else {
 				if (xfer->cs_change) {
-- 
1.7.9.5

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

* [PATCH v6 07/16] spi/spi-atmel: add flag to controller data for lock operations
       [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
                   ` (5 preceding siblings ...)
  2013-03-07  3:29 ` [PATCH v6 06/16] spi/spi-atmel: status information passed through controller data Wenyou Yang
@ 2013-03-07  3:30 ` Wenyou Yang
  2013-03-07  3:32 ` [PATCH v6 09/16] spi/spi-atmel: fix spi-atmel driver to adapt to slave_config changes Wenyou Yang
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Wenyou Yang @ 2013-03-07  3:30 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: grant.likely, nicolas.ferre, plagnioj, richard.genoud, JM.Lin,
	wenyou.yang, spi-devel-general, linux-kernel

From: Nicolas Ferre <nicolas.ferre@atmel.com>

Will allow to drop the lock during DMA operations.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
[wenyou.yang@atmel.com: submit the patch]
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
 drivers/spi/spi-atmel.c |   31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 5c91408..a483929 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -195,6 +195,7 @@ struct atmel_spi_caps {
  */
 struct atmel_spi {
 	spinlock_t		lock;
+	unsigned long		flags;
 
 	resource_size_t		phybase;
 	void __iomem		*regs;
@@ -333,6 +334,16 @@ static void cs_deactivate(struct atmel_spi *as, struct spi_device *spi)
 		gpio_set_value(asd->npcs_pin, !active);
 }
 
+static void atmel_spi_lock(struct atmel_spi *as)
+{
+		spin_lock_irqsave(&as->lock, as->flags);
+}
+
+static void atmel_spi_unlock(struct atmel_spi *as)
+{
+		spin_unlock_irqrestore(&as->lock, as->flags);
+}
+
 static inline int atmel_spi_xfer_is_last(struct spi_message *msg,
 					struct spi_transfer *xfer)
 {
@@ -569,9 +580,9 @@ atmel_spi_msg_done(struct spi_master *master, struct atmel_spi *as,
 		"xfer complete: %u bytes transferred\n",
 		msg->actual_length);
 
-	spin_unlock(&as->lock);
+	atmel_spi_unlock(as);
 	msg->complete(msg->context);
-	spin_lock(&as->lock);
+	atmel_spi_lock(as);
 
 	as->current_transfer = NULL;
 	as->next_transfer = NULL;
@@ -802,13 +813,11 @@ static int atmel_spi_setup(struct spi_device *spi)
 		spi->controller_state = asd;
 		gpio_direction_output(npcs_pin, !(spi->mode & SPI_CS_HIGH));
 	} else {
-		unsigned long		flags;
-
-		spin_lock_irqsave(&as->lock, flags);
+		atmel_spi_lock(as);
 		if (as->stay == spi)
 			as->stay = NULL;
 		cs_deactivate(as, spi);
-		spin_unlock_irqrestore(&as->lock, flags);
+		atmel_spi_unlock(as);
 	}
 
 	asd->csr = csr;
@@ -827,7 +836,6 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
 {
 	struct atmel_spi	*as;
 	struct spi_transfer	*xfer;
-	unsigned long		flags;
 	struct device		*controller = spi->master->dev.parent;
 	u8			bits;
 	struct atmel_spi_device	*asd;
@@ -892,11 +900,11 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
 	msg->status = -EINPROGRESS;
 	msg->actual_length = 0;
 
-	spin_lock_irqsave(&as->lock, flags);
+	atmel_spi_lock(as);
 	list_add_tail(&msg->queue, &as->queue);
 	if (!as->current_transfer)
 		atmel_spi_next_message(spi->master);
-	spin_unlock_irqrestore(&as->lock, flags);
+	atmel_spi_unlock(as);
 
 	return 0;
 }
@@ -906,17 +914,16 @@ static void atmel_spi_cleanup(struct spi_device *spi)
 	struct atmel_spi	*as = spi_master_get_devdata(spi->master);
 	struct atmel_spi_device	*asd = spi->controller_state;
 	unsigned		gpio = (unsigned) spi->controller_data;
-	unsigned long		flags;
 
 	if (!asd)
 		return;
 
-	spin_lock_irqsave(&as->lock, flags);
+	atmel_spi_lock(as);
 	if (as->stay == spi) {
 		as->stay = NULL;
 		cs_deactivate(as, spi);
 	}
-	spin_unlock_irqrestore(&as->lock, flags);
+	atmel_spi_unlock(as);
 
 	spi->controller_state = NULL;
 	gpio_free(gpio);
-- 
1.7.9.5

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

* [PATCH v6 09/16] spi/spi-atmel: fix spi-atmel driver to adapt to slave_config changes
       [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
                   ` (6 preceding siblings ...)
  2013-03-07  3:30 ` [PATCH v6 07/16] spi/spi-atmel: add flag to controller data for lock operations Wenyou Yang
@ 2013-03-07  3:32 ` Wenyou Yang
  2013-03-07  3:32 ` [PATCH v6 10/16] spi/spi-atmel: correct 16 bits transfers using PIO Wenyou Yang
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Wenyou Yang @ 2013-03-07  3:32 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: grant.likely, nicolas.ferre, plagnioj, richard.genoud, JM.Lin,
	wenyou.yang, spi-devel-general, linux-kernel

From: Richard Genoud <richard.genoud@gmail.com>

This is the following of the patch e2b35f3dbfc080f15b72834d08f04f0269dbe9be

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
[wenyou.yang@atmel.com: BUG: dmaengine mode when enable both spi0 and spi1, spi0 doesn't work]
[wenyou.yang@atmel.com: submit the patch]
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
---
 drivers/spi/spi-atmel.c |   61 +++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 51 insertions(+), 10 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index f6ef86b..40fd8786 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -387,6 +387,37 @@ static inline int atmel_spi_xfer_can_be_chained(struct spi_transfer *xfer)
 	return xfer->delay_usecs == 0 && !xfer->cs_change;
 }
 
+static int atmel_spi_dma_slave_config(struct atmel_spi *as,
+				struct dma_slave_config *slave_config)
+{
+	int err = 0;
+
+	slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
+	slave_config->src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
+
+	slave_config->dst_addr = (dma_addr_t)as->phybase + SPI_TDR;
+	slave_config->src_addr = (dma_addr_t)as->phybase + SPI_RDR;
+	slave_config->src_maxburst = 1;
+	slave_config->dst_maxburst = 1;
+	slave_config->device_fc = false;
+
+	slave_config->direction = DMA_MEM_TO_DEV;
+	if (dmaengine_slave_config(as->dma.chan_tx, slave_config)) {
+		dev_err(&as->pdev->dev,
+			"failed to configure tx dma channel\n");
+		err = -EINVAL;
+	}
+
+	slave_config->direction = DMA_DEV_TO_MEM;
+	if (dmaengine_slave_config(as->dma.chan_rx, slave_config)) {
+		dev_err(&as->pdev->dev,
+			"failed to configure rx dma channel\n");
+		err = -EINVAL;
+	}
+
+	return err;
+}
+
 static bool filter(struct dma_chan *chan, void *slave)
 {
 	struct	at_dma_slave *sl = slave;
@@ -402,14 +433,12 @@ static bool filter(struct dma_chan *chan, void *slave)
 static int atmel_spi_configure_dma(struct atmel_spi *as)
 {
 	struct at_dma_slave *sdata = &as->dma.dma_slave;
+	struct dma_slave_config	slave_config;
+	int err;
 
 	if (sdata && sdata->dma_dev) {
 		dma_cap_mask_t mask;
 
-		/* setup DMA addresses */
-		sdata->rx_reg = (dma_addr_t)as->phybase + SPI_RDR;
-		sdata->tx_reg = (dma_addr_t)as->phybase + SPI_TDR;
-
 		/* Try to grab two DMA channels */
 		dma_cap_zero(mask);
 		dma_cap_set(DMA_SLAVE, mask);
@@ -419,21 +448,27 @@ static int atmel_spi_configure_dma(struct atmel_spi *as)
 				dma_request_channel(mask, filter, sdata);
 	}
 	if (!as->dma.chan_rx || !as->dma.chan_tx) {
-		if (as->dma.chan_rx)
-			dma_release_channel(as->dma.chan_rx);
-		if (as->dma.chan_tx)
-			dma_release_channel(as->dma.chan_tx);
 		dev_err(&as->pdev->dev,
 			"DMA channel not available, unable to use SPI\n");
-		return -EBUSY;
+		err = -EBUSY;
+		goto error;
 	}
 
+	err = atmel_spi_dma_slave_config(as, &slave_config);
+	if (err)
+		goto error;
+
 	dev_info(&as->pdev->dev,
 			"Using %s (tx) and %s (rx) for DMA transfers\n",
 			dma_chan_name(as->dma.chan_tx),
 			dma_chan_name(as->dma.chan_rx));
-
 	return 0;
+error:
+	if (as->dma.chan_rx)
+		dma_release_channel(as->dma.chan_rx);
+	if (as->dma.chan_tx)
+		dma_release_channel(as->dma.chan_tx);
+	return err;
 }
 
 static void atmel_spi_stop_dma(struct atmel_spi *as)
@@ -510,6 +545,7 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
 	struct dma_chan		*txchan = as->dma.chan_tx;
 	struct dma_async_tx_descriptor *rxdesc;
 	struct dma_async_tx_descriptor *txdesc;
+	struct dma_slave_config	slave_config;
 	dma_cookie_t		cookie;
 	u32	len = *plen;
 
@@ -548,6 +584,10 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
 
 	*plen = len;
 
+	if (atmel_spi_dma_slave_config(as, &slave_config))
+		goto err_exit;
+
+
 	/* Send both scatterlists */
 	rxdesc = rxchan->device->device_prep_slave_sg(rxchan,
 					&as->dma.sgrx,
@@ -596,6 +636,7 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
 err_dma:
 	spi_writel(as, IDR, SPI_BIT(OVRES));
 	atmel_spi_stop_dma(as);
+err_exit:
 	atmel_spi_lock(as);
 	return -ENOMEM;
 }
-- 
1.7.9.5

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

* [PATCH v6 10/16] spi/spi-atmel: correct 16 bits transfers using PIO
       [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
                   ` (7 preceding siblings ...)
  2013-03-07  3:32 ` [PATCH v6 09/16] spi/spi-atmel: fix spi-atmel driver to adapt to slave_config changes Wenyou Yang
@ 2013-03-07  3:32 ` Wenyou Yang
  2013-03-07  3:33 ` [PATCH v6 11/16] spi/spi-atmel: correct 16 bits transfers with DMA Wenyou Yang
  2013-03-07  3:34 ` [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi Wenyou Yang
  10 siblings, 0 replies; 23+ messages in thread
From: Wenyou Yang @ 2013-03-07  3:32 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: grant.likely, nicolas.ferre, plagnioj, richard.genoud, JM.Lin,
	wenyou.yang, spi-devel-general, linux-kernel

From: Richard Genoud <richard.genoud@gmail.com>

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
[wenyou.yang@atmel.com: submit the patch]
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
 drivers/spi/spi-atmel.c |   46 +++++++++++++++++++++++++++++++++++++---------
 1 file changed, 37 insertions(+), 9 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 40fd8786..d287889 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -520,13 +520,17 @@ static void atmel_spi_next_xfer_pio(struct spi_master *master,
 	}
 
 	if (xfer->tx_buf)
-		spi_writel(as, TDR, *(u8 *)(xfer->tx_buf));
+		if (xfer->bits_per_word > 8)
+			spi_writel(as, TDR, *(u16 *)(xfer->tx_buf));
+		else
+			spi_writel(as, TDR, *(u8 *)(xfer->tx_buf));
 	else
 		spi_writel(as, TDR, 0);
 
 	dev_dbg(master->dev.parent,
-		"  start pio xfer %p: len %u tx %p rx %p\n",
-		xfer, xfer->len, xfer->tx_buf, xfer->rx_buf);
+		"  start pio xfer %p: len %u tx %p rx %p bitpw %d\n",
+		xfer, xfer->len, xfer->tx_buf, xfer->rx_buf,
+		xfer->bits_per_word);
 
 	/* Enable relevant interrupts */
 	spi_writel(as, IER, SPI_BIT(RDRF) | SPI_BIT(OVRES));
@@ -945,21 +949,39 @@ atmel_spi_pump_pio_data(struct atmel_spi *as, struct spi_transfer *xfer)
 {
 	u8		*txp;
 	u8		*rxp;
+	u16		*txp16;
+	u16		*rxp16;
 	unsigned long	xfer_pos = xfer->len - as->current_remaining_bytes;
 
 	if (xfer->rx_buf) {
-		rxp = ((u8 *)xfer->rx_buf) + xfer_pos;
-		*rxp = spi_readl(as, RDR);
+		if (xfer->bits_per_word > 8) {
+			rxp16 = (u16 *)(((u8 *)xfer->rx_buf) + xfer_pos);
+			*rxp16 = spi_readl(as, RDR);
+		} else {
+			rxp = ((u8 *)xfer->rx_buf) + xfer_pos;
+			*rxp = spi_readl(as, RDR);
+		}
 	} else {
 		spi_readl(as, RDR);
 	}
-
-	as->current_remaining_bytes--;
+	if (xfer->bits_per_word > 8) {
+		as->current_remaining_bytes -= 2;
+		if (as->current_remaining_bytes < 0)
+			as->current_remaining_bytes = 0;
+	} else {
+		as->current_remaining_bytes--;
+	}
 
 	if (as->current_remaining_bytes) {
 		if (xfer->tx_buf) {
-			txp = ((u8 *)xfer->tx_buf) + xfer_pos + 1;
-			spi_writel(as, TDR, *txp);
+			if (xfer->bits_per_word > 8) {
+				txp16 = (u16 *)(((u8 *)xfer->tx_buf)
+							+ xfer_pos + 2);
+				spi_writel(as, TDR, *txp16);
+			} else {
+				txp = ((u8 *)xfer->tx_buf) + xfer_pos + 1;
+				spi_writel(as, TDR, *txp);
+			}
 		} else {
 			spi_writel(as, TDR, 0);
 		}
@@ -1372,6 +1394,12 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
 				return -ENOPROTOOPT;
 			}
 		}
+		if (xfer->bits_per_word > 8) {
+			if (xfer->len % 2) {
+				dev_dbg(&spi->dev, "buffer len should be 16 bits aligned\n");
+				return -EINVAL;
+			}
+		}
 
 		if (xfer->speed_hz < spi->max_speed_hz) {
 			dev_dbg(&spi->dev,
-- 
1.7.9.5

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

* [PATCH v6 11/16] spi/spi-atmel: correct 16 bits transfers with DMA
       [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
                   ` (8 preceding siblings ...)
  2013-03-07  3:32 ` [PATCH v6 10/16] spi/spi-atmel: correct 16 bits transfers using PIO Wenyou Yang
@ 2013-03-07  3:33 ` Wenyou Yang
  2013-03-07  3:34 ` [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi Wenyou Yang
  10 siblings, 0 replies; 23+ messages in thread
From: Wenyou Yang @ 2013-03-07  3:33 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: grant.likely, nicolas.ferre, plagnioj, richard.genoud, JM.Lin,
	wenyou.yang, spi-devel-general, linux-kernel

From: Richard Genoud <richard.genoud@gmail.com>

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
[wenyou.yang@atmel.com: submit the patch]
Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---
 drivers/spi/spi-atmel.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index d287889..1e212d1 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -388,12 +388,18 @@ static inline int atmel_spi_xfer_can_be_chained(struct spi_transfer *xfer)
 }
 
 static int atmel_spi_dma_slave_config(struct atmel_spi *as,
-				struct dma_slave_config *slave_config)
+				struct dma_slave_config *slave_config,
+				u8 bits_per_word)
 {
 	int err = 0;
 
-	slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
-	slave_config->src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
+	if (bits_per_word > 8) {
+		slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
+		slave_config->src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
+	} else {
+		slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
+		slave_config->src_addr_width = DMA_SLAVE_BUSWIDTH_1_BYTE;
+	}
 
 	slave_config->dst_addr = (dma_addr_t)as->phybase + SPI_TDR;
 	slave_config->src_addr = (dma_addr_t)as->phybase + SPI_RDR;
@@ -454,7 +460,7 @@ static int atmel_spi_configure_dma(struct atmel_spi *as)
 		goto error;
 	}
 
-	err = atmel_spi_dma_slave_config(as, &slave_config);
+	err = atmel_spi_dma_slave_config(as, &slave_config, 8);
 	if (err)
 		goto error;
 
@@ -588,10 +594,9 @@ static int atmel_spi_next_xfer_dma_submit(struct spi_master *master,
 
 	*plen = len;
 
-	if (atmel_spi_dma_slave_config(as, &slave_config))
+	if (atmel_spi_dma_slave_config(as, &slave_config, 8))
 		goto err_exit;
 
-
 	/* Send both scatterlists */
 	rxdesc = rxchan->device->device_prep_slave_sg(rxchan,
 					&as->dma.sgrx,
-- 
1.7.9.5

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

* [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi
       [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
                   ` (9 preceding siblings ...)
  2013-03-07  3:33 ` [PATCH v6 11/16] spi/spi-atmel: correct 16 bits transfers with DMA Wenyou Yang
@ 2013-03-07  3:34 ` Wenyou Yang
  2013-03-11 13:11   ` Jean-Christophe PLAGNIOL-VILLARD
  10 siblings, 1 reply; 23+ messages in thread
From: Wenyou Yang @ 2013-03-07  3:34 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: grant.likely, nicolas.ferre, plagnioj, richard.genoud, JM.Lin,
	wenyou.yang, spi-devel-general, linux-kernel

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Cc: spi-devel-general@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org
---
 drivers/spi/spi-atmel.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 1e212d1..6b166f4 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -23,6 +23,7 @@
 #include <linux/platform_data/atmel.h>
 #include <linux/platform_data/dma-atmel.h>
 #include <linux/of.h>
+#include <linux/pinctrl/consumer.h>
 
 #include <linux/io.h>
 #include <linux/gpio.h>
@@ -1493,11 +1494,18 @@ static int atmel_spi_probe(struct platform_device *pdev)
 	int			ret;
 	struct spi_master	*master;
 	struct atmel_spi	*as;
+	struct pinctrl		*pinctrl;
 
 	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!regs)
 		return -ENXIO;
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl)) {
+		dev_err(&pdev->dev, "Failed to request pinctrl\n");
+		return PTR_ERR(pinctrl);
+	}
+
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
 		return irq;
-- 
1.7.9.5

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

* Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set
  2013-03-07  3:26 ` [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set Wenyou Yang
@ 2013-03-07 12:17   ` Sergei Shtylyov
  2013-03-08  9:43     ` Yang, Wenyou
       [not found]   ` <1362626815-6628-1-git-send-email-wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
  1 sibling, 1 reply; 23+ messages in thread
From: Sergei Shtylyov @ 2013-03-07 12:17 UTC (permalink / raw)
  To: Wenyou Yang
  Cc: linux-arm-kernel, richard.genoud, JM.Lin, nicolas.ferre,
	linux-kernel, grant.likely, spi-devel-general, plagnioj

Hello.

On 07-03-2013 7:26, Wenyou Yang wrote:

> commit: 059b8ffeee5b427949872bb6ed5db5ae0788054e

    Please also specify the summary line of that commit in parens (or however 
you like).

> cause the atmel spi probing failure.

> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> Cc: spi-devel-general@lists.sourceforge.net
> Cc: linux-kernel@vger.kernel.org

WBR, Sergei

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

* Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set
       [not found]   ` <1362626815-6628-1-git-send-email-wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
@ 2013-03-07 12:30     ` Joachim Eastwood
  2013-03-08  1:06       ` Yang, Wenyou
  2013-05-02  2:35       ` Yang, Wenyou
  0 siblings, 2 replies; 23+ messages in thread
From: Joachim Eastwood @ 2013-03-07 12:30 UTC (permalink / raw)
  To: Wenyou Yang
  Cc: richard.genoud-Re5JQEeQqe8AvxtiuMwx3w,
	JM.Lin-AIFe0yeh4nAAvxtiuMwx3w,
	nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	plagnioj-sclMFOaUSTBWk0Htik3J/w,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 7 March 2013 04:26, Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org> wrote:
> commit: 059b8ffeee5b427949872bb6ed5db5ae0788054e
> cause the atmel spi probing failure.
>
> Signed-off-by: Wenyou Yang <wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
> Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> ---
>  drivers/spi/spi-atmel.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index 656d137..1eca815 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -846,9 +846,9 @@ static int atmel_spi_transfer(struct spi_device *spi, struct spi_message *msg)
>                         }
>                 }
>
> -               /* FIXME implement these protocol options!! */
> -               if (xfer->speed_hz) {
> -                       dev_dbg(&spi->dev, "no protocol options yet\n");
> +               if (xfer->speed_hz < spi->max_speed_hz) {
> +                       dev_dbg(&spi->dev,
> +                               "speed in transfer less than bus speed\n");
>                         return -ENOPROTOOPT;
>                 }

I sent a similar patch to spi-devl a while ago, which Grant said he applied.
https://patchwork.kernel.org/patch/2165301/

Can't find the patch in any upstream git tree so I guess Grant hasn't
pushed it yet.

regards
Joachim Eastwood

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev

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

* RE: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set
  2013-03-07 12:30     ` Joachim Eastwood
@ 2013-03-08  1:06       ` Yang, Wenyou
  2013-05-02  2:35       ` Yang, Wenyou
  1 sibling, 0 replies; 23+ messages in thread
From: Yang, Wenyou @ 2013-03-08  1:06 UTC (permalink / raw)
  To: Joachim Eastwood
  Cc: linux-arm-kernel, grant.likely, Ferre, Nicolas, plagnioj,
	richard.genoud, Lin, JM, spi-devel-general, linux-kernel

Hi Joachim,

> -----Original Message-----
> From: Joachim Eastwood [mailto:manabian@gmail.com]
> Sent: 2013年3月7日 20:31
> To: Yang, Wenyou
> Cc: linux-arm-kernel@lists.infradead.org; grant.likely@secretlab.ca; Ferre,
> Nicolas; plagnioj@jcrosoft.com; richard.genoud@gmail.com; Lin, JM;
> spi-devel-general@lists.sourceforge.net; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after
> xfer->speed_hz set
> 
> On 7 March 2013 04:26, Wenyou Yang <wenyou.yang@atmel.com> wrote:
> > commit: 059b8ffeee5b427949872bb6ed5db5ae0788054e
> > cause the atmel spi probing failure.
> >
> > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> > Cc: spi-devel-general@lists.sourceforge.net
> > Cc: linux-kernel@vger.kernel.org
> > ---
> >  drivers/spi/spi-atmel.c |    6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> > index 656d137..1eca815 100644
> > --- a/drivers/spi/spi-atmel.c
> > +++ b/drivers/spi/spi-atmel.c
> > @@ -846,9 +846,9 @@ static int atmel_spi_transfer(struct spi_device *spi,
> struct spi_message *msg)
> >                         }
> >                 }
> >
> > -               /* FIXME implement these protocol options!! */
> > -               if (xfer->speed_hz) {
> > -                       dev_dbg(&spi->dev, "no protocol options
> yet\n");
> > +               if (xfer->speed_hz < spi->max_speed_hz) {
> > +                       dev_dbg(&spi->dev,
> > +                               "speed in transfer less than bus
> speed\n");
> >                         return -ENOPROTOOPT;
> >                 }
> 
> I sent a similar patch to spi-devl a while ago, which Grant said he applied.
> https://patchwork.kernel.org/patch/2165301/
> 
> Can't find the patch in any upstream git tree so I guess Grant hasn't
> pushed it yet.

Sorry, I didn't notice your patch before.
Furthermore, I made this patch based on your and Grant,s email.

I will drop this patch.

> 
> regards
> Joachim Eastwood

Best Regards,
Wenyou Yang

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

* RE: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set
  2013-03-07 12:17   ` Sergei Shtylyov
@ 2013-03-08  9:43     ` Yang, Wenyou
  0 siblings, 0 replies; 23+ messages in thread
From: Yang, Wenyou @ 2013-03-08  9:43 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: linux-arm-kernel, richard.genoud, Lin, JM, Ferre, Nicolas,
	linux-kernel, grant.likely, spi-devel-general, plagnioj

Hi, Serqei,

> -----Original Message-----
> From: Sergei Shtylyov [mailto:sergei.shtylyov@cogentembedded.com]
> Sent: 2013年3月7日 20:18
> To: Yang, Wenyou
> Cc: linux-arm-kernel@lists.infradead.org; richard.genoud@gmail.com; Lin, JM;
> Ferre, Nicolas; linux-kernel@vger.kernel.org; grant.likely@secretlab.ca;
> spi-devel-general@lists.sourceforge.net; plagnioj@jcrosoft.com
> Subject: Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after
> xfer->speed_hz set
> 
> Hello.
> 
> On 07-03-2013 7:26, Wenyou Yang wrote:
> 
> > commit: 059b8ffeee5b427949872bb6ed5db5ae0788054e
> 
>     Please also specify the summary line of that commit in parens (or however
> you like).
Thanks for your suggestion.

> 
> > cause the atmel spi probing failure.
> 
> > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> > Cc: spi-devel-general@lists.sourceforge.net
> > Cc: linux-kernel@vger.kernel.org
> 
> WBR, Sergei

Best Regards,
Wenyou Yang

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

* Re: [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi
  2013-03-07  3:34 ` [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi Wenyou Yang
@ 2013-03-11 13:11   ` Jean-Christophe PLAGNIOL-VILLARD
       [not found]     ` <20130311131126.GB2001-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
  0 siblings, 1 reply; 23+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-03-11 13:11 UTC (permalink / raw)
  To: Wenyou Yang
  Cc: linux-arm-kernel, grant.likely, nicolas.ferre, richard.genoud,
	JM.Lin, spi-devel-general, linux-kernel

On 11:34 Thu 07 Mar     , Wenyou Yang wrote:
> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> Cc: spi-devel-general@lists.sourceforge.net
> Cc: linux-kernel@vger.kernel.org
> ---
>  drivers/spi/spi-atmel.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> index 1e212d1..6b166f4 100644
> --- a/drivers/spi/spi-atmel.c
> +++ b/drivers/spi/spi-atmel.c
> @@ -23,6 +23,7 @@
>  #include <linux/platform_data/atmel.h>
>  #include <linux/platform_data/dma-atmel.h>
>  #include <linux/of.h>
> +#include <linux/pinctrl/consumer.h>
>  
>  #include <linux/io.h>
>  #include <linux/gpio.h>
> @@ -1493,11 +1494,18 @@ static int atmel_spi_probe(struct platform_device *pdev)
>  	int			ret;
>  	struct spi_master	*master;
>  	struct atmel_spi	*as;
> +	struct pinctrl		*pinctrl;
>  
>  	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	if (!regs)
>  		return -ENXIO;
>  
> +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> +	if (IS_ERR(pinctrl)) {
> +		dev_err(&pdev->dev, "Failed to request pinctrl\n");
> +		return PTR_ERR(pinctrl);
> +	}

drop this, this is handled at bus level

Best Regards,
J.
> +
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0)
>  		return irq;
> -- 
> 1.7.9.5
> 

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

* RE: [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi
       [not found]     ` <20130311131126.GB2001-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
@ 2013-03-12  1:10       ` Yang, Wenyou
  0 siblings, 0 replies; 23+ messages in thread
From: Yang, Wenyou @ 2013-03-12  1:10 UTC (permalink / raw)
  To: Jean-Christophe PLAGNIOL-VILLARD
  Cc: richard.genoud-Re5JQEeQqe8AvxtiuMwx3w, Lin, JM, Ferre, Nicolas,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hi JC,

> -----Original Message-----
> From: Jean-Christophe PLAGNIOL-VILLARD [mailto:plagnioj@jcrosoft.com]
> Sent: 2013年3月11日 21:11
> To: Yang, Wenyou
> Cc: linux-arm-kernel@lists.infradead.org; grant.likely@secretlab.ca; Ferre,
> Nicolas; richard.genoud@gmail.com; Lin, JM;
> spi-devel-general@lists.sourceforge.net; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi
> 
> On 11:34 Thu 07 Mar     , Wenyou Yang wrote:
> > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> > Cc: spi-devel-general@lists.sourceforge.net
> > Cc: linux-kernel@vger.kernel.org
> > ---
> >  drivers/spi/spi-atmel.c |    8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> > index 1e212d1..6b166f4 100644
> > --- a/drivers/spi/spi-atmel.c
> > +++ b/drivers/spi/spi-atmel.c
> > @@ -23,6 +23,7 @@
> >  #include <linux/platform_data/atmel.h>
> >  #include <linux/platform_data/dma-atmel.h>
> >  #include <linux/of.h>
> > +#include <linux/pinctrl/consumer.h>
> >
> >  #include <linux/io.h>
> >  #include <linux/gpio.h>
> > @@ -1493,11 +1494,18 @@ static int atmel_spi_probe(struct
> platform_device *pdev)
> >  	int			ret;
> >  	struct spi_master	*master;
> >  	struct atmel_spi	*as;
> > +	struct pinctrl		*pinctrl;
> >
> >  	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> >  	if (!regs)
> >  		return -ENXIO;
> >
> > +	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> > +	if (IS_ERR(pinctrl)) {
> > +		dev_err(&pdev->dev, "Failed to request pinctrl\n");
> > +		return PTR_ERR(pinctrl);
> > +	}
> 
> drop this, this is handled at bus level
> 
Thanks a lot for your advance.

> Best Regards,
> J.

Best Regards
Wenyou Yang
> > +
> >  	irq = platform_get_irq(pdev, 0);
> >  	if (irq < 0)
> >  		return irq;
> > --
> > 1.7.9.5
> >
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

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

* RE: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set
  2013-03-07 12:30     ` Joachim Eastwood
  2013-03-08  1:06       ` Yang, Wenyou
@ 2013-05-02  2:35       ` Yang, Wenyou
  2013-05-02  8:12         ` Richard Genoud
  1 sibling, 1 reply; 23+ messages in thread
From: Yang, Wenyou @ 2013-05-02  2:35 UTC (permalink / raw)
  To: Joachim Eastwood
  Cc: linux-arm-kernel, grant.likely, Ferre, Nicolas, plagnioj,
	richard.genoud, Lin, JM, spi-devel-general, linux-kernel

Hi, Joachim,

> -----Original Message-----
> From: Joachim Eastwood [mailto:manabian@gmail.com]
> Sent: 2013年3月7日 20:31
> To: Yang, Wenyou
> Cc: linux-arm-kernel@lists.infradead.org; grant.likely@secretlab.ca; Ferre,
> Nicolas; plagnioj@jcrosoft.com; richard.genoud@gmail.com; Lin, JM;
> spi-devel-general@lists.sourceforge.net; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after
> xfer->speed_hz set
> 
> On 7 March 2013 04:26, Wenyou Yang <wenyou.yang@atmel.com> wrote:
> > commit: 059b8ffeee5b427949872bb6ed5db5ae0788054e
> > cause the atmel spi probing failure.
> >
> > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
> > Cc: spi-devel-general@lists.sourceforge.net
> > Cc: linux-kernel@vger.kernel.org
> > ---
> >  drivers/spi/spi-atmel.c |    6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
> > index 656d137..1eca815 100644
> > --- a/drivers/spi/spi-atmel.c
> > +++ b/drivers/spi/spi-atmel.c
> > @@ -846,9 +846,9 @@ static int atmel_spi_transfer(struct spi_device *spi,
> struct spi_message *msg)
> >                         }
> >                 }
> >
> > -               /* FIXME implement these protocol options!! */
> > -               if (xfer->speed_hz) {
> > -                       dev_dbg(&spi->dev, "no protocol options
> yet\n");
> > +               if (xfer->speed_hz < spi->max_speed_hz) {
> > +                       dev_dbg(&spi->dev,
> > +                               "speed in transfer less than bus
> speed\n");
> >                         return -ENOPROTOOPT;
> >                 }
> 
> I sent a similar patch to spi-devl a while ago, which Grant said he applied.
> https://patchwork.kernel.org/patch/2165301/
> 
> Can't find the patch in any upstream git tree so I guess Grant hasn't
> pushed it yet.
This patch hasn't still applied in any upstream git tree, so Atmel spi master doesn't work.
Could you help do some ping it? 

Thanks.

> 
> regards
> Joachim Eastwood

Best Regards,
Wenyou Yang

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

* Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set
  2013-05-02  2:35       ` Yang, Wenyou
@ 2013-05-02  8:12         ` Richard Genoud
       [not found]           ` <CACQ1gAhZO3stjrwf5SiZf7jOO8T5bAJZiz97M7+7vwFmk2e65g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 23+ messages in thread
From: Richard Genoud @ 2013-05-02  8:12 UTC (permalink / raw)
  To: Yang, Wenyou
  Cc: Joachim Eastwood, Ferre, Nicolas,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	plagnioj-sclMFOaUSTBWk0Htik3J/w, Lin, JM,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

2013/5/2 Yang, Wenyou <Wenyou.Yang@atmel.com>:
> Hi, Joachim,
>
>> -----Original Message-----
>> From: Joachim Eastwood [mailto:manabian@gmail.com]
>> Sent: 2013年3月7日 20:31
>> To: Yang, Wenyou
>> Cc: linux-arm-kernel@lists.infradead.org; grant.likely@secretlab.ca; Ferre,
>> Nicolas; plagnioj@jcrosoft.com; richard.genoud@gmail.com; Lin, JM;
>> spi-devel-general@lists.sourceforge.net; linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after
>> xfer->speed_hz set
>>
>> On 7 March 2013 04:26, Wenyou Yang <wenyou.yang@atmel.com> wrote:
>> > commit: 059b8ffeee5b427949872bb6ed5db5ae0788054e
>> > cause the atmel spi probing failure.
>> >
>> > Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
>> > Cc: spi-devel-general@lists.sourceforge.net
>> > Cc: linux-kernel@vger.kernel.org
>> > ---
>> >  drivers/spi/spi-atmel.c |    6 +++---
>> >  1 file changed, 3 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
>> > index 656d137..1eca815 100644
>> > --- a/drivers/spi/spi-atmel.c
>> > +++ b/drivers/spi/spi-atmel.c
>> > @@ -846,9 +846,9 @@ static int atmel_spi_transfer(struct spi_device *spi,
>> struct spi_message *msg)
>> >                         }
>> >                 }
>> >
>> > -               /* FIXME implement these protocol options!! */
>> > -               if (xfer->speed_hz) {
>> > -                       dev_dbg(&spi->dev, "no protocol options
>> yet\n");
>> > +               if (xfer->speed_hz < spi->max_speed_hz) {
>> > +                       dev_dbg(&spi->dev,
>> > +                               "speed in transfer less than bus
>> speed\n");
>> >                         return -ENOPROTOOPT;
>> >                 }
>>
>> I sent a similar patch to spi-devl a while ago, which Grant said he applied.
>> https://patchwork.kernel.org/patch/2165301/
>>
>> Can't find the patch in any upstream git tree so I guess Grant hasn't
>> pushed it yet.
> This patch hasn't still applied in any upstream git tree, so Atmel spi master doesn't work.
> Could you help do some ping it?

it's in linux-next:
3d3522604a5557e80fdcab61c54bd04eaf15b525
merged from spi-current/spi/merge


Richard.

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

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

* Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set
       [not found]           ` <CACQ1gAhZO3stjrwf5SiZf7jOO8T5bAJZiz97M7+7vwFmk2e65g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-05-02 10:34             ` Nicolas Ferre
  2013-05-06 10:31               ` Mark Brown
  0 siblings, 1 reply; 23+ messages in thread
From: Nicolas Ferre @ 2013-05-02 10:34 UTC (permalink / raw)
  To: grant.likely-s3s/WqlpOiPyB63q8FvJNQ, Grant Likely
  Cc: Richard Genoud, Joachim Eastwood, Mark Brown,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Yang, Wenyou,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	plagnioj-sclMFOaUSTBWk0Htik3J/w, Lin, JM,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 02/05/2013 10:12, Richard Genoud :
> 2013/5/2 Yang, Wenyou <Wenyou.Yang@atmel.com>:
>> Hi, Joachim,
>>
>>> -----Original Message-----
>>> From: Joachim Eastwood [mailto:manabian@gmail.com]
>>> Sent: 2013年3月7日 20:31
>>> To: Yang, Wenyou
>>> Cc: linux-arm-kernel@lists.infradead.org; grant.likely@secretlab.ca; Ferre,
>>> Nicolas; plagnioj@jcrosoft.com; richard.genoud@gmail.com; Lin, JM;
>>> spi-devel-general@lists.sourceforge.net; linux-kernel@vger.kernel.org
>>> Subject: Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after
>>> xfer->speed_hz set
>>>
>>> On 7 March 2013 04:26, Wenyou Yang <wenyou.yang@atmel.com> wrote:
>>>> commit: 059b8ffeee5b427949872bb6ed5db5ae0788054e
>>>> cause the atmel spi probing failure.
>>>>
>>>> Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
>>>> Cc: spi-devel-general@lists.sourceforge.net
>>>> Cc: linux-kernel@vger.kernel.org
>>>> ---
>>>>   drivers/spi/spi-atmel.c |    6 +++---
>>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
>>>> index 656d137..1eca815 100644
>>>> --- a/drivers/spi/spi-atmel.c
>>>> +++ b/drivers/spi/spi-atmel.c
>>>> @@ -846,9 +846,9 @@ static int atmel_spi_transfer(struct spi_device *spi,
>>> struct spi_message *msg)
>>>>                          }
>>>>                  }
>>>>
>>>> -               /* FIXME implement these protocol options!! */
>>>> -               if (xfer->speed_hz) {
>>>> -                       dev_dbg(&spi->dev, "no protocol options
>>> yet\n");
>>>> +               if (xfer->speed_hz < spi->max_speed_hz) {
>>>> +                       dev_dbg(&spi->dev,
>>>> +                               "speed in transfer less than bus
>>> speed\n");
>>>>                          return -ENOPROTOOPT;
>>>>                  }
>>>
>>> I sent a similar patch to spi-devl a while ago, which Grant said he applied.
>>> https://patchwork.kernel.org/patch/2165301/
>>>
>>> Can't find the patch in any upstream git tree so I guess Grant hasn't
>>> pushed it yet.
>> This patch hasn't still applied in any upstream git tree, so Atmel spi master doesn't work.
>> Could you help do some ping it?
>
> it's in linux-next:
> 3d3522604a5557e80fdcab61c54bd04eaf15b525
> merged from spi-current/spi/merge

Thanks Richard, yes I can find it here:
http://git.secretlab.ca/?p=linux.git;a=commit;h=3d3522604a5557e80fdcab61c54bd04eaf15b525

Grant, Mark,

Can you tell us if this SPI patch will be merged upstream using one of 
your paths?

Best regards,
-- 
Nicolas Ferre

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

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

* Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set
  2013-05-02 10:34             ` Nicolas Ferre
@ 2013-05-06 10:31               ` Mark Brown
       [not found]                 ` <20130506103105.GB13472-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
  0 siblings, 1 reply; 23+ messages in thread
From: Mark Brown @ 2013-05-06 10:31 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: grant.likely, Grant Likely, Richard Genoud, Yang, Wenyou,
	Joachim Eastwood, linux-arm-kernel, plagnioj, Lin, JM,
	spi-devel-general, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 247 bytes --]

On Thu, May 02, 2013 at 12:34:55PM +0200, Nicolas Ferre wrote:

> Can you tell us if this SPI patch will be merged upstream using one
> of your paths?

I have no idea what patch this is but if it's not in my tree -next it's
unlikely to be merged.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* RE: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set
       [not found]                 ` <20130506103105.GB13472-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
@ 2013-05-07  1:11                   ` Yang, Wenyou
  2013-05-07  9:31                     ` Nicolas Ferre
  0 siblings, 1 reply; 23+ messages in thread
From: Yang, Wenyou @ 2013-05-07  1:11 UTC (permalink / raw)
  To: Mark Brown, Ferre, Nicolas
  Cc: Richard Genoud, Joachim Eastwood,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Grant Likely,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	plagnioj-sclMFOaUSTBWk0Htik3J/w, Lin, JM,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

Hi, Mark

> From: Mark Brown [mailto:broonie@kernel.org]
> Sent: 2013年5月6日 18:31
> To: Ferre, Nicolas
> Cc: grant.likely@secretlab.ca; Grant Likely; Richard Genoud; Yang, Wenyou;
> Joachim Eastwood; linux-arm-kernel@lists.infradead.org;
> plagnioj@jcrosoft.com; Lin, JM; spi-devel-general@lists.sourceforge.net;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after
> xfer->speed_hz set
> 
> On Thu, May 02, 2013 at 12:34:55PM +0200, Nicolas Ferre wrote:
> 
> > Can you tell us if this SPI patch will be merged upstream using one of
> > your paths?
> 
> I have no idea what patch this is but if it's not in my tree -next it's unlikely to be
> merged.
This is dropped patch, no need to be merged.

We tested Atmel spi in your tree-next , but it doesn't work, the reason is the Joachim Eastwood's patch is not included. 
https://patchwork.kernel.org/patch/2165301/
which Joachim said that Grant said he applied.

Thanks

Best Regards,
Wenyou Yang
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

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

* Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set
  2013-05-07  1:11                   ` Yang, Wenyou
@ 2013-05-07  9:31                     ` Nicolas Ferre
  0 siblings, 0 replies; 23+ messages in thread
From: Nicolas Ferre @ 2013-05-07  9:31 UTC (permalink / raw)
  To: Yang, Wenyou
  Cc: Mark Brown, grant.likely, Grant Likely, Richard Genoud,
	Joachim Eastwood, linux-arm-kernel, plagnioj, Lin, JM,
	spi-devel-general, linux-kernel

On 07/05/2013 03:11, Yang, Wenyou :
> Hi, Mark
> 
>> From: Mark Brown [mailto:broonie@kernel.org]
>> Sent: 2013年5月6日 18:31
>> To: Ferre, Nicolas
>> Cc: grant.likely@secretlab.ca; Grant Likely; Richard Genoud; Yang, Wenyou;
>> Joachim Eastwood; linux-arm-kernel@lists.infradead.org;
>> plagnioj@jcrosoft.com; Lin, JM; spi-devel-general@lists.sourceforge.net;
>> linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH v6 01/16] spi/spi-atmel: fix probing failure after
>> xfer->speed_hz set
>>
>> On Thu, May 02, 2013 at 12:34:55PM +0200, Nicolas Ferre wrote:
>>
>>> Can you tell us if this SPI patch will be merged upstream using one of
>>> your paths?
>>
>> I have no idea what patch this is but if it's not in my tree -next it's unlikely to be
>> merged.
> This is dropped patch, no need to be merged.
> 
> We tested Atmel spi in your tree-next , but it doesn't work, the reason is the Joachim Eastwood's patch is not included.
> https://patchwork.kernel.org/patch/2165301/
> which Joachim said that Grant said he applied.

Hi Wenyou,

Sorry for not having communicating with you after Mark told me the story
about this patch: Mark merged Grant's material in his SPI tree (with is
the official one nowadays). You can see that by browsing linux-next:

 Merge remote-tracking branch 'spi/fix/grant' into spi-linus

Joachim's patch is well included in it. We still have to monitor
inclusion of it in Linus' tree...

Mark, sorry for the noise.

Bye,
-- 
Nicolas Ferre

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

end of thread, other threads:[~2013-05-07  9:31 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1362626715-6549-1-git-send-email-wenyou.yang@atmel.com>
2013-03-07  3:26 ` [PATCH v6 01/16] spi/spi-atmel: fix probing failure after xfer->speed_hz set Wenyou Yang
2013-03-07 12:17   ` Sergei Shtylyov
2013-03-08  9:43     ` Yang, Wenyou
     [not found]   ` <1362626815-6628-1-git-send-email-wenyou.yang-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>
2013-03-07 12:30     ` Joachim Eastwood
2013-03-08  1:06       ` Yang, Wenyou
2013-05-02  2:35       ` Yang, Wenyou
2013-05-02  8:12         ` Richard Genoud
     [not found]           ` <CACQ1gAhZO3stjrwf5SiZf7jOO8T5bAJZiz97M7+7vwFmk2e65g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-02 10:34             ` Nicolas Ferre
2013-05-06 10:31               ` Mark Brown
     [not found]                 ` <20130506103105.GB13472-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2013-05-07  1:11                   ` Yang, Wenyou
2013-05-07  9:31                     ` Nicolas Ferre
2013-03-07  3:27 ` [PATCH v6 02/16] spi/spi-atmel: detect the capabilities of SPI core by reading the VERSION register Wenyou Yang
2013-03-07  3:28 ` [PATCH v6 03/16] spi/spi-atmel: add support transfer on CS1,2,3, not only on CS0 Wenyou Yang
2013-03-07  3:28 ` [PATCH v6 04/16] spi/spi-atmel: add physical base address Wenyou Yang
2013-03-07  3:29 ` [PATCH v6 05/16] spi/spi-atmel: call unmapping on transfers buffers Wenyou Yang
2013-03-07  3:29 ` [PATCH v6 06/16] spi/spi-atmel: status information passed through controller data Wenyou Yang
2013-03-07  3:30 ` [PATCH v6 07/16] spi/spi-atmel: add flag to controller data for lock operations Wenyou Yang
2013-03-07  3:32 ` [PATCH v6 09/16] spi/spi-atmel: fix spi-atmel driver to adapt to slave_config changes Wenyou Yang
2013-03-07  3:32 ` [PATCH v6 10/16] spi/spi-atmel: correct 16 bits transfers using PIO Wenyou Yang
2013-03-07  3:33 ` [PATCH v6 11/16] spi/spi-atmel: correct 16 bits transfers with DMA Wenyou Yang
2013-03-07  3:34 ` [PATCH v6 12/16] spi/spi-atmel: add pinctrl support for atmel spi Wenyou Yang
2013-03-11 13:11   ` Jean-Christophe PLAGNIOL-VILLARD
     [not found]     ` <20130311131126.GB2001-RQcB7r2h9QmfDR2tN2SG5Ni2O/JbrIOy@public.gmane.org>
2013-03-12  1:10       ` Yang, Wenyou

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).