From 8fea668cb78c5f007fdc0c576f295580df2dceeb Mon Sep 17 00:00:00 2001 From: Gabor Juhos Date: Sat, 22 Feb 2014 18:05:32 +0000 Subject: [PATCH] ar71xx: rb91x: register a gpio-latch platform device Signed-off-by: Gabor Juhos SVN-Revision: 39699 --- .../ar71xx/files/arch/mips/ath79/mach-rb91x.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) 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 3cbffed2918..1da447b4068 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 #include #include +#include #include #include @@ -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) -- 2.30.2