2 arch/arm/mach-omap2/board-n8x0.c | 73 +++++++++++++++++++++++++++++++++++++++
3 1 file changed, 73 insertions(+)
5 Index: linux-3.1/arch/arm/mach-omap2/board-n8x0.c
6 ===================================================================
7 --- linux-3.1.orig/arch/arm/mach-omap2/board-n8x0.c 2011-10-30 00:48:50.813042079 +0200
8 +++ linux-3.1/arch/arm/mach-omap2/board-n8x0.c 2011-10-30 00:48:51.565042059 +0200
9 @@ -316,6 +316,77 @@ void __init n8x0_bt_init(void)
13 +struct gpio_switch_input_dev {
14 + struct input_dev *idev;
15 + unsigned int swcode;
18 +static struct gpio_switch_input_dev *slide_input;
19 +static struct gpio_switch_input_dev *kblock_input;
21 +static void n8x0_gpio_switch_input_notify(struct gpio_switch_input_dev *gdev,
25 + input_report_switch(gdev->idev, gdev->swcode, state);
26 + input_sync(gdev->idev);
30 +static void n8x0_slide_notify(void *data, int state)
32 + n8x0_gpio_switch_input_notify(slide_input, state);
35 +static void n8x0_kb_lock_notify(void *data, int state)
37 + n8x0_gpio_switch_input_notify(kblock_input, state);
40 +static struct gpio_switch_input_dev * __init gpioswitch_input_init(
42 + unsigned int swcode)
44 + struct gpio_switch_input_dev *gdev;
47 + gdev = kzalloc(sizeof(*gdev), GFP_KERNEL);
50 + gdev->swcode = swcode;
52 + gdev->idev = input_allocate_device();
56 + gdev->idev->evbit[0] = BIT_MASK(EV_SW);
57 + gdev->idev->swbit[BIT_WORD(swcode)] = BIT_MASK(swcode);
58 + gdev->idev->name = name;
60 + err = input_register_device(gdev->idev);
67 + input_free_device(gdev->idev);
74 +static int __init n8x0_gpio_switches_input_init(void)
76 + slide_input = gpioswitch_input_init("slide", SW_KEYPAD_SLIDE);
77 + kblock_input = gpioswitch_input_init("kb_lock", SW_LID);
78 + if (WARN_ON(!slide_input || !kblock_input))
82 +late_initcall(n8x0_gpio_switches_input_init);
84 static struct omap_gpio_switch n8x0_gpio_switches[] __initdata = {
87 @@ -337,11 +408,13 @@ static struct omap_gpio_switch n8x0_gpio
89 .debounce_rising = 200,
90 .debounce_falling = 200,
91 + .notify = n8x0_slide_notify,
95 .debounce_rising = 200,
96 .debounce_falling = 200,
97 + .notify = n8x0_kb_lock_notify,