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 <ath25_platform.h>
24 +ar231x_init_reset(void)
26 + struct platform_device *pdev;
27 + struct gpio_keys_platform_data pdata;
28 + struct gpio_keys_button *p;
31 + if (ath25_board.config->reset_config_gpio == 0xffff)
34 + p = kzalloc(sizeof(*p), GFP_KERNEL);
40 + p->code = KEY_RESTART;
41 + p->debounce_interval = 60;
42 + p->gpio = ath25_board.config->reset_config_gpio;
44 + memset(&pdata, 0, sizeof(pdata));
45 + pdata.poll_interval = 20;
49 + pdev = platform_device_alloc("gpio-keys-polled", 0);
53 + err = platform_device_add_data(pdev, &pdata, sizeof(pdata));
57 + err = platform_device_add(pdev);
64 + platform_device_put(pdev);
71 +module_init(ar231x_init_reset);