All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] spi: dw: device tree and generic queue support
@ 2014-01-31 10:07 Baruch Siach
       [not found] ` <cover.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Baruch Siach @ 2014-01-31 10:07 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang, Baruch Siach

Unfortunately, I probably have no chance access to thest this series on
hardware, I's only compile tested. So I'm sending this as RFC for code review.
If this series doesn't get merged, it may be used at least as a starting point
for someone with hardware access.

These patches add the following:

   * Device tree support for the platform driver (dw-mmio)

   * GPIO controlled chip-select implementing the generic SPI GPIO CS binding

   * Generic queue migration

Comments are welcome.

v3:
   * Reorder patches:

      - Move generic queue migration to the beginning

      - Move binding documentation before implementation

   * Add a patch removing HAVE_CLK dependency

   * Address the comments of Mark Brown:

      - Move gpio request to probe() for compatibility with deferred gpio
	probing

      - Extend spi_chip_sel() to handle chip-select deactivation

      - devm_gpio_request_one() can't be used in probe() to also set direction 
	and level, because we don't know the desired slave dependent 
	chip-select polarity yet

v2:
   * Use managed resources for GPIO allocation (Mark Brown)

   * Add device tree binding documentation (Mark Brown)

Baruch Siach (5):
  spi: dw: migrate to generic queue infrastructure
  spi: dw: document device tree binding
  spi: dw-mmio: add device tree support
  spi: dw: add support for gpio controlled chip select
  spi: dw-mmio: remove HAVE_CLK build dependecy

 Documentation/devicetree/bindings/spi/spi-dw.txt |  24 +++
 drivers/spi/Kconfig                              |   2 +-
 drivers/spi/spi-dw-mmio.c                        |  43 ++++-
 drivers/spi/spi-dw.c                             | 201 +++--------------------
 drivers/spi/spi-dw.h                             |  24 ++-
 5 files changed, 102 insertions(+), 192 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-dw.txt

-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 1/5] spi: dw: migrate to generic queue infrastructure
       [not found] ` <cover.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
@ 2014-01-31 10:07   ` Baruch Siach
  2014-01-31 10:07   ` [PATCH v3 2/5] spi: dw: document device tree binding Baruch Siach
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Baruch Siach @ 2014-01-31 10:07 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang, Baruch Siach

Signed-off-by: Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
---
 drivers/spi/spi-dw.c | 183 ++++-----------------------------------------------
 drivers/spi/spi-dw.h |   8 ---
 2 files changed, 12 insertions(+), 179 deletions(-)

diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index bf98d63d92b3..cd05c0050325 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -36,9 +36,6 @@
 #define DONE_STATE	((void *)2)
 #define ERROR_STATE	((void *)-1)
 
-#define QUEUE_RUNNING	0
-#define QUEUE_STOPPED	1
-
 #define MRST_SPI_DEASSERT	0
 #define MRST_SPI_ASSERT		1
 
@@ -263,18 +260,14 @@ static int map_dma_buffers(struct dw_spi *dws)
 static void giveback(struct dw_spi *dws)
 {
 	struct spi_transfer *last_transfer;
-	unsigned long flags;
 	struct spi_message *msg;
 
-	spin_lock_irqsave(&dws->lock, flags);
 	msg = dws->cur_msg;
 	dws->cur_msg = NULL;
 	dws->cur_transfer = NULL;
 	dws->prev_chip = dws->cur_chip;
 	dws->cur_chip = NULL;
 	dws->dma_mapped = 0;
-	queue_work(dws->workqueue, &dws->pump_messages);
-	spin_unlock_irqrestore(&dws->lock, flags);
 
 	last_transfer = list_entry(msg->transfers.prev,
 					struct spi_transfer,
@@ -283,9 +276,7 @@ static void giveback(struct dw_spi *dws)
 	if (!last_transfer->cs_change && dws->cs_control)
 		dws->cs_control(MRST_SPI_DEASSERT);
 
-	msg->state = NULL;
-	if (msg->complete)
-		msg->complete(msg->context);
+	spi_finalize_current_message(dws->master);
 }
 
 static void int_error_stop(struct dw_spi *dws, const char *msg)
@@ -536,30 +527,12 @@ early_exit:
 	return;
 }
 
