Add Nuvoton NPCM SGPIO feature
Subsystems (3)
Tomer Maimon
maintainercover Add Nuvoton NPCM SGPIO feature
This SGPIO controller is for NUVOTON NPCM7xx and NPCM8xx SoC.
This patch set is on upstream process.
The NPCM SGPIO driver tested on NPCM750 EVB.
Tomer Maimon (2):
dt-bindings: gpio: add NPCM sgpio driver bindings
gpio: nuvoton: Add Nuvoton NPCM sgpio driver
.../bindings/gpio/nuvoton,sgpio.yaml | 78 +++ drivers/gpio/Kconfig | 8 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-npcm-sgpio.c | 641 ++++++++++++++++++ 4 files changed, 728 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/nuvoton,sgpio.yaml create mode 100644 drivers/gpio/gpio-npcm-sgpio.c
Signature · 1 line
2.33.0
Tomer Maimon
maintainerPATCH 1/2 dt-bindings: gpio: add NPCM sgpio driver bindings
Add dt-bindings document for the Nuvoton NPCM7xx sgpio driver
Signed-off-by Jim Liu <[email protected]>
Signed-off-by Tomer Maimon <[email protected]>
--- .../bindings/gpio/nuvoton,sgpio.yaml | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/nuvoton,sgpio.yaml
Documentation/devicetree/bindings/gpio/nuvoton,sgpio.yaml new file +78 -0
@@ -0,0 +1,78 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/nuvoton,sgpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Nuvoton SGPIO controller + +maintainers: + - Jim LIU <[email protected]> + +description: + This SGPIO controller is for NUVOTON NPCM7xx and NPCM8xx SoC, + NPCM7xx/NPCM8xx have two sgpio module each module can support up + to 64 output pins,and up to 64 input pin. + GPIO pins can be programmed to support the following options + - Support interrupt option for each input port and various interrupt + sensitivity option (level-high, level-low, edge-high, edge-low) + - Directly connected to APB bus and its shift clock is from APB bus clock + divided by a programmable value. + - ngpios is number of nin_gpios GPIO lines and nout_gpios GPIO lines. + +properties: + compatible: + enum: + - nuvoton,npcm750-sgpio + - nuvoton,npcm845-sgpio + + reg: + maxItems: 1 + + gpio-controller: true + + '#gpio-cells': + const: 2 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + nin_gpios: true + + nout_gpios: true + + bus-frequency: true + +required: + - compatible + - reg + - gpio-controller + - '#gpio-cells' + - interrupts + - nin_gpios + - nout_gpios + - clocks + - bus-frequency + +additionalProperties: false + +examples: + - | + #include <dt-bindings/clock/nuvoton,npcm7xx-clock.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + sgpio1: sgpio@101000 { + compatible = "nuvoton,npcm750-sgpio"; + gpio-controller; + #gpio-cells = <2>; + interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>; + reg = <0x101000 0x200>; + clocks = <&clk NPCM7XX_CLK_APB3>; + pinctrl-names = "default"; + pinctrl-0 = <&iox1_pins>; + nin_gpios = <64>; + nout_gpios = <64>; + bus-frequency = <16000000>; + };
Signature · 1 line
2.33.0
Tomer Maimon
maintainerPATCH 2/2 gpio: nuvoton: Add Nuvoton NPCM sgpio driver
In reply to Tomer MaimonAdd Nuvoton BMC NPCM7xx/NPCM8xx sgpio driver support.
Signed-off-by Jim Liu <[email protected]>
Signed-off-by Tomer Maimon <[email protected]>
--- drivers/gpio/Kconfig | 8 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-npcm-sgpio.c | 641 +++++++++++++++++++++++++++++++++ 3 files changed, 650 insertions(+) create mode 100644 drivers/gpio/gpio-npcm-sgpio.c
drivers/gpio/Kconfig +8 -0
@@ -1676,6 +1676,14 @@ config GPIO_SODAVILLE endmenu +config GPIO_NPCM_SGPIO + bool "Nuvoton SGPIO support" + depends on (ARCH_NPCM || COMPILE_TEST) && OF_GPIO + select GPIO_GENERIC + select GPIOLIB_IRQCHIP + help + Say Y here to support Nuvoton NPCM7XX/NPCM8XX SGPIO functionality. + menu "SPI GPIO expanders" depends on SPI_MASTER
drivers/gpio/Makefile +1 -0
@@ -115,6 +115,7 @@ obj-$(CONFIG_GPIO_MT7621) += gpio-mt7621.o obj-$(CONFIG_GPIO_MVEBU) += gpio-mvebu.o obj-$(CONFIG_GPIO_MXC) += gpio-mxc.o obj-$(CONFIG_GPIO_MXS) += gpio-mxs.o +obj-$(CONFIG_GPIO_NPCM_SGPIO) += gpio-npcm-sgpio.o obj-$(CONFIG_GPIO_OCTEON) += gpio-octeon.o obj-$(CONFIG_GPIO_OMAP) += gpio-omap.o obj-$(CONFIG_GPIO_PALMAS) += gpio-palmas.o
drivers/gpio/gpio-npcm-sgpio.c new file +641 -0
641 lines not on this page · raw message
Signature · 1 line
2.33.0