aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2014-02-22 18:05:32 +0000
committerGabor Juhos <juhosg@openwrt.org>2014-02-22 18:05:32 +0000
commit81b220fd513dcb1ee11bec404e651ce6782b1dc5 (patch)
tree95ddccefdccc5320fbcd2dc72f5b9ff418d2f986 /target/linux/ar71xx
parentdb489b0e9be6b1d45846ce1745f256621baa2fe0 (diff)
downloadupstream-81b220fd513dcb1ee11bec404e651ce6782b1dc5.tar.gz
upstream-81b220fd513dcb1ee11bec404e651ce6782b1dc5.tar.bz2
upstream-81b220fd513dcb1ee11bec404e651ce6782b1dc5.zip
ar71xx: rb91x: register a gpio-latch platform device
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39699 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
index 3cbffed291..1da447b406 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb91x.c
@@ -22,6 +22,7 @@
#include <linux/spi/flash.h>
#include <linux/routerboot.h>
#include <linux/gpio.h>
+#include <linux/platform_data/gpio-latch.h>
#include <asm/prom.h>
#include <asm/mach-ath79/ath79.h>
@@ -50,6 +51,9 @@
#define RB91X_FLAG_USB BIT(0)
#define RB91X_FLAG_PCIE BIT(1)
+#define RB91X_LATCH_GPIO_BASE AR934X_GPIO_COUNT
+#define RB91X_LATCH_GPIO(_x) (RB91X_LATCH_GPIO_BASE + (_x))
+
struct rb_board_info {
const char *name;
u32 flags;
@@ -80,6 +84,19 @@ static struct flash_platform_data rb711gr100_spi_flash_data = {
.nr_parts = ARRAY_SIZE(rb711gr100_spi_partitions),
};
+static int rb711gr100_gpio_latch_gpios[AR934X_GPIO_COUNT] __initdata = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
+};
+
+static struct gpio_latch_platform_data rb711gr100_gpio_latch_data __initdata = {
+ .base = RB91X_LATCH_GPIO_BASE,
+ .num_gpios = ARRAY_SIZE(rb711gr100_gpio_latch_gpios),
+ .gpios = rb711gr100_gpio_latch_gpios,
+ .le_gpio_index = 11,
+ .le_active_low = true,
+};
+
static void __init rb711gr100_init_partitions(const struct rb_info *info)
{
rb711gr100_spi_partitions[0].size = info->hard_cfg_offs;
@@ -164,6 +181,10 @@ static void __init rb711gr100_setup(void)
platform_device_register_simple("rb91x-nand", -1, NULL, 0);
+ platform_device_register_data(NULL, "gpio-latch", -1,
+ &rb711gr100_gpio_latch_data,
+ sizeof(rb711gr100_gpio_latch_data));
+
flags = rb711gr100_get_flags(info);
if (flags & RB91X_FLAG_USB)