-static void pump_messages(struct work_struct *work)
+static int dw_spi_transfer_one_message(struct spi_master *master,
+		struct spi_message *msg)
 {
-	struct dw_spi *dws =
-		container_of(work, struct dw_spi, pump_messages);
-	unsigned long flags;
-
-	/* Lock queue and check for queue work */
-	spin_lock_irqsave(&dws->lock, flags);
-	if (list_empty(&dws->queue) || dws->run == QUEUE_STOPPED) {
-		dws->busy = 0;
-		spin_unlock_irqrestore(&dws->lock, flags);
-		return;
-	}
-
-	/* Make sure we are not already running a message */
-	if (dws->cur_msg) {
-		spin_unlock_irqrestore(&dws->lock, flags);
-		return;
-	}
-
-	/* Extract head of queue */
-	dws->cur_msg = list_entry(dws->queue.next, struct spi_message, queue);
-	list_del_init(&dws->cur_msg->queue);
+	struct dw_spi *dws = spi_master_get_devdata(master);
 
+	dws->cur_msg = msg;
 	/* Initial message state*/
 	dws->cur_msg->state = START_STATE;
 	dws->cur_transfer = list_entry(dws->cur_msg->transfers.next,
@@ -567,46 +540,9 @@ static void pump_messages(struct work_struct *work)
 						transfer_list);
 	dws->cur_chip = spi_get_ctldata(dws->cur_msg->spi);
 
-	/* Mark as busy and launch transfers */
+	/* Launch transfers */
 	tasklet_schedule(&dws->pump_transfers);
 
-	dws->busy = 1;
-	spin_unlock_irqrestore(&dws->lock, flags);
-}
-
-/* spi_device use this to queue in their spi_msg */
-static int dw_spi_transfer(struct spi_device *spi, struct spi_message *msg)
-{
-	struct dw_spi *dws = spi_master_get_devdata(spi->master);
-	unsigned long flags;
-
-	spin_lock_irqsave(&dws->lock, flags);
-
-	if (dws->run == QUEUE_STOPPED) {
-		spin_unlock_irqrestore(&dws->lock, flags);
-		return -ESHUTDOWN;
-	}
-
-	msg->actual_length = 0;
-	msg->status = -EINPROGRESS;
-	msg->state = START_STATE;
-
-	list_add_tail(&msg->queue, &dws->queue);
-
-	if (dws->run == QUEUE_RUNNING && !dws->busy) {
-
-		if (dws->cur_transfer || dws->cur_msg)
-			queue_work(dws->workqueue,
-					&dws->pump_messages);
-		else {
-			/* If no other data transaction in air, just go */
-			spin_unlock_irqrestore(&dws->lock, flags);
-			pump_messages(&dws->pump_messages);
-			return 0;
-		}
-	}
-
-	spin_unlock_irqrestore(&dws->lock, flags);
 	return 0;
 }
 
@@ -677,81 +613,6 @@ static void dw_spi_cleanup(struct spi_device *spi)
 	kfree(chip);
 }
 
-static int init_queue(struct dw_spi *dws)
-{
-	INIT_LIST_HEAD(&dws->queue);
-	spin_lock_init(&dws->lock);
-
-	dws->run = QUEUE_STOPPED;
-	dws->busy = 0;
-
-	tasklet_init(&dws->pump_transfers,
-			pump_transfers,	(unsigned long)dws);
-
-	INIT_WORK(&dws->pump_messages, pump_messages);
-	dws->workqueue = create_singlethread_workqueue(
-					dev_name(dws->master->dev.parent));
-	if (dws->workqueue == NULL)
-		return -EBUSY;
-
-	return 0;
-}
-
-static int start_queue(struct dw_spi *dws)
-{
-	unsigned long flags;
-
-	spin_lock_irqsave(&dws->lock, flags);
-
-	if (dws->run == QUEUE_RUNNING || dws->busy) {
-		spin_unlock_irqrestore(&dws->lock, flags);
-		return -EBUSY;
-	}
-
-	dws->run = QUEUE_RUNNING;
-	dws->cur_msg = NULL;
-	dws->cur_transfer = NULL;
-	dws->cur_chip = NULL;
-	dws->prev_chip = NULL;
-	spin_unlock_irqrestore(&dws->lock, flags);
-
-	queue_work(dws->workqueue, &dws->pump_messages);
-
-	return 0;
-}
-
-static int stop_queue(struct dw_spi *dws)
-{
-	unsigned long flags;
-	unsigned limit = 50;
-	int status = 0;
-
-	spin_lock_irqsave(&dws->lock, flags);
-	dws->run = QUEUE_STOPPED;
-	while ((!list_empty(&dws->queue) || dws->busy) && limit--) {
-		spin_unlock_irqrestore(&dws->lock, flags);
-		msleep(10);
-		spin_lock_irqsave(&dws->lock, flags);
-	}
-
-	if (!list_empty(&dws->queue) || dws->busy)
-		status = -EBUSY;
-	spin_unlock_irqrestore(&dws->lock, flags);
-
-	return status;
-}
-
-static int destroy_queue(struct dw_spi *dws)
-{
-	int status;
-
-	status = stop_queue(dws);
-	if (status != 0)
-		return status;
-	destroy_workqueue(dws->workqueue);
-	return 0;
-}
-
 /* Restart the controller, disable all interrupts, clean rx fifo */
 static void spi_hw_init(struct dw_spi *dws)
 {
@@ -808,7 +669,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
 	master->num_chipselect = dws->num_cs;
 	master->cleanup = dw_spi_cleanup;
 	master->setup = dw_spi_setup;
-	master->transfer = dw_spi_transfer;
+	master->transfer_one_message = dw_spi_transfer_one_message;
 
 	/* Basic HW init */
 	spi_hw_init(dws);
@@ -821,33 +682,21 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
 		}
 	}
 
-	/* Initial and start queue */
-	ret = init_queue(dws);
-	if (ret) {
-		dev_err(&master->dev, "problem initializing queue\n");
-		goto err_diable_hw;
-	}
-	ret = start_queue(dws);
-	if (ret) {
-		dev_err(&master->dev, "problem starting queue\n");
-		goto err_diable_hw;
-	}
+	tasklet_init(&dws->pump_transfers, pump_transfers, (unsigned long)dws);
 
 	spi_master_set_devdata(master, dws);
 	ret = devm_spi_register_master(dev, master);
 	if (ret) {
 		dev_err(&master->dev, "problem registering spi master\n");
-		goto err_queue_alloc;
+		goto err_dma_exit;
 	}
 
 	mrst_spi_debugfs_init(dws);
 	return 0;
 
