Skip to contentSkip to conversation

spi: mt7621: Move SPI driver out of staging

PATCH New Stefan Roese 1 participant 1 message Mar 25, 2019

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

PATCH v2 1/1 spi: mt7621: Move SPI driver out of staging

This patch moves the MT7621 SPI driver, which is used on some Ralink / MediaTek MT76xx MIPS SoC's, out of the staging directory. No changes to the source code are done in this patch.

This driver version was tested successfully on an MT7688 based platform with an SPI NOR on CS0 and an SPI NAND on CS1 without any issues (so far).

This patch also documents the devicetree bindings for the MT7621 SPI device driver.

Cc Rob Herring <[email protected]>
Cc Mark Brown <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc NeilBrown <[email protected]>
Cc Sankalp Negi <[email protected]>
Cc Chuanhong Guo <[email protected]>
Cc John Crispin <[email protected]>
Cc Armando Miraglia <[email protected]>

---
v2:
- Add COMPILE_TEST in Kconfig entry
- Header comment style changed to C++ style
- Removed mt7621_spi_reset() as its name was misleading. Its content is now inlined in mt7621_spi_set_cs() and the superfluous call from mt7621_spi_probe() is removed
- Set SPI_CONTROLLER_HALF_DUPLEX in flags
- Use clk_disable_unprepare() instead of clk_disable()
- Use devm_spi_register_controller() instead of spi_register_master() (spi_unregister_master() removed)
- General move to xxx_controller() API from the deprecated xxx_master() API
- Minor cosmetic coding style changes (add empty lines, fix comment style)

 .../devicetree/bindings/spi/spi-mt7621.txt    |  26 ++
 drivers/spi/Kconfig                           |   6 +
 drivers/spi/Makefile                          |   1 +
 drivers/spi/spi-mt7621.c                      | 421 +++++++++++++++++
 drivers/staging/Kconfig                       |   2 -
 drivers/staging/Makefile                      |   1 -
 drivers/staging/mt7621-spi/Kconfig            |   6 -
 drivers/staging/mt7621-spi/Makefile           |   1 -
 drivers/staging/mt7621-spi/TODO               |   5 -
 drivers/staging/mt7621-spi/spi-mt7621.c       | 422 ------------------
 10 files changed, 454 insertions(+), 437 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/spi-mt7621.txt
 create mode 100644 drivers/spi/spi-mt7621.c
 delete mode 100644 drivers/staging/mt7621-spi/Kconfig
 delete mode 100644 drivers/staging/mt7621-spi/Makefile
 delete mode 100644 drivers/staging/mt7621-spi/TODO
 delete mode 100644 drivers/staging/mt7621-spi/spi-mt7621.c
Documentation/devicetree/bindings/spi/spi-mt7621.txt new file +26 -0
new file mode 100644
index 000000000000..d5baec0fa56e
@@ -0,0 +1,26 @@
+Binding for MTK SPI controller (MT7621 MIPS)
+
+Required properties:
+- compatible: Should be one of the following:
+  - "ralink,mt7621-spi": for mt7621/mt7628/mt7688 platforms
+- #address-cells: should be 1.
+- #size-cells: should be 0.
+- reg: Address and length of the register set for the device
+- resets: phandle to the reset controller asserting this device in
+          reset
+  See ../reset/reset.txt for details.
+
+Optional properties:
+- cs-gpios: see spi-bus.txt.
+
+Example:
+
+- SoC Specific Portion:
+spi0: spi@b00 {
+	compatible = "ralink,mt7621-spi";
+	reg = <0xb00 0x100>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	resets = <&rstctrl 18>;
+	reset-names = "spi";
+};
drivers/spi/Kconfig +6 -0
index f761655e2a36..8ce4f7df0ef2 100644
@@ -426,6 +426,12 @@ config SPI_MT65XX
 	  say Y or M here.If you are not sure, say N.
 	  SPI drivers for Mediatek MT65XX and MT81XX series ARM SoCs.
 
