summaryrefslogtreecommitdiffstats
path: root/target/linux/atheros/patches-3.14/210-reset_button.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-08-04 20:54:49 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-08-04 20:54:49 +0000
commit5b9d4fd80a2b8a493c3494269f382ca79a12c126 (patch)
tree2041996473da887b574786b03686bf997cc62b79 /target/linux/atheros/patches-3.14/210-reset_button.patch
parent005f8ed56316490be357d119fadf0d2183fce31a (diff)
downloadmaster-31e0f0ae-5b9d4fd80a2b8a493c3494269f382ca79a12c126.tar.gz
master-31e0f0ae-5b9d4fd80a2b8a493c3494269f382ca79a12c126.tar.bz2
master-31e0f0ae-5b9d4fd80a2b8a493c3494269f382ca79a12c126.zip
atheros: copy 3.10 patches to 3.14 and refresh them
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> SVN-Revision: 41995
Diffstat (limited to 'target/linux/atheros/patches-3.14/210-reset_button.patch')
-rw-r--r--target/linux/atheros/patches-3.14/210-reset_button.patch72
1 files changed, 72 insertions, 0 deletions
diff --git a/target/linux/atheros/patches-3.14/210-reset_button.patch b/target/linux/atheros/patches-3.14/210-reset_button.patch
new file mode 100644
index 0000000000..8007ed4ddb
--- /dev/null
+++ b/target/linux/atheros/patches-3.14/210-reset_button.patch
@@ -0,0 +1,72 @@
+--- a/arch/mips/ar231x/Makefile
++++ b/arch/mips/ar231x/Makefile
+@@ -8,7 +8,7 @@
+ # Copyright (C) 2006-2009 Felix Fietkau <nbd@openwrt.org>
+ #
+
+-obj-y += board.o prom.o devices.o
++obj-y += board.o prom.o devices.o reset.o
+
+ obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
+
+--- /dev/null
++++ b/arch/mips/ar231x/reset.c
+@@ -0,0 +1,58 @@
++#include <linux/init.h>
++#include <linux/slab.h>
++#include <linux/platform_device.h>
++#include <linux/gpio_keys.h>
++#include <linux/input.h>
++#include <ar231x_platform.h>
++#include <ar231x.h>
++#include "devices.h"
++
++static int __init
++ar231x_init_reset(void)
++{
++ struct platform_device *pdev;
++ struct gpio_keys_platform_data pdata;
++ struct gpio_keys_button *p;
++ int err;
++
++ if (ar231x_board.config->reset_config_gpio == 0xffff)
++ return -ENODEV;
++
++ p = kzalloc(sizeof(*p), GFP_KERNEL);
++ if (!p)
++ goto err;
++
++ p->desc = "reset";
++ p->type = EV_KEY;
++ p->code = KEY_RESTART;
++ p->debounce_interval = 60;
++ p->gpio = ar231x_board.config->reset_config_gpio;
++
++ memset(&pdata, 0, sizeof(pdata));
++ pdata.poll_interval = 20;
++ pdata.buttons = p;
++ pdata.nbuttons = 1;
++
++ pdev = platform_device_alloc("gpio-keys-polled", 0);
++ if (!pdev)
++ goto err_free;
++
++ 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 0;
++
++err_put_pdev:
++ platform_device_put(pdev);
++err_free:
++ kfree(p);
++err:
++ return -ENOMEM;
++}
++
++module_init(ar231x_init_reset);