diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2013-02-21 17:45:54 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2013-02-21 17:45:54 +0000 |
commit | 9cc3a60b5a6988759532b63a6fb513484b8ec9f9 (patch) | |
tree | 33ec6bf16390079f34e5fe6805f0d299f7e425d8 /target/linux/atheros/patches-3.8/210-reset_button.patch | |
parent | babd5aa2fc54f547cfa397f08011836fad1614c7 (diff) | |
download | mtk-20170518-9cc3a60b5a6988759532b63a6fb513484b8ec9f9.zip mtk-20170518-9cc3a60b5a6988759532b63a6fb513484b8ec9f9.tar.gz mtk-20170518-9cc3a60b5a6988759532b63a6fb513484b8ec9f9.tar.bz2 |
atheros: add support for linux kernel v3.8
This builds and boots.
Because of the function pointer indirection (e.g. mtd_info's read
function pointer is assigned to spiflash_read), it is difficult for me
to understand where the calls are coming from (could be anywhere,
conditionally pointing at spiflash versions), so I punted and used the
renamed function pointers (_erase, _read, _write). If someone knows
better what to do, please fix.
Cleaned up other sundry kernel tracking issues like get_phy_id and
__devinit,etc.
[juhosg: don't switch to that yet]
Signed-off-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 35727
Diffstat (limited to 'target/linux/atheros/patches-3.8/210-reset_button.patch')
-rw-r--r-- | target/linux/atheros/patches-3.8/210-reset_button.patch | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/target/linux/atheros/patches-3.8/210-reset_button.patch b/target/linux/atheros/patches-3.8/210-reset_button.patch new file mode 100644 index 0000000..c147190 --- /dev/null +++ b/target/linux/atheros/patches-3.8/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->resetConfigGpio == 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->resetConfigGpio; ++ ++ 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); |