2 * Buttons driver for HTC Universal
4 * This file is subject to the terms and conditions of the GNU General Public
7 * Copyright (C) 2005 Pawel Kolodziejski
8 * Copyright (C) 2003 Joshua Wise
12 #include <linux/input.h>
13 #include <linux/input_pda.h>
14 #include <linux/module.h>
15 #include <linux/init.h>
16 #include <linux/interrupt.h>
17 #include <linux/irq.h>
18 #include <linux/platform_device.h>
19 #include <linux/soc/asic3_base.h>
20 #include <asm/mach-types.h>
21 #include <asm/hardware/gpio_keys.h>
22 #include <asm/hardware/asic3_keys.h>
23 #include <asm/arch/htcuniversal-gpio.h>
24 #include <asm/arch/htcuniversal-asic.h>
26 extern struct platform_device htcuniversal_asic3
;
28 static struct asic3_keys_button asic3_buttons
[] = {
29 { KEY_F10
, GPIOA_BUTTON_BACKLIGHT_N
,1, "backlight_button"},
30 { KEY_F24
, GPIOA_BUTTON_RECORD_N
,1, "record_button"},
31 { KEY_F10
, GPIOA_BUTTON_CAMERA_N
,1, "camera_button"},
32 { SW_LID
, GPIOA_COVER_ROTATE_N
,1, "screen_cover"},
33 { KEY_VOLUMEDOWN
, GPIOA_VOL_UP_N
,1, "volume_slider_down"},
34 { KEY_VOLUMEUP
, GPIOA_VOL_DOWN_N
,1, "volume_slider_up"},
35 { SW_TABLET_MODE
, GPIOB_CLAMSHELL_N
,1, "clamshell_rotate"},
36 //{ SW_2, GPIOB_NIGHT_SENSOR,1, "night_sensor"},
37 { KEY_KPENTER
, GPIOD_KEY_OK_N
,1, "select"},
38 { KEY_RIGHT
, GPIOD_KEY_RIGHT_N
,1, "right"},
39 { KEY_LEFT
, GPIOD_KEY_LEFT_N
,1, "left"},
40 { KEY_DOWN
, GPIOD_KEY_DOWN_N
,1, "down"},
41 { KEY_UP
, GPIOD_KEY_UP_N
,1, "up"},
44 static struct asic3_keys_platform_data asic3_keys_data
= {
45 .buttons
= asic3_buttons
,
46 .nbuttons
= ARRAY_SIZE(asic3_buttons
),
47 .asic3_dev
= &htcuniversal_asic3
.dev
,
50 static struct platform_device htcuniversal_keys_asic3
= {
52 .dev
= { .platform_data
= &asic3_keys_data
, }
55 static int __init
htcuniversal_buttons_probe(struct platform_device
*dev
)
57 platform_device_register(&htcuniversal_keys_asic3
);
61 static struct platform_driver htcuniversal_buttons_driver
= {
63 .name
= "htcuniversal_buttons",
65 .probe
= htcuniversal_buttons_probe
,
68 static int __init
htcuniversal_buttons_init(void)
70 if (!machine_is_htcuniversal())
73 return platform_driver_register(&htcuniversal_buttons_driver
);
76 static void __exit
htcuniversal_buttons_exit(void)
78 platform_driver_unregister(&htcuniversal_buttons_driver
);
81 module_init(htcuniversal_buttons_init
);
82 module_exit(htcuniversal_buttons_exit
);
84 MODULE_AUTHOR ("Joshua Wise, Pawel Kolodziejski, Paul Sokolosvky");
85 MODULE_DESCRIPTION ("Buttons support for HTC Universal");
86 MODULE_LICENSE ("GPL");