CONFIG_AR71XX_DEV_AP91_PCI=y
CONFIG_AR71XX_DEV_AP94_PCI=y
CONFIG_AR71XX_DEV_AR913X_WMAC=y
+CONFIG_AR71XX_DEV_GPIO_BUTTONS=y
CONFIG_AR71XX_DEV_LEDS_GPIO=y
CONFIG_AR71XX_DEV_M25P80=y
CONFIG_AR71XX_DEV_PB42_PCI=y
CONFIG_AR71XX_DEV_AP91_PCI=y
CONFIG_AR71XX_DEV_AP94_PCI=y
CONFIG_AR71XX_DEV_AR913X_WMAC=y
+CONFIG_AR71XX_DEV_GPIO_BUTTONS=y
CONFIG_AR71XX_DEV_LEDS_GPIO=y
CONFIG_AR71XX_DEV_M25P80=y
CONFIG_AR71XX_DEV_PB42_PCI=y
CONFIG_AR71XX_DEV_AP91_PCI=y
CONFIG_AR71XX_DEV_AP94_PCI=y
CONFIG_AR71XX_DEV_AR913X_WMAC=y
+CONFIG_AR71XX_DEV_GPIO_BUTTONS=y
CONFIG_AR71XX_DEV_LEDS_GPIO=y
CONFIG_AR71XX_DEV_M25P80=y
CONFIG_AR71XX_DEV_PB42_PCI=y
bool "Atheros AP81 board support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AR913X_WMAC
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
config AR71XX_MACH_AP83
bool "Atheros AP83 board support"
select AR71XX_DEV_AR913X_WMAC
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "D-Link DIR-615 rev. C1 support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AR913X_WMAC
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "D-Link DIR-825 rev. B1 board support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AP94_PCI if PCI
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
config AR71XX_MACH_PB42
bool "Atheros PB42 board support"
select AR71XX_DEV_M25P80
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_PB42_PCI if PCI
default y
config AR71XX_MACH_PB44
bool "Atheros PB44 board support"
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_PB42_PCI if PCI
select AR71XX_DEV_LEDS_GPIO
default y
config AR71XX_MACH_AW_NR580
bool "AzureWave AW-NR580 board support"
select AR71XX_DEV_M25P80
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_PB42_PCI if PCI
select AR71XX_DEV_LEDS_GPIO
default y
bool "Compex WP543/WPJ543 board support"
select MYLOADER
select AR71XX_DEV_M25P80
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_PB42_PCI if PCI
select AR71XX_DEV_LEDS_GPIO
default y
bool "Linksys WRT160NL board support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AR913X_WMAC
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
config AR71XX_MACH_WRT400N
bool "Linksys WRT400N board support"
select AR71XX_DEV_M25P80
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
config AR71XX_MACH_RB_4XX
bool "MikroTik RouterBOARD 4xx series support"
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "NETGEAR WNDR3700 board support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AP94_PCI if PCI
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "NETGEAR WNR2000 board support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AR913X_WMAC
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "Planex MZK-W04NU board support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AR913X_WMAC
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "Planex MZK-W300NH board support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AR913X_WMAC
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "TP-LINK TL-WR741ND support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AP91_PCI if PCI
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "TP-LINK TL-WR841N v1 support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_PB42_PCI if PCI
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "TP-LINK TL-WR941ND support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AR913X_WMAC
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "TP-LINK TL-WR1043ND support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AR913X_WMAC
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "TRENDnet TEW-632BRP support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AR913X_WMAC
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
default y
bool "Ubiquiti AR71xx based boards support"
select AR71XX_DEV_M25P80
select AR71XX_DEV_AP91_PCI if PCI
+ select AR71XX_DEV_GPIO_BUTTONS
select AR71XX_DEV_LEDS_GPIO
select AR71XX_DEV_PB42_PCI if PCI
default y
config AR71XX_DEV_AR913X_WMAC
def_bool n
+config AR71XX_DEV_GPIO_BUTTONS
+ def_bool n
+
config AR71XX_DEV_LEDS_GPIO
def_bool n
obj-$(CONFIG_AR71XX_DEV_AP91_PCI) += dev-ap91-pci.o
obj-$(CONFIG_AR71XX_DEV_AP94_PCI) += dev-ap94-pci.o
obj-$(CONFIG_AR71XX_DEV_AR913X_WMAC) += dev-ar913x-wmac.o
+obj-$(CONFIG_AR71XX_DEV_GPIO_BUTTONS) += dev-gpio-buttons.o
obj-$(CONFIG_AR71XX_DEV_LEDS_GPIO) += dev-leds-gpio.o
obj-$(CONFIG_AR71XX_DEV_M25P80) += dev-m25p80.o
obj-$(CONFIG_AR71XX_DEV_PB42_PCI) += dev-pb42-pci.o
--- /dev/null
+/*
+ * Atheros AR71xx GPIO button support
+ *
+ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#include "linux/init.h"
+#include <linux/platform_device.h>
+
+#include "dev-gpio-buttons.h"
+
+void __init ar71xx_add_device_gpio_buttons(int id,
+ unsigned poll_interval,
+ unsigned nbuttons,
+ struct gpio_button *buttons)
+{
+ struct platform_device *pdev;
+ struct gpio_buttons_platform_data pdata;
+ struct gpio_button *p;
+ int err;
+
+ p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL);
+ if (!p)
+ return;
+
+ memcpy(p, buttons, nbuttons * sizeof(*p));
+
+ pdev = platform_device_alloc("gpio-buttons", id);
+ if (!pdev)
+ goto err_free_buttons;
+
+ memset(&pdata, 0, sizeof(pdata));
+ pdata.poll_interval = poll_interval;
+ pdata.nbuttons = nbuttons;
+ pdata.buttons = p;
+
+ err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
+ if (err)
+ goto err_put_pdev;
+
+
+ err = platform_device_add(pdev);
+ if (err)
+ goto err_put_pdev;
+
+ return;
+
+err_put_pdev:
+ platform_device_put(pdev);
+
+err_free_buttons:
+ kfree(p);
+}
--- /dev/null
+/*
+ * Atheros AR71xx GPIO button support
+ *
+ * Copyright (C) 2008-2009 Gabor Juhos <juhosg@openwrt.org>
+ * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ */
+
+#ifndef _AR71XX_DEV_GPIO_BUTTONS_H
+#define _AR71XX_DEV_GPIO_BUTTONS_H
+
+#include <linux/input.h>
+#include <linux/gpio_buttons.h>
+
+#include <asm/mach-ar71xx/platform.h>
+
+void ar71xx_add_device_gpio_buttons(int id,
+ unsigned poll_interval,
+ unsigned nbuttons,
+ struct gpio_button *buttons) __init;
+
+#endif /* _AR71XX_DEV_GPIO_BUTTONS_H */
platform_device_register(&ar71xx_spi_device);
}
-void __init ar71xx_add_device_gpio_buttons(int id,
- unsigned poll_interval,
- unsigned nbuttons,
- struct gpio_button *buttons)
-{
- struct platform_device *pdev;
- struct gpio_buttons_platform_data pdata;
- struct gpio_button *p;
- int err;
-
- p = kmalloc(nbuttons * sizeof(*p), GFP_KERNEL);
- if (!p)
- return;
-
- memcpy(p, buttons, nbuttons * sizeof(*p));
-
- pdev = platform_device_alloc("gpio-buttons", id);
- if (!pdev)
- goto err_free_buttons;
-
- memset(&pdata, 0, sizeof(pdata));
- pdata.poll_interval = poll_interval;
- pdata.nbuttons = nbuttons;
- pdata.buttons = p;
-
- err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
- if (err)
- goto err_put_pdev;
-
-
- err = platform_device_add(pdev);
- if (err)
- goto err_put_pdev;
-
- return;
-
-err_put_pdev:
- platform_device_put(pdev);
-
-err_free_buttons:
- kfree(p);
-}
-
void __init ar71xx_add_device_wdt(void)
{
platform_device_register_simple("ar71xx-wdt", -1, NULL, 0);
#include <asm/mach-ar71xx/platform.h>
-#include <linux/gpio_buttons.h>
#include <net/dsa.h>
void ar71xx_add_device_spi(struct ar71xx_spi_platform_data *pdata,
void ar71xx_add_device_mdio(u32 phy_mask) __init;
-void ar71xx_add_device_gpio_buttons(int id,
- unsigned poll_interval,
- unsigned nbuttons,
- struct gpio_button *buttons) __init;
-
void ar71xx_add_device_usb(void) __init;
void ar71xx_add_device_uart(void) __init;
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define AP81_GPIO_LED_STATUS 1
#include <linux/delay.h>
#include <linux/platform_device.h>
-#include <linux/input.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/spi/spi.h>
#include "devices.h"
#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define AP83_GPIO_LED_WLAN 6
#define AP83_050_GPIO_VSC7385_MOSI 16
#define AP83_050_GPIO_VSC7385_SCK 17
+#define AP83_BUTTONS_POLL_INTERVAL 20
+
#ifdef CONFIG_MTD_PARTITIONS
static struct mtd_partition ap83_flash_partitions[] = {
{
ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(ap83_leds_gpio),
ap83_leds_gpio);
- ar71xx_add_device_gpio_buttons(-1, 20, ARRAY_SIZE(ap83_gpio_buttons),
+ ar71xx_add_device_gpio_buttons(-1, AP83_BUTTONS_POLL_INTERVAL,
+ ARRAY_SIZE(ap83_gpio_buttons),
ap83_gpio_buttons);
ar71xx_add_device_usb();
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
+#include "dev-gpio-buttons.h"
#include "dev-pb42-pci.h"
#include "dev-leds-gpio.h"
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define DIR_615C1_GPIO_LED_ORANGE_STATUS 1 /* ORANGE:STATUS:TRICOLOR */
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <linux/delay.h>
#include <linux/rtl8366_smi.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ap94-pci.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define DIR825B1_GPIO_LED_BLUE_USB 0
#include <linux/mtd/partitions.h>
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define MZK_W04NU_GPIO_LED_USB 0
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define MZK_W300NH_GPIO_LED_STATUS 1
#include <linux/init.h>
#include <linux/bitops.h>
-#include <linux/input.h>
#include <linux/platform_device.h>
#include <asm/mips_machine.h>
#include "devices.h"
#include "dev-m25p80.h"
+#include "dev-gpio-buttons.h"
#include "dev-pb42-pci.h"
#define PB42_BUTTONS_POLL_INTERVAL 20
#include <linux/init.h>
#include <linux/bitops.h>
-#include <linux/input.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include "devices.h"
#include "dev-pb42-pci.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define PB44_PCF8757_VSC7395_CS 0
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
#include <linux/spi/mmc_spi.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include <asm/mach-ar71xx/pci.h>
#include "devices.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define RB4XX_GPIO_USER_LED 4
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define TEW_632BRP_GPIO_LED_STATUS 1
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
-
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define TL_WR1043ND_GPIO_LED_USB 1
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
-
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ap91-pci.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define TL_WR741ND_GPIO_LED_QSS 0
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
+#include "dev-gpio-buttons.h"
#include "dev-pb42-pci.h"
#include "dev-leds-gpio.h"
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define TL_WR941ND_GPIO_LED_SYSTEM 2
#include <linux/pci.h>
#include <linux/platform_device.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ap91-pci.h"
+#include "dev-gpio-buttons.h"
#include "dev-pb42-pci.h"
#include "dev-leds-gpio.h"
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <linux/delay.h>
#include <linux/rtl8366_smi.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ap94-pci.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define WNDR3700_GPIO_LED_WPS_ORANGE 0
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
-
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define WNR2000_GPIO_LED_PWR_GREEN 14
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-pb42-pci.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define WP543_GPIO_SW6 2
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
#include "dev-ar913x-wmac.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define WRT160NL_GPIO_LED_POWER 14
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
-#include <linux/input.h>
#include <asm/mips_machine.h>
#include <asm/mach-ar71xx/ar71xx.h>
#include "devices.h"
#include "dev-m25p80.h"
+#include "dev-gpio-buttons.h"
+#include "dev-gpio-buttons.h"
#include "dev-leds-gpio.h"
#define WRT400N_GPIO_LED_ORANGE 5