MIPS: Loongson: Add Loongson-3A/3B GPIO support
PATCH v3 2/5 MIPS: Loongson: Add Loongson-3A/3B GPIO support
Improve Loongson-2's GPIO driver to support Loongson-3A/3B, and move it to drivers/gpio directory.
--- arch/mips/Kconfig | 1 + arch/mips/configs/lemote2f_defconfig | 1 + arch/mips/configs/loongson3_defconfig | 1 + arch/mips/loongson/common/Makefile | 1 - arch/mips/loongson/common/gpio.c | 139 ------------------------------- drivers/gpio/Kconfig | 6 ++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-loongson.c | 148 +++++++++++++++++++++++++++++++++ 8 files changed, 158 insertions(+), 140 deletions(-) delete mode 100644 arch/mips/loongson/common/gpio.c create mode 100644 drivers/gpio/gpio-loongson.c
arch/mips/Kconfig +1 -0
@@ -1199,6 +1199,7 @@ config CPU_LOONGSON3 select CPU_SUPPORTS_HUGEPAGES select WEAK_ORDERING select WEAK_REORDERING_BEYOND_LLSC + select ARCH_REQUIRE_GPIOLIB help The Loongson 3 processor implements the MIPS64R2 instruction set with many extensions.
arch/mips/configs/lemote2f_defconfig +1 -0
@@ -172,6 +172,7 @@ CONFIG_SERIAL_8250_FOURPORT=y CONFIG_LEGACY_PTY_COUNT=16 CONFIG_HW_RANDOM=y CONFIG_RTC=y +CONFIG_GPIO_LOONGSON=y CONFIG_THERMAL=y CONFIG_MEDIA_SUPPORT=m CONFIG_VIDEO_DEV=m
arch/mips/configs/loongson3_defconfig +1 -0
@@ -243,6 +243,7 @@ CONFIG_HW_RANDOM=y CONFIG_RAW_DRIVER=m CONFIG_I2C_CHARDEV=y CONFIG_I2C_PIIX4=y +CONFIG_GPIO_LOONGSON=y CONFIG_SENSORS_LM75=m CONFIG_SENSORS_LM93=m CONFIG_SENSORS_W83627HF=m
arch/mips/loongson/common/Makefile +0 -1
@@ -4,7 +4,6 @@ obj-y += setup.o init.o cmdline.o env.o time.o reset.o irq.o \ bonito-irq.o mem.o machtype.o platform.o -obj-$(CONFIG_GPIOLIB) += gpio.o obj-$(CONFIG_PCI) += pci.o #
arch/mips/loongson/common/gpio.c deleted +0 -139
139 lines not on this page · raw message
drivers/gpio/Kconfig +6 -0
@@ -452,6 +452,12 @@ config GPIO_GRGPIO Select this to support Aeroflex Gaisler GRGPIO cores from the GRLIB VHDL IP core library. +config GPIO_LOONGSON + tristate "Loongson-2/3 GPIO support" + depends on CPU_LOONGSON2 || CPU_LOONGSON3 + help + driver for GPIO functionality on Loongson-2F/3A/3B processors. + config GPIO_TB10X bool select GENERIC_IRQ_CHIP
drivers/gpio/Makefile +1 -0
@@ -39,6 +39,7 @@ obj-$(CONFIG_GPIO_JANZ_TTL) += gpio-janz-ttl.o obj-$(CONFIG_GPIO_KEMPLD) += gpio-kempld.o obj-$(CONFIG_ARCH_KS8695) += gpio-ks8695.o obj-$(CONFIG_GPIO_INTEL_MID) += gpio-intel-mid.o +obj-$(CONFIG_GPIO_LOONGSON) += gpio-loongson.o obj-$(CONFIG_GPIO_LP3943) += gpio-lp3943.o obj-$(CONFIG_ARCH_LPC32XX) += gpio-lpc32xx.o obj-$(CONFIG_GPIO_LYNXPOINT) += gpio-lynxpoint.o
drivers/gpio/gpio-loongson.c new file +148 -0
148 lines not on this page · raw message
Signature · 1 line
1.7.7.3
Quoted 2 lines · Huacai Chen
Improve Loongson-2's GPIO driver to support Loongson-3A/3B, and move it to
drivers/gpiodirectory.
Could you split this in two patches:
1/2: move GPIO driver to drivers/gpio
2/2: support new devices in GPIO driver
and add the "-C" option to git format-patch so that file renaming gets detected. This will make the changes easier to evaluate.
Thanks,
Alex.
OK, I'll split.
Huacai
Quoted 14 lines · Alexandre Courbot
Quoted 2 lines · Huacai Chen
Improve Loongson-2's GPIO driver to support Loongson-3A/3B, and move it to
drivers/gpiodirectory.Could you split this in two patches:
1/2: move GPIO driver todrivers/gpio
2/2: support new devices in GPIO driverand add the "-C" option to git format-patch so that file renaming gets detected. This will make the changes easier to evaluate.
Thanks,
Alex.