-err_queue_alloc:
-	destroy_queue(dws);
+err_dma_exit:
 	if (dws->dma_ops && dws->dma_ops->dma_exit)
 		dws->dma_ops->dma_exit(dws);
-err_diable_hw:
 	spi_enable_chip(dws, 0);
 err_free_master:
 	spi_master_put(master);
@@ -857,18 +706,10 @@ EXPORT_SYMBOL_GPL(dw_spi_add_host);
 
 void dw_spi_remove_host(struct dw_spi *dws)
 {
-	int status = 0;
-
 	if (!dws)
 		return;
 	mrst_spi_debugfs_remove(dws);
 
-	/* Remove the queue */
-	status = destroy_queue(dws);
-	if (status != 0)
-		dev_err(&dws->master->dev,
-			"dw_spi_remove: workqueue will not complete, message memory not freed\n");
-
 	if (dws->dma_ops && dws->dma_ops->dma_exit)
 		dws->dma_ops->dma_exit(dws);
 	spi_enable_chip(dws, 0);
@@ -881,7 +722,7 @@ int dw_spi_suspend_host(struct dw_spi *dws)
 {
 	int ret = 0;
 
-	ret = stop_queue(dws);
+	ret = spi_master_suspend(dws->master);
 	if (ret)
 		return ret;
 	spi_enable_chip(dws, 0);
@@ -895,7 +736,7 @@ int dw_spi_resume_host(struct dw_spi *dws)
 	int ret;
 
 	spi_hw_init(dws);
-	ret = start_queue(dws);
+	ret = spi_master_resume(dws->master);
 	if (ret)
 		dev_err(&dws->master->dev, "fail to start queue (%d)\n", ret);
 	return ret;
diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h
index 587643dae11e..3fd7ab599ab4 100644
--- a/drivers/spi/spi-dw.h
+++ b/drivers/spi/spi-dw.h
@@ -104,14 +104,6 @@ struct dw_spi {
 	u16			bus_num;
 	u16			num_cs;		/* supported slave numbers */
 
-	/* Driver message queue */
-	struct workqueue_struct	*workqueue;
-	struct work_struct	pump_messages;
-	spinlock_t		lock;
-	struct list_head	queue;
-	int			busy;
-	int			run;
-
 	/* Message Transfer pump */
 	struct tasklet_struct	pump_transfers;
 
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 2/5] spi: dw: document device tree binding
       [not found] ` <cover.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
  2014-01-31 10:07   ` [PATCH v3 1/5] spi: dw: migrate to generic queue infrastructure Baruch Siach
@ 2014-01-31 10:07   ` Baruch Siach
       [not found]     ` <a978b266a9b8827747054a689e014ca9efbec235.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
  2014-01-31 10:07   ` [PATCH v3 3/5] spi: dw-mmio: add device tree support Baruch Siach
                     ` (4 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Baruch Siach @ 2014-01-31 10:07 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang, Baruch Siach

Signed-off-by: Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
---
 Documentation/devicetree/bindings/spi/spi-dw.txt | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-dw.txt

diff --git a/Documentation/devicetree/bindings/spi/spi-dw.txt b/Documentation/devicetree/bindings/spi/spi-dw.txt
new file mode 100644
index 000000000000..7b63ed601990
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-dw.txt
@@ -0,0 +1,24 @@
+Synopsys DesignWare SPI master
+
+Required properties:
+- compatible: should be "snps,designware-spi"
+- #address-cells: see spi-bus.txt
+- #size-cells: see spi-bus.txt
+- reg: address and length of the spi master registers
+- interrupts: should contain one interrupt
+- clocks: spi clock phandle
+- num-cs: see spi-bus.txt
+
+Optional properties:
+- cs-gpios: see spi-bus.txt
+
+Example:
+
+spi: spi@4020a000 {
+	compatible = "snps,designware-spi";
+	interrupts = <11 1>;
+	reg = <0x4020a000 0x1000>;
+	clocks = <&pclk>;
+	num-cs = <2>;
+	cs-gpios = <&banka 0 0>;
+};
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 3/5] spi: dw-mmio: add device tree support
       [not found] ` <cover.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
  2014-01-31 10:07   ` [PATCH v3 1/5] spi: dw: migrate to generic queue infrastructure Baruch Siach
  2014-01-31 10:07   ` [PATCH v3 2/5] spi: dw: document device tree binding Baruch Siach
@ 2014-01-31 10:07   ` Baruch Siach
  2014-01-31 10:07   ` [PATCH v3 4/5] spi: dw: add support for gpio controlled chip select Baruch Siach
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Baruch Siach @ 2014-01-31 10:07 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang, Baruch Siach,
	Jean-Hugues Deschenes

Cc: Jean-Hugues Deschenes <jean-hugues.deschenes-YGVykHU+fedBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
---
 drivers/spi/spi-dw-mmio.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
index 1492f5ee9aaa..86d247ecd2d2 100644
--- a/drivers/spi/spi-dw-mmio.c
+++ b/drivers/spi/spi-dw-mmio.c
@@ -16,6 +16,7 @@
 #include <linux/spi/spi.h>
 #include <linux/scatterlist.h>
 #include <linux/module.h>
+#include <linux/of.h>
 
 #include "spi-dw.h"
 
@@ -32,6 +33,7 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
 	struct dw_spi *dws;
 	struct resource *mem;
 	int ret;
+	u32 tmp;
 
 	dwsmmio = devm_kzalloc(&pdev->dev, sizeof(struct dw_spi_mmio),
 			GFP_KERNEL);
@@ -67,7 +69,15 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
 		return ret;
 
 	dws->bus_num = pdev->id;
-	dws->num_cs = 4;
+	if (pdev->dev.of_node == NULL)
+		dws->num_cs = 4;
+	ret = of_property_read_u32(pdev->dev.of_node, "num-cs", &tmp);
+	if (ret == 0)
+		dws->num_cs = tmp;
+	if (dws->num_cs == 0) {
+		dev_err(&pdev->dev, "missing or wrong num-cs property\n");
+		goto out;
+	}
 	dws->max_freq = clk_get_rate(dwsmmio->clk);
 
 	ret = dw_spi_add_host(&pdev->dev, dws);
@@ -92,12 +102,21 @@ static int dw_spi_mmio_remove(struct platform_device *pdev)
 	return 0;
 }
 
+#ifdef CONFIG_OF
+static struct of_device_id dw_spi_dt_ids[] = {
+	{ .compatible = "snps,designware-spi" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, dw_spi_dt_ids);
+#endif
+
 static struct platform_driver dw_spi_mmio_driver = {
 	.probe		= dw_spi_mmio_probe,
 	.remove		= dw_spi_mmio_remove,
 	.driver		= {
 		.name	= DRIVER_NAME,
 		.owner	= THIS_MODULE,
+		.of_match_table = of_match_ptr(dw_spi_dt_ids),
 	},
 };
 module_platform_driver(dw_spi_mmio_driver);
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 4/5] spi: dw: add support for gpio controlled chip select
       [not found] ` <cover.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
                     ` (2 preceding siblings ...)
  2014-01-31 10:07   ` [PATCH v3 3/5] spi: dw-mmio: add device tree support Baruch Siach
@ 2014-01-31 10:07   ` Baruch Siach
  2014-01-31 10:07   ` [PATCH v3 5/5] spi: dw-mmio: remove HAVE_CLK build dependecy Baruch Siach
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Baruch Siach @ 2014-01-31 10:07 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang, Baruch Siach

Also, use this opportunity to let spi_chip_sel() handle chip-select
deactivation as well.

Signed-off-by: Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
---
 drivers/spi/spi-dw-mmio.c | 22 ++++++++++++++++++++++
 drivers/spi/spi-dw.c      | 18 ++++++++++++------
 drivers/spi/spi-dw.h      | 16 +++++++++++-----
 3 files changed, 45 insertions(+), 11 deletions(-)

diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
index 86d247ecd2d2..4167b6eb47d8 100644
--- a/drivers/spi/spi-dw-mmio.c
+++ b/drivers/spi/spi-dw-mmio.c
@@ -17,6 +17,7 @@
 #include <linux/scatterlist.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/of_gpio.h>
 
 #include "spi-dw.h"
 
@@ -80,6 +81,27 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
 	}
 	dws->max_freq = clk_get_rate(dwsmmio->clk);
 
+	if (pdev->dev.of_node) {
+		int i;
+
+		for (i = 0; i < dws->num_cs; i++) {
+			int cs_gpio = of_get_named_gpio(pdev->dev.of_node,
+					"cs-gpios", i);
+
+			if (cs_gpio == -EPROBE_DEFER) {
+				ret = cs_gpio;
+				goto out;
+			}
+
+			if (gpio_is_valid(cs_gpio)) {
+				ret = devm_gpio_request(&pdev->dev, cs_gpio,
+						dev_name(&pdev->dev));
+				if (ret)
+					goto out;
+			}
+		}
+	}
+
 	ret = dw_spi_add_host(&pdev->dev, dws);
 	if (ret)
 		goto out;
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index cd05c0050325..2805f43ac35e 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -24,6 +24,7 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/spi/spi.h>
+#include <linux/gpio.h>
 
 #include "spi-dw.h"
 
@@ -36,9 +37,6 @@
 #define DONE_STATE	((void *)2)
 #define ERROR_STATE	((void *)-1)
 
-#define MRST_SPI_DEASSERT	0
-#define MRST_SPI_ASSERT		1
-
 /* Slave spi_dev related */
 struct chip_data {
 	u16 cr0;
@@ -273,8 +271,8 @@ static void giveback(struct dw_spi *dws)
 					struct spi_transfer,
 					transfer_list);
 
-	if (!last_transfer->cs_change && dws->cs_control)
-		dws->cs_control(MRST_SPI_DEASSERT);
+	if (!last_transfer->cs_change)
+		spi_chip_sel(dws, dws->cur_msg->spi, 0);
 
 	spi_finalize_current_message(dws->master);
 }
