Skip to contentSkip to conversation

gpio: mt7621: add OF_GPIO dependency

PATCH In review Arnd Bergmann 3 participants 4 messages Jul 10, 2018 – Jul 13, 2018

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

PATCH 1/2 gpio: mt7621: add OF_GPIO dependency

Compile-testing the driver fails unless OF_GPIO is enabled:

drivers/gpio/gpio-mt7621.c: In function 'mediatek_gpio_bank_probe':
drivers/gpio/gpio-mt7621.c:228:10: error: 'struct gpio_chip' has no member named 'of_node'

Fixes 4ba9c3afda41 ("gpio: mt7621: Add a driver for MT7621")
---
 drivers/gpio/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/Kconfig +1 -0
index 836aa2173e44..7429b30e61b0 100644
@@ -362,6 +362,7 @@ config GPIO_MPC8XXX
 config GPIO_MT7621
 	bool "Mediatek MT7621 GPIO Support"
 	depends on SOC_MT7620 || SOC_MT7621 || COMPILE_TEST
+	depends on OF_GPIO
 	select GPIO_GENERIC
 	select GPIOLIB_IRQCHIP
 	help
Signature · 1 line
2.9.0
#1 lore raw

PATCH 2/2 staging: mt7621-gpio: remove driver

The gpio-mt7621 driver has graduated out of staging and got accepted into the gpio tree. Since they both use the same Kconfig symbol, we could run into conflicts, e.g. I got this failure when the staging driver got enabled with the other one being unavailable but using the same Kconfig symbol:

drivers/gpio/gpio-mt7621.c: In function 'mediatek_gpio_bank_probe':
drivers/gpio/gpio-mt7621.c:228:10: error: 'struct gpio_chip' has no member named 'of_node'

  rg->chip.of_node = node;
          ^
drivers/gpio/gpio-mt7621.c:243:10: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
  rg->chip.of_gpio_n_cells = 2;
          ^

drivers/gpio/gpio-mt7621.c:244:10: error: 'struct gpio_chip' has no member named 'of_xlate'
rg->chip.of_xlate = mediatek_gpio_xlate;

It would be trivial to rename the Kconfig symbol to avoid that problem, but there is also seems to be little value in keeping the staging driver around now.

Fixes 4ba9c3afda41 ("gpio: mt7621: Add a driver for MT7621")
---
 drivers/staging/Kconfig                            |   2 -
 drivers/staging/Makefile                           |   1 -
 drivers/staging/mt7621-gpio/Kconfig                |   8 -
 drivers/staging/mt7621-gpio/Makefile               |   3 -
 drivers/staging/mt7621-gpio/TODO                   |   3 -
 drivers/staging/mt7621-gpio/gpio-mt7621.c          | 331 ---------------------
 .../staging/mt7621-gpio/mediatek,mt7621-gpio.txt   |  35 ---
 7 files changed, 383 deletions(-)
 delete mode 100644 drivers/staging/mt7621-gpio/Kconfig
 delete mode 100644 drivers/staging/mt7621-gpio/Makefile
 delete mode 100644 drivers/staging/mt7621-gpio/TODO
 delete mode 100644 drivers/staging/mt7621-gpio/gpio-mt7621.c
 delete mode 100644 drivers/staging/mt7621-gpio/mediatek,mt7621-gpio.txt
drivers/staging/Kconfig +0 -2
index 9339af2fb51e..bbb0232c7f8e 100644
@@ -110,8 +110,6 @@ source "drivers/staging/pi433/Kconfig"
 
 source "drivers/staging/mt7621-pinctrl/Kconfig"
 
-source "drivers/staging/mt7621-gpio/Kconfig"
-
 source "drivers/staging/mt7621-spi/Kconfig"
 
 source "drivers/staging/mt7621-dma/Kconfig"
drivers/staging/Makefile +0 -1
index aa40b1f4cea4..9b381e037e54 100644
@@ -46,7 +46,6 @@ obj-$(CONFIG_DRM_VBOXVIDEO)	+= vboxvideo/
 obj-$(CONFIG_PI433)		+= pi433/
 obj-$(CONFIG_SOC_MT7621)	+= mt7621-pci/
 obj-$(CONFIG_SOC_MT7621)	+= mt7621-pinctrl/
-obj-$(CONFIG_SOC_MT7621)	+= mt7621-gpio/
 obj-$(CONFIG_SOC_MT7621)	+= mt7621-spi/
 obj-$(CONFIG_SOC_MT7621)	+= mt7621-dma/
 obj-$(CONFIG_SOC_MT7621)	+= mt7621-mmc/
