diff options
author | Felix Fietkau <nbd@openwrt.org> | 2016-03-05 09:45:03 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2016-03-05 09:45:03 +0000 |
commit | 6bece706ec1b6347b57b9208bfc9cad9697d758a (patch) | |
tree | 3d3075c63929d386f2370858c21819adbbea7262 /target | |
parent | dab37abc4d1bbbbbb5b394308154d94d057c3d0b (diff) | |
download | mtk-20170518-6bece706ec1b6347b57b9208bfc9cad9697d758a.zip mtk-20170518-6bece706ec1b6347b57b9208bfc9cad9697d758a.tar.gz mtk-20170518-6bece706ec1b6347b57b9208bfc9cad9697d758a.tar.bz2 |
mac80211: ath9k: enable GPIO buttons
Enable platform-defined GPIO button support for ath9k device.
Key poller is activated for attached platform buttons.
Requires ath9k GPIO chip access.
Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
SVN-Revision: 48921
Diffstat (limited to 'target')
3 files changed, 25 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c index bf80d4d..20bb06e 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c @@ -93,6 +93,20 @@ __init void ap9x_pci_setup_wmac_leds(unsigned wmac, struct gpio_led *leds, } } +__init void ap9x_pci_setup_wmac_btns(unsigned wmac, + struct gpio_keys_button *btns, + unsigned num_btns, unsigned poll_interval) +{ + struct ath9k_platform_data *ap9x_wmac_data; + + if (!(ap9x_wmac_data = ap9x_pci_get_wmac_data(wmac))) + return; + + ap9x_wmac_data->btns = btns; + ap9x_wmac_data->num_btns = num_btns; + ap9x_wmac_data->btn_poll_interval = poll_interval; +} + static int ap91_pci_plat_dev_init(struct pci_dev *dev) { switch (PCI_SLOT(dev->devfn)) { diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h index dcfe541..d7c0185 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h @@ -12,6 +12,7 @@ #define _ATH79_DEV_AP9X_PCI_H struct gpio_led; +struct gpio_keys_button; struct ath9k_platform_data; #if defined(CONFIG_ATH79_DEV_AP9X_PCI) @@ -20,6 +21,8 @@ void ap9x_pci_setup_wmac_gpio(unsigned wmac, u32 mask, u32 val); void ap9x_pci_setup_wmac_leds(unsigned wmac, struct gpio_led *leds, int num_leds); void ap9x_pci_setup_wmac_led_name(unsigned wmac, const char *led_name); +void ap9x_pci_setup_wmac_btns(unsigned wmac, struct gpio_keys_button *btns, + unsigned num_btns, unsigned poll_interval); struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac); void ap91_pci_init(u8 *cal_data, u8 *mac_addr); @@ -36,6 +39,10 @@ static inline void ap9x_pci_setup_wmac_leds(unsigned wmac, int num_leds) {} static inline void ap9x_pci_setup_wmac_led_name(unsigned wmac, const char *led_name) {} +static inline void ap9x_pci_setup_wmac_btns(unsigned wmac, + struct gpio_keys_button *btns, + unsigned num_btns, + unsigned poll_interval) {} static inline struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac) { return NULL; diff --git a/target/linux/generic/files/include/linux/ath9k_platform.h b/target/linux/generic/files/include/linux/ath9k_platform.h index 823e5ac..e543a64 100644 --- a/target/linux/generic/files/include/linux/ath9k_platform.h +++ b/target/linux/generic/files/include/linux/ath9k_platform.h @@ -46,6 +46,10 @@ struct ath9k_platform_data { int num_leds; const struct gpio_led *leds; const char *led_name; + + unsigned num_btns; + const struct gpio_keys_button *btns; + unsigned btn_poll_interval; }; #endif /* _LINUX_ATH9K_PLATFORM_H */ |