@@ -500,7 +498,7 @@ static void pump_transfers(unsigned long data)
 			dw_writew(dws, DW_SPI_CTRL0, cr0);
 
 		spi_set_clk(dws, clk_div ? clk_div : chip->clk_div);
-		spi_chip_sel(dws, spi->chip_select);
+		spi_chip_sel(dws, spi, 1);
 
 		/* Set the interrupt mask, for poll mode just disable all int */
 		spi_mask_intr(dws, 0xff);
@@ -551,6 +549,7 @@ static int dw_spi_setup(struct spi_device *spi)
 {
 	struct dw_spi_chip *chip_info = NULL;
 	struct chip_data *chip;
+	int ret;
 
 	/* Only alloc on first setup */
 	chip = spi_get_ctldata(spi);
@@ -604,6 +603,13 @@ static int dw_spi_setup(struct spi_device *spi)
 			| (spi->mode  << SPI_MODE_OFFSET)
 			| (chip->tmode << SPI_TMOD_OFFSET);
 
+	if (gpio_is_valid(spi->cs_gpio)) {
+		ret = gpio_direction_output(spi->cs_gpio,
+				!(spi->mode & SPI_CS_HIGH));
+		if (ret)
+			return ret;
+	}
+
 	return 0;
 }
 
diff --git a/drivers/spi/spi-dw.h b/drivers/spi/spi-dw.h
index 3fd7ab599ab4..6d2acad34f64 100644
--- a/drivers/spi/spi-dw.h
+++ b/drivers/spi/spi-dw.h
@@ -3,6 +3,7 @@
 
 #include <linux/io.h>
 #include <linux/scatterlist.h>
