hh.org updates
[hh.org.git] / arch / arm / mach-pxa / htcsable / htcsable_buttons.c
blob0eb963e473f3167860050145391c9e71c973b2f8
1 /*
2 * Buttons driver for iPAQ h4150/h4350.
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive for
6 * more details.
8 * Copyright (C) 2005 Pawel Kolodziejski
9 * Copyright (C) 2003 Joshua Wise
13 #include <linux/input.h>
14 #include <linux/input_pda.h>
15 #include <linux/module.h>
16 #include <linux/init.h>
17 #include <linux/interrupt.h>
18 #include <linux/irq.h>
19 #include <linux/platform_device.h>
20 #include <asm/mach-types.h>
21 #include <asm/hardware/gpio_keys.h>
22 #include <asm/arch/htcsable-gpio.h>
24 static struct gpio_keys_button pxa_buttons[] = {
25 { _KEY_POWER, GPIO_NR_HTCSABLE_KEY_ON_N, 1, "Power button" },
28 static struct gpio_keys_platform_data gpio_keys_data = {
29 .buttons = pxa_buttons,
30 .nbuttons = ARRAY_SIZE(pxa_buttons),
33 static struct platform_device htcsable_keys_gpio = {
34 .name = "gpio-keys",
35 .dev = { .platform_data = &gpio_keys_data, }
38 static int __init htcsable_buttons_probe(struct device *dev)
40 platform_device_register(&htcsable_keys_gpio);
41 return 0;
44 static struct device_driver htcsable_buttons_driver = {
45 .name = "htcsable_buttons",
46 .bus = &platform_bus_type,
47 .probe = htcsable_buttons_probe,
50 static int __init htcsable_buttons_init(void)
52 if (!machine_is_hw6900())
53 return -ENODEV;
55 return driver_register(&htcsable_buttons_driver);
58 static void __exit htcsable_buttons_exit(void)
60 driver_unregister(&htcsable_buttons_driver);
63 module_init(htcsable_buttons_init);
64 module_exit(htcsable_buttons_exit);
66 MODULE_AUTHOR ("Joshua Wise, Pawel Kolodziejski, Paul Sokolosvky, Luke Kenneth Casson Leighton");
67 MODULE_DESCRIPTION ("Buttons support for iPAQ htcsable");
68 MODULE_LICENSE ("GPL");