spi/pl022: add devicetree support
Subsystems (3)
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
Changes since v3:
* Proper use of IS_ENABLED
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
Thanks Thierry Reding for reviewing and improvements suggestions
.../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
@@ -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