drivers/staging/mt7621-gpio/Kconfig deleted +0 -8
deleted file mode 100644
index 5485dd2d9b61..000000000000
@@ -1,8 +0,0 @@
-config GPIO_MT7621
-	bool "Mediatek MT7621 GPIO Support"
-	depends on SOC_MT7620 || SOC_MT7621 || COMPILE_TEST
-	select GPIO_GENERIC
-	select GPIOLIB_IRQCHIP
-	select ARCH_REQUIRE_GPIOLIB
-	help
-	  Say yes here to support the Mediatek MT7621 SoC GPIO device
drivers/staging/mt7621-gpio/Makefile deleted +0 -3
deleted file mode 100644
index e269ab1b8717..000000000000
@@ -1,3 +0,0 @@
-obj-$(CONFIG_GPIO_MT7621)	+= gpio-mt7621.o
-
-ccflags-y += -I$(srctree)/$(src)/include
drivers/staging/mt7621-gpio/TODO deleted +0 -3
deleted file mode 100644
index 674930a10716..000000000000
@@ -1,3 +0,0 @@
-- general code review and clean up
-
-Cc:  NeilBrown <[email protected]>
drivers/staging/mt7621-gpio/gpio-mt7621.c deleted +0 -331

331 lines not on this page · raw message

drivers/staging/mt7621-gpio/mediatek,mt7621-gpio.txt deleted +0 -35
deleted file mode 100644
index ba455589f869..000000000000
@@ -1,35 +0,0 @@
-Mediatek MT7621 SoC GPIO controller bindings
-
-The IP core used inside these SoCs has 3 banks of 32 GPIOs each.
-The registers of all the banks are interwoven inside one single IO range.
-We load one GPIO controller instance per bank. Also the GPIO controller can receive
-interrupts on any of the GPIOs, either edge or level. It then interrupts the CPU
-using GIC INT12.
-
-Required properties for the top level node:
-- #gpio-cells : Should be two. The first cell is the GPIO pin number and the
-   second cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>.
-   Only the GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
-- #interrupt-cells : Specifies the number of cells needed to encode an
-   interrupt. Should be 2. The first cell defines the interrupt number,
-   the second encodes the triger flags encoded as described in
-   Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
-- compatible:
-  - "mediatek,mt7621-gpio" for Mediatek controllers
-- reg : Physical base address and length of the controller's registers
-- interrupt-parent : phandle of the parent interrupt controller.
-- interrupts : Interrupt specifier for the controllers interrupt.
-- interrupt-controller : Mark the device node as an interrupt controller.
-- gpio-controller : Marks the device node as a GPIO controller.
-
-Example:
-	gpio at 600 {
-		#gpio-cells = <2>;
-		#interrupt-cells = <2>;
-		compatible = "mediatek,mt7621-gpio";
-		gpio-controller;
-		interrupt-controller;
-		reg = <0x600 0x100>;
-		interrupt-parent = <&gic>;
-		interrupts = <GIC_SHARED 12 IRQ_TYPE_LEVEL_HIGH>;
-	};
Signature · 1 line
2.9.0
#2 lore raw

Re: [PATCH 2/2] staging: mt7621-gpio: remove driver

Quoted 16 lines · Arnd Bergmann

The gpio-mt7621 driver has graduated out of staging and got accepted into the gpio tree. Since they both use the same Kconfig symbol, we could run into conflicts, e.g. I got this failure when the staging driver got enabled with the other one being unavailable but using the same Kconfig symbol:

drivers/gpio/gpio-mt7621.c: In function 'mediatek_gpio_bank_probe':
drivers/gpio/gpio-mt7621.c:228:10: error: 'struct gpio_chip' has no member named 'of_node'

  rg->chip.of_node = node;
          ^
drivers/gpio/gpio-mt7621.c:243:10: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
  rg->chip.of_gpio_n_cells = 2;
          ^

drivers/gpio/gpio-mt7621.c:244:10: error: 'struct gpio_chip' has no member named 'of_xlate'
rg->chip.of_xlate = mediatek_gpio_xlate;

Quoted 6 lines

It would be trivial to rename the Kconfig symbol to avoid that problem, but there is also seems to be little value in keeping the staging driver around now.

Fixes 4ba9c3afda41 ("gpio: mt7621: Add a driver for MT7621")

This is already removed in my staging-next tree and will be in the next linux-next.

thanks,

greg k-h

#3 lore raw
In reply to Arnd Bergmann
Quoted 7 lines · Arnd Bergmann

Compile-testing the driver fails unless OF_GPIO is enabled:

drivers/gpio/gpio-mt7621.c: In function 'mediatek_gpio_bank_probe':
drivers/gpio/gpio-mt7621.c:228:10: error: 'struct gpio_chip' has no member named 'of_node'

Fixes 4ba9c3afda41 ("gpio: mt7621: Add a driver for MT7621")

Patch applied. Sorry for taking some days.

Yours,
Linus Walleij