1 --- a/arch/mips/ath25/Makefile
2 +++ b/arch/mips/ath25/Makefile
4 # Copyright (C) 2006-2009 Felix Fietkau <nbd@openwrt.org>
7 -obj-y += board.o prom.o devices.o
8 +obj-y += board.o prom.o devices.o reset.o
10 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
13 +++ b/arch/mips/ath25/reset.c
15 +#include <linux/init.h>
16 +#include <linux/slab.h>
17 +#include <linux/platform_device.h>
18 +#include <linux/gpio_keys.h>
19 +#include <linux/input.h>
20 +#include <ar231x_platform.h>
25 +ar231x_init_reset(void)
27 + struct platform_device *pdev;
28 + struct gpio_keys_platform_data pdata;
29 + struct gpio_keys_button *p;
32 + if (ar231x_board.config->reset_config_gpio == 0xffff)
35 + p = kzalloc(sizeof(*p), GFP_KERNEL);
41 + p->code = KEY_RESTART;
42 + p->debounce_interval = 60;
43 + p->gpio = ar231x_board.config->reset_config_gpio;
45 + memset(&pdata, 0, sizeof(pdata));
46 + pdata.poll_interval = 20;
50 + pdev = platform_device_alloc("gpio-keys-polled", 0);
54 + err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
58 + err = platform_device_add(pdev);
65 + platform_device_put(pdev);
72 +module_init(ar231x_init_reset);