+#include <linux/gpio.h>
 
 /* Register offsets */
 #define DW_SPI_CTRL0			0x00
@@ -178,15 +179,20 @@ static inline void spi_set_clk(struct dw_spi *dws, u16 div)
 	dw_writel(dws, DW_SPI_BAUDR, div);
 }
 
-static inline void spi_chip_sel(struct dw_spi *dws, u16 cs)
+static inline void spi_chip_sel(struct dw_spi *dws, struct spi_device *spi,
+		int active)
 {
-	if (cs > dws->num_cs)
-		return;
+	u16 cs = spi->chip_select;
+	int gpio_val = active ? (spi->mode & SPI_CS_HIGH) :
+		!(spi->mode & SPI_CS_HIGH);
 
 	if (dws->cs_control)
-		dws->cs_control(1);
+		dws->cs_control(active);
+	if (gpio_is_valid(spi->cs_gpio))
+		gpio_set_value(spi->cs_gpio, gpio_val);
 
-	dw_writel(dws, DW_SPI_SER, 1 << cs);
+	if (active)
+		dw_writel(dws, DW_SPI_SER, 1 << cs);
 }
 
 /* Disable IRQ bits */
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 5/5] spi: dw-mmio: remove HAVE_CLK build dependecy
       [not found] ` <cover.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
                     ` (3 preceding siblings ...)
  2014-01-31 10:07   ` [PATCH v3 4/5] spi: dw: add support for gpio controlled chip select Baruch Siach
@ 2014-01-31 10:07   ` Baruch Siach
       [not found]     ` <207f4522cbabac73422b54006ead761f25380013.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
  2014-01-31 16:49   ` [PATCH v3 0/5] spi: dw: device tree and generic queue support Mark Brown
  2014-02-02 12:49   ` Gerhard Sittig
  6 siblings, 1 reply; 18+ messages in thread
From: Baruch Siach @ 2014-01-31 10:07 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang, Baruch Siach

Since 93abe8e4 (clk: add non CONFIG_HAVE_CLK routines) code using clk.h
like this platform driver needs not depend on HAVE_CLK.

Signed-off-by: Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
---
 drivers/spi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 5072b71baf5e..bdfb74dbcf76 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -543,7 +543,7 @@ config SPI_DW_MID_DMA
 
 config SPI_DW_MMIO
 	tristate "Memory-mapped io interface driver for DW SPI core"
-	depends on SPI_DESIGNWARE && HAVE_CLK
+	depends on SPI_DESIGNWARE
 
 #
 # There are lots of SPI device types, with sensors and memory
-- 
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 5/5] spi: dw-mmio: remove HAVE_CLK build dependecy
       [not found]     ` <207f4522cbabac73422b54006ead761f25380013.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
@ 2014-01-31 16:46       ` Mark Brown
  0 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2014-01-31 16:46 UTC (permalink / raw)
  To: Baruch Siach; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

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

On Fri, Jan 31, 2014 at 12:07:48PM +0200, Baruch Siach wrote:
> Since 93abe8e4 (clk: add non CONFIG_HAVE_CLK routines) code using clk.h
> like this platform driver needs not depend on HAVE_CLK.

Applied, thanks.

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

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

* Re: [PATCH v3 0/5] spi: dw: device tree and generic queue support
       [not found] ` <cover.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
                     ` (4 preceding siblings ...)
  2014-01-31 10:07   ` [PATCH v3 5/5] spi: dw-mmio: remove HAVE_CLK build dependecy Baruch Siach
@ 2014-01-31 16:49   ` Mark Brown
  2014-02-02 12:49   ` Gerhard Sittig
  6 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2014-01-31 16:49 UTC (permalink / raw)
  To: Baruch Siach; +Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

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

On Fri, Jan 31, 2014 at 12:07:43PM +0200, Baruch Siach wrote:
> Unfortunately, I probably have no chance access to thest this series on
> hardware, I's only compile tested. So I'm sending this as RFC for code review.
> If this series doesn't get merged, it may be used at least as a starting point
> for someone with hardware access.

This looks basically fine - hopefully someone can test.

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

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

* Re: [PATCH v3 2/5] spi: dw: document device tree binding
       [not found]     ` <a978b266a9b8827747054a689e014ca9efbec235.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
@ 2014-02-02 12:23       ` Gerhard Sittig
       [not found]         ` <20140202122320.GQ20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Gerhard Sittig @ 2014-02-02 12:23 UTC (permalink / raw)
  To: Baruch Siach; +Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

On Fri, Jan 31, 2014 at 12:07 +0200, Baruch Siach wrote:
> 
> Signed-off-by: Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
> ---
>  Documentation/devicetree/bindings/spi/spi-dw.txt | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/spi-dw.txt

You introduce a new binding, but don't Cc: the devicetree list
for review.

> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spi-dw.txt
> @@ -0,0 +1,24 @@
> +Synopsys DesignWare SPI master
> +
> +Required properties:
> +- compatible: should be "snps,designware-spi"
> +- #address-cells: see spi-bus.txt
> +- #size-cells: see spi-bus.txt
> +- reg: address and length of the spi master registers
> +- interrupts: should contain one interrupt
> +- clocks: spi clock phandle
> +- num-cs: see spi-bus.txt

You may want to check Mark Rutland's replies in the DT list
archives with his nits about speaking of phandles only where
specifiers are involved as well, and how he several times
suggested improved descriptions that you can adopt or copy.

Is 'num-cs' really required and not optional?  (It may be, I'm
just asking.  Given that there has not been a binding before,
there is no compatibility issue either.)

> +
> +Optional properties:
> +- cs-gpios: see spi-bus.txt
> +
> +Example:
> +
> +spi: spi@4020a000 {
> +	compatible = "snps,designware-spi";
> +	interrupts = <11 1>;
> +	reg = <0x4020a000 0x1000>;
> +	clocks = <&pclk>;
> +	num-cs = <2>;
> +	cs-gpios = <&banka 0 0>;
> +};


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office-ynQEQJNshbs@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 0/5] spi: dw: device tree and generic queue support
       [not found] ` <cover.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
                     ` (5 preceding siblings ...)
  2014-01-31 16:49   ` [PATCH v3 0/5] spi: dw: device tree and generic queue support Mark Brown
@ 2014-02-02 12:49   ` Gerhard Sittig
       [not found]     ` <20140202124941.GS20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
  6 siblings, 1 reply; 18+ messages in thread
From: Gerhard Sittig @ 2014-02-02 12:49 UTC (permalink / raw)
  To: Baruch Siach; +Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

On Fri, Jan 31, 2014 at 12:07 +0200, Baruch Siach wrote:
> 
> Unfortunately, I probably have no chance access to thest this series on
> hardware, I's only compile tested. So I'm sending this as RFC for code review.
> If this series doesn't get merged, it may be used at least as a starting point
> for someone with hardware access.

Which repo and branch is the code based on?  I can't apply it
here, neither to v3.13 nor torvald's master nor broonie's
topic/dw nor broonie's for-next.

BTW the "RFC" comment no longer is true after you dropped the RFC
tag in v3.


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office-ynQEQJNshbs@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 0/5] spi: dw: device tree and generic queue support
       [not found]     ` <20140202124941.GS20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
@ 2014-02-02 13:32       ` Baruch Siach
  2014-02-02 14:31         ` Gerhard Sittig
  0 siblings, 1 reply; 18+ messages in thread
From: Baruch Siach @ 2014-02-02 13:32 UTC (permalink / raw)
  To: Gerhard Sittig; +Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

Hi Gerhard,

On Sun, Feb 02, 2014 at 01:49:41PM +0100, Gerhard Sittig wrote:
> On Fri, Jan 31, 2014 at 12:07 +0200, Baruch Siach wrote:
> > Unfortunately, I probably have no chance access to thest this series on
> > hardware, I's only compile tested. So I'm sending this as RFC for code review.
> > If this series doesn't get merged, it may be used at least as a starting point
> > for someone with hardware access.
> 
> Which repo and branch is the code based on?  I can't apply it
> here, neither to v3.13 nor torvald's master nor broonie's
> topic/dw nor broonie's for-next.

This sereis is based on the topic/dw branch as of 6d3a38819. Mark has applied 
patch no. 5 from this series to topic/dw. Is this the cause of your problem?

> BTW the "RFC" comment no longer is true after you dropped the RFC
> tag in v3.

I should have kept the RFC tag.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org - tel: +972.2.679.5364, http://www.tkos.co.il -
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 0/5] spi: dw: device tree and generic queue support
  2014-02-02 13:32       ` Baruch Siach
@ 2014-02-02 14:31         ` Gerhard Sittig
       [not found]           ` <20140202143148.GT20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Gerhard Sittig @ 2014-02-02 14:31 UTC (permalink / raw)
  To: Baruch Siach; +Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

On Sun, Feb 02, 2014 at 15:32 +0200, Baruch Siach wrote:
> 
> Hi Gerhard,
> 
> On Sun, Feb 02, 2014 at 01:49:41PM +0100, Gerhard Sittig wrote:
> > On Fri, Jan 31, 2014 at 12:07 +0200, Baruch Siach wrote:
> > > Unfortunately, I probably have no chance access to thest this series on
> > > hardware, I's only compile tested. So I'm sending this as RFC for code review.
> > > If this series doesn't get merged, it may be used at least as a starting point
> > > for someone with hardware access.
> > 
> > Which repo and branch is the code based on?  I can't apply it
> > here, neither to v3.13 nor torvald's master nor broonie's
> > topic/dw nor broonie's for-next.
> 
> This sereis is based on the topic/dw branch as of 6d3a38819. Mark has applied 
> patch no. 5 from this series to topic/dw. Is this the cause of your problem?

I was looking into how I could test the GPIO based chip select
support.  Unfortunately I don't have much hardware around either,
it turned out that none of the available boards allow me to run
mainline kernels and access the signals or connect more slaves.
So I'm sorry but cannot help beyond review either. :(


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office-ynQEQJNshbs@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 0/5] spi: dw: device tree and generic queue support
       [not found]           ` <20140202143148.GT20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
@ 2014-02-02 15:24             ` Baruch Siach
  2014-02-05 16:49               ` Gerhard Sittig
  0 siblings, 1 reply; 18+ messages in thread
From: Baruch Siach @ 2014-02-02 15:24 UTC (permalink / raw)
  To: Gerhard Sittig; +Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

Hi Gerhard,

On Sun, Feb 02, 2014 at 03:31:48PM +0100, Gerhard Sittig wrote:
> On Sun, Feb 02, 2014 at 15:32 +0200, Baruch Siach wrote:
> > On Sun, Feb 02, 2014 at 01:49:41PM +0100, Gerhard Sittig wrote:
> > > On Fri, Jan 31, 2014 at 12:07 +0200, Baruch Siach wrote:
> > > > Unfortunately, I probably have no chance access to thest this series on
> > > > hardware, I's only compile tested. So I'm sending this as RFC for code review.
> > > > If this series doesn't get merged, it may be used at least as a starting point
> > > > for someone with hardware access.
> > > 
> > > Which repo and branch is the code based on?  I can't apply it
> > > here, neither to v3.13 nor torvald's master nor broonie's
> > > topic/dw nor broonie's for-next.
> > 
> > This sereis is based on the topic/dw branch as of 6d3a38819. Mark has applied 
> > patch no. 5 from this series to topic/dw. Is this the cause of your problem?
> 
> I was looking into how I could test the GPIO based chip select
> support.  Unfortunately I don't have much hardware around either,
> it turned out that none of the available boards allow me to run
> mainline kernels and access the signals or connect more slaves.
> So I'm sorry but cannot help beyond review either. :(

Just curious, what hardware do you have with DesignWare SPI master?

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org - tel: +972.2.679.5364, http://www.tkos.co.il -
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 2/5] spi: dw: document device tree binding
       [not found]         ` <20140202122320.GQ20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
@ 2014-02-03  5:30           ` Baruch Siach
  0 siblings, 0 replies; 18+ messages in thread
From: Baruch Siach @ 2014-02-03  5:30 UTC (permalink / raw)
  To: Gerhard Sittig; +Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

Hi Gerhard,

Thanks for reviewing.

On Sun, Feb 02, 2014 at 01:23:20PM +0100, Gerhard Sittig wrote:
> On Fri, Jan 31, 2014 at 12:07 +0200, Baruch Siach wrote:
> > 
> > Signed-off-by: Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
> > ---
> >  Documentation/devicetree/bindings/spi/spi-dw.txt | 24 ++++++++++++++++++++++++
> >  1 file changed, 24 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/spi/spi-dw.txt
> 
> You introduce a new binding, but don't Cc: the devicetree list
> for review.

I wanted to do that but forgot.

> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/spi-dw.txt
> > @@ -0,0 +1,24 @@
> > +Synopsys DesignWare SPI master
> > +
> > +Required properties:
> > +- compatible: should be "snps,designware-spi"
> > +- #address-cells: see spi-bus.txt
> > +- #size-cells: see spi-bus.txt
> > +- reg: address and length of the spi master registers
> > +- interrupts: should contain one interrupt
> > +- clocks: spi clock phandle
> > +- num-cs: see spi-bus.txt
> 
> You may want to check Mark Rutland's replies in the DT list
> archives with his nits about speaking of phandles only where
> specifiers are involved as well, and how he several times
> suggested improved descriptions that you can adopt or copy.

I've see one of these messages last week. I'll try to look them up and update 
the wording. If you have a pointer to a properly written in-tree 'clocks' 
description please let me know.

> Is 'num-cs' really required and not optional?  (It may be, I'm
> just asking.  Given that there has not been a binding before,
> there is no compatibility issue either.)

Yes. With this version of the series 'num-cs' is mandatory for the DT case. In 
the non-DT case the deriver defaults to 4 as before.

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org - tel: +972.2.679.5364, http://www.tkos.co.il -
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 0/5] spi: dw: device tree and generic queue support
  2014-02-02 15:24             ` Baruch Siach
@ 2014-02-05 16:49               ` Gerhard Sittig
       [not found]                 ` <20140205164908.GF20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Gerhard Sittig @ 2014-02-05 16:49 UTC (permalink / raw)
  To: Baruch Siach; +Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

On Sun, Feb 02, 2014 at 17:24 +0200, Baruch Siach wrote:
> 
> Just curious, what hardware do you have with DesignWare SPI master?