+config SPI_MT7621
+	tristate "MediaTek MT7621 SPI Controller"
+	depends on RALINK || COMPILE_TEST
+	help
+	  This selects a driver for the MediaTek MT7621 SPI Controller.
+
 config SPI_NPCM_PSPI
 	tristate "Nuvoton NPCM PSPI Controller"
 	depends on ARCH_NPCM || COMPILE_TEST
drivers/spi/Makefile +1 -0
index d8fc03c9faa2..369f29a8a6af 100644
@@ -60,6 +60,7 @@ obj-$(CONFIG_SPI_MPC512x_PSC)		+= spi-mpc512x-psc.o
 obj-$(CONFIG_SPI_MPC52xx_PSC)		+= spi-mpc52xx-psc.o
 obj-$(CONFIG_SPI_MPC52xx)		+= spi-mpc52xx.o
 obj-$(CONFIG_SPI_MT65XX)                += spi-mt65xx.o
+obj-$(CONFIG_SPI_MT7621)		+= spi-mt7621.o
 obj-$(CONFIG_SPI_MXIC)			+= spi-mxic.o
 obj-$(CONFIG_SPI_MXS)			+= spi-mxs.o
 obj-$(CONFIG_SPI_NPCM_PSPI)		+= spi-npcm-pspi.o
drivers/spi/spi-mt7621.c new file +421 -0

421 lines not on this page · raw message

drivers/staging/Kconfig +0 -2
index c0901b96cfe4..3241bd50d139 100644
@@ -106,8 +106,6 @@ source "drivers/staging/mt7621-pci-phy/Kconfig"
 
 source "drivers/staging/mt7621-pinctrl/Kconfig"
 
-source "drivers/staging/mt7621-spi/Kconfig"
-
 source "drivers/staging/mt7621-dma/Kconfig"
 
 source "drivers/staging/ralink-gdma/Kconfig"
drivers/staging/Makefile +0 -1
index 57c6bce13ff4..296ff11ecfae 100644
@@ -43,7 +43,6 @@ obj-$(CONFIG_PI433)		+= pi433/
 obj-$(CONFIG_PCI_MT7621)	+= mt7621-pci/
 obj-$(CONFIG_PCI_MT7621_PHY)	+= mt7621-pci-phy/
 obj-$(CONFIG_PINCTRL_RT2880)	+= mt7621-pinctrl/
-obj-$(CONFIG_SPI_MT7621)	+= mt7621-spi/
 obj-$(CONFIG_SOC_MT7621)	+= mt7621-dma/
 obj-$(CONFIG_DMA_RALINK)	+= ralink-gdma/
 obj-$(CONFIG_MTK_MMC)		+= mt7621-mmc/
drivers/staging/mt7621-spi/Kconfig deleted +0 -6
deleted file mode 100644
index 0b90f4cfa426..000000000000
@@ -1,6 +0,0 @@
-config SPI_MT7621
-	tristate "MediaTek MT7621 SPI Controller"
-	depends on RALINK
-	help
-	  This selects a driver for the MediaTek MT7621 SPI Controller.
-
drivers/staging/mt7621-spi/Makefile deleted +0 -1
deleted file mode 100644
index 3be508f63bac..000000000000
@@ -1 +0,0 @@
-obj-$(CONFIG_SPI_MT7621)		+= spi-mt7621.o
drivers/staging/mt7621-spi/TODO deleted +0 -5
deleted file mode 100644
index fdbc5002c32a..000000000000
@@ -1,5 +0,0 @@
-
-- general code review and clean up
-- ensure device-tree requirements are documented
-
-Cc: NeilBrown <[email protected]>
drivers/staging/mt7621-spi/spi-mt7621.c deleted +0 -422

422 lines not on this page · raw message

Signature · 1 line
2.21.0