Skip to contentSkip to conversation

spi/pl022: add devicetree support

PATCH Superseded Alexandre Pereira da Silva 1 participant 1 message Jul 9, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 spi/pl022: add devicetree support

Add the chipselect array and cur_cs properties to pl022 main structure

Add a wrapper function to decide if the cs should be controlled by the cs_control callback or the chipselect gpio

Populate chipselect property from cs-gpios

Populate master->dev.of_node, so the spi bus can find child spi devices and register them

At pl022 setup, fill chip_data structure from dt nodes, if not provided by platform.

---
Applies to v3.5-rc6

Changes since v3:
* use if (IS_ENABLED(CONFIG_OF)) instead of preprocessor #ifdef so we have better code build coverage

Changes since v2:
* Use IS_ENABLED instead of #ifdef
* Remove bogus const change

Changes since v1:
return EPROBE_DEFFER if gpios are not initialized yet

 .../devicetree/bindings/spi/spi_pl022.txt          |   15 +++
 drivers/spi/spi-pl022.c                            |  114 ++++++++++++++++----
 2 files changed, 110 insertions(+), 19 deletions(-)
Documentation/devicetree/bindings/spi/spi_pl022.txt +15 -0
index 306ec3f..b089ec7 100644
@@ -6,7 +6,22 @@ Required properties:
 - interrupts : Should contain SPI controller interrupt
 
 Optional properties:
+- pl022,num-chipselects : total number of chipselects
 - cs-gpios : should specify GPIOs used for chipselects.
   The gpios will be referred to as reg = <index> in the SPI child nodes.
   If unspecified, a single SPI device without a chip select can be used.
 
+SPI slave nodes must be children of the SPI master node and can
+contain the following properties.
+See include/linux/amba/pl022.h for more details
+
+- pl022,hierarchy : master or slave interface
+- pl022,interface : interface type
+- pl022,slave-tx-disable : disconnect tx line in slave mode
+- pl022,com-mode : polling, interrupt or dma
+- pl022,rx-level-trig : Rx FIFO watermark level
+- pl022,tx-level-trig : Tx FIFO watermark level
+- pl022,ctrl-len : Microwire interface: Control length
+- pl022,wait-state : Microwire interface: Wait state
+- pl022,duplex : Microwire interface: Full/Half duplex
+
drivers/spi/spi-pl022.c +95 -19

239 lines not on this page · raw message

Signature · 1 line
1.7.10