Altera "socfpga" chips include two of these.  I have asked
posters who report SPI related problems on the rocketboards.org
"rfi" mailing list to see if they can help you test your changes.


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office-ynQEQJNshbs@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 0/5] spi: dw: device tree and generic queue support
       [not found]                 ` <20140205164908.GF20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
@ 2014-04-14 21:05                   ` Mark Brown
       [not found]                     ` <20140414210547.GK25182-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Mark Brown @ 2014-04-14 21:05 UTC (permalink / raw)
  To: Gerhard Sittig; +Cc: Baruch Siach, linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

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

On Wed, Feb 05, 2014 at 05:49:08PM +0100, Gerhard Sittig wrote:
> On Sun, Feb 02, 2014 at 17:24 +0200, Baruch Siach wrote:

> > Just curious, what hardware do you have with DesignWare SPI master?

> Altera "socfpga" chips include two of these.  I have asked
> posters who report SPI related problems on the rocketboards.org
> "rfi" mailing list to see if they can help you test your changes.

Did you ever hear anything back?  I'm inclined to just apply these and
see if anyone reports any issues.

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

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

* Re: [PATCH v3 0/5] spi: dw: device tree and generic queue support
       [not found]                     ` <20140414210547.GK25182-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
@ 2014-04-16 18:41                       ` Gerhard Sittig
       [not found]                         ` <20140416184159.GH3528-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
  0 siblings, 1 reply; 18+ messages in thread
From: Gerhard Sittig @ 2014-04-16 18:41 UTC (permalink / raw)
  To: Mark Brown; +Cc: Baruch Siach, linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

On Mon, 2014-04-14 at 22:05 +0100, Mark Brown wrote:
> 
> On Wed, Feb 05, 2014 at 05:49:08PM +0100, Gerhard Sittig wrote:
> > On Sun, Feb 02, 2014 at 17:24 +0200, Baruch Siach wrote:
> 
> > > Just curious, what hardware do you have with DesignWare SPI master?
> 
> > Altera "socfpga" chips include two of these.  I have asked
> > posters who report SPI related problems on the rocketboards.org
> > "rfi" mailing list to see if they can help you test your changes.
> 
> Did you ever hear anything back?  I'm inclined to just apply these and
> see if anyone reports any issues.

no, haven't heard anything since then


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office-ynQEQJNshbs@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 0/5] spi: dw: device tree and generic queue support
       [not found]                         ` <20140416184159.GH3528-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
@ 2014-04-24 16:40                           ` Mark Brown
  0 siblings, 0 replies; 18+ messages in thread
From: Mark Brown @ 2014-04-24 16:40 UTC (permalink / raw)
  To: Gerhard Sittig; +Cc: Baruch Siach, linux-spi-u79uwXL29TY76Z2rM5mHXA, Feng Tang

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

On Wed, Apr 16, 2014 at 08:41:59PM +0200, Gerhard Sittig wrote:
> On Mon, 2014-04-14 at 22:05 +0100, Mark Brown wrote:

> > Did you ever hear anything back?  I'm inclined to just apply these and
> > see if anyone reports any issues.

> no, haven't heard anything since then

OK.  That's a shame, I think I'm just going to drop them into -next and
hope someone notices if there are any problems.  Not ideal but they're
nice changes to have.

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

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

end of thread, other threads:[~2014-04-24 16:40 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-31 10:07 [PATCH v3 0/5] spi: dw: device tree and generic queue support Baruch Siach
     [not found] ` <cover.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2014-01-31 10:07   ` [PATCH v3 1/5] spi: dw: migrate to generic queue infrastructure Baruch Siach
2014-01-31 10:07   ` [PATCH v3 2/5] spi: dw: document device tree binding Baruch Siach
     [not found]     ` <a978b266a9b8827747054a689e014ca9efbec235.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2014-02-02 12:23       ` Gerhard Sittig
     [not found]         ` <20140202122320.GQ20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
2014-02-03  5:30           ` Baruch Siach
2014-01-31 10:07   ` [PATCH v3 3/5] spi: dw-mmio: add device tree support Baruch Siach
2014-01-31 10:07   ` [PATCH v3 4/5] spi: dw: add support for gpio controlled chip select Baruch Siach
2014-01-31 10:07   ` [PATCH v3 5/5] spi: dw-mmio: remove HAVE_CLK build dependecy Baruch Siach
     [not found]     ` <207f4522cbabac73422b54006ead761f25380013.1391162172.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2014-01-31 16:46       ` Mark Brown
2014-01-31 16:49   ` [PATCH v3 0/5] spi: dw: device tree and generic queue support Mark Brown
2014-02-02 12:49   ` Gerhard Sittig
     [not found]     ` <20140202124941.GS20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
2014-02-02 13:32       ` Baruch Siach
2014-02-02 14:31         ` Gerhard Sittig
     [not found]           ` <20140202143148.GT20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
2014-02-02 15:24             ` Baruch Siach
2014-02-05 16:49               ` Gerhard Sittig
     [not found]                 ` <20140205164908.GF20094-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
2014-04-14 21:05                   ` Mark Brown
     [not found]                     ` <20140414210547.GK25182-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-04-16 18:41                       ` Gerhard Sittig
     [not found]                         ` <20140416184159.GH3528-kDjWylLy9wD0K7fsECOQyeGNnDKD8DIp@public.gmane.org>
2014-04-24 16:40                           ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.