Skip to content

Commit

Permalink
gpio: Add Aspeed AST2400 driver
Browse files Browse the repository at this point in the history
 - Expose entire bank as one gpio chip
 - Implement interrupts for GPIO banks. We have a set of interrupt
   registers in each bank; this change adds a gpio irqchip to hook them
   up to the GPIO code.
 - Don't set names for aspeed GPIOs. We need the numbers for exporting anyway.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
  • Loading branch information
shenki committed Mar 21, 2016
1 parent 5e52a9a commit 44066f8
Show file tree
Hide file tree
Showing 7 changed files with 482 additions and 1 deletion.
16 changes: 16 additions & 0 deletions arch/arm/boot/dts/aspeed-bmc-opp-barreleye.dts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/dts-v1/;

#include "ast2400.dtsi"
#include <dt-bindings/gpio/gpio.h>

/ {
model = "Barrelye BMC";
Expand Down Expand Up @@ -48,5 +49,20 @@
};
};
};


leds {
compatible = "gpio-leds";

heartbeat {
gpios = <&gpio 140 GPIO_ACTIVE_HIGH>;
};
identify {
gpios = <&gpio 58 GPIO_ACTIVE_LOW>;
};
beep {
gpios = <&gpio 111 GPIO_ACTIVE_HIGH>;
};
};
};

18 changes: 18 additions & 0 deletions arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/dts-v1/;

#include "ast2400.dtsi"
#include <dt-bindings/gpio/gpio.h>

/ {
model = "Palmetto BMC";
Expand Down Expand Up @@ -31,4 +32,21 @@
};
};
};

leds {
compatible = "gpio-leds";

heartbeat {
gpios = <&gpio 140 GPIO_ACTIVE_LOW>;
};

power {
gpios = <&gpio 141 GPIO_ACTIVE_LOW>;
};

identify {
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
};

};
};
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/ast2400.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,8 @@
};

gpio: gpio@1e780000 {
#gpio-cells = <2>;
gpio-controller;
compatible = "aspeed,ast2400-gpio";
reg = <0x1e780000 0x1000>;
interrupts = <20>;
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-aspeed/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ config MACH_OPP_PALMETTO_BMC
bool "OpenPower Palmetto"
depends on ARCH_ASPEED
select RTC_DRV_ASPEED
select ASPEED_GPIO
select GPIO_SYSFS
help
Say Y here if you intend to run this kernel on the BMC
of an OpenPower "Palmetto" eval board
Expand Down
8 changes: 7 additions & 1 deletion drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ config GPIO_AMDPT
driver for GPIO functionality on Promontory IOHub
Require ACPI ASL code to enumerate as a platform device.

config GPIO_ASPEED
bool "Aspeed AST2400 GPIO support"
depends on (ARCH_ASPEED || COMPILE_TEST) && OF
select GENERIC_IRQ_CHIP
help
Say Y here to support Aspeed AST2400 GPIO.

config GPIO_BCM_KONA
bool "Broadcom Kona GPIO"
depends on OF_GPIO && (ARCH_BCM_MOBILE || COMPILE_TEST)
Expand Down Expand Up @@ -982,7 +989,6 @@ config GPIO_SODAVILLE
select GENERIC_IRQ_CHIP
help
Say Y here to support Intel Sodaville GPIO.

endmenu

menu "SPI GPIO expanders"
Expand Down
1 change: 1 addition & 0 deletions drivers/gpio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ obj-$(CONFIG_GPIO_AMD8111) += gpio-amd8111.o
obj-$(CONFIG_GPIO_AMDPT) += gpio-amdpt.o
obj-$(CONFIG_GPIO_ARIZONA) += gpio-arizona.o
obj-$(CONFIG_ATH79) += gpio-ath79.o
obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o
obj-$(CONFIG_GPIO_BCM_KONA) += gpio-bcm-kona.o
obj-$(CONFIG_GPIO_BRCMSTB) += gpio-brcmstb.o
obj-$(CONFIG_GPIO_BT8XX) += gpio-bt8xx.o
Expand Down
Loading

0 comments on commit 44066f8

Please sign in to comment.