14 #include <linux/kernel.h>
19 #include <linux/input.h>
27 #include <asm/setup.h>
34 #include <mach/hardware.h>
41 #define EZX_NR_IRQS (IRQ_BOARD_START + 24)
43 #define GPIO12_A780_FLIP_LID 12
44 #define GPIO15_A1200_FLIP_LID 15
45 #define GPIO15_A910_FLIP_LID 15
46 #define GPIO12_E680_LOCK_SWITCH 12
47 #define GPIO15_E6_LOCK_SWITCH 15
48 #define GPIO50_nCAM_EN 50
49 #define GPIO19_GEN1_CAM_RST 19
50 #define GPIO28_GEN2_CAM_RST 28
54 .max_brightness = 1023,
55 .dft_brightness = 1023,
56 .pwm_period_ns = 78770,
60 .name =
"pwm-backlight",
63 .platform_data = &ezx_backlight_data,
82 .modes = &mode_ezx_old,
103 .modes = &mode_72r89803y01,
109 &ezx_backlight_device,
112 static unsigned long ezx_pin_config[]
__initdata = {
161 #if defined(CONFIG_MACH_EZX_A780) || defined(CONFIG_MACH_EZX_E680)
162 static unsigned long gen1_pin_config[]
__initdata = {
215 #if defined(CONFIG_MACH_EZX_A1200) || defined(CONFIG_MACH_EZX_A910) || \
216 defined(CONFIG_MACH_EZX_E2) || defined(CONFIG_MACH_EZX_E6)
217 static unsigned long gen2_pin_config[]
__initdata = {
267 #ifdef CONFIG_MACH_EZX_A780
268 static unsigned long a780_pin_config[]
__initdata = {
287 #ifdef CONFIG_MACH_EZX_E680
288 static unsigned long e680_pin_config[]
__initdata = {
317 #ifdef CONFIG_MACH_EZX_A1200
318 static unsigned long a1200_pin_config[]
__initdata = {
334 #ifdef CONFIG_MACH_EZX_A910
335 static unsigned long a910_pin_config[]
__initdata = {
359 #ifdef CONFIG_MACH_EZX_E2
360 static unsigned long e2_pin_config[]
__initdata = {
376 #ifdef CONFIG_MACH_EZX_E6
377 static unsigned long e6_pin_config[]
__initdata = {
394 #ifdef CONFIG_MACH_EZX_A780
395 static unsigned int a780_key_map[] = {
429 .matrix_key_cols = 5,
430 .matrix_key_map = a780_key_map,
431 .matrix_key_map_size =
ARRAY_SIZE(a780_key_map),
436 .debounce_interval = 30,
440 #ifdef CONFIG_MACH_EZX_E680
441 static unsigned int e680_key_map[] = {
460 .matrix_key_cols = 4,
461 .matrix_key_map = e680_key_map,
462 .matrix_key_map_size =
ARRAY_SIZE(e680_key_map),
474 .debounce_interval = 30,
478 #ifdef CONFIG_MACH_EZX_A1200
479 static unsigned int a1200_key_map[] = {
518 .matrix_key_cols = 6,
519 .matrix_key_map = a1200_key_map,
520 .matrix_key_map_size =
ARRAY_SIZE(a1200_key_map),
522 .debounce_interval = 30,
526 #ifdef CONFIG_MACH_EZX_E6
527 static unsigned int e6_key_map[] = {
566 .matrix_key_cols = 6,
567 .matrix_key_map = e6_key_map,
568 .matrix_key_map_size =
ARRAY_SIZE(e6_key_map),
570 .debounce_interval = 30,
574 #ifdef CONFIG_MACH_EZX_A910
575 static unsigned int a910_key_map[] = {
614 .matrix_key_cols = 6,
615 .matrix_key_map = a910_key_map,
616 .matrix_key_map_size =
ARRAY_SIZE(a910_key_map),
618 .debounce_interval = 30,
622 #ifdef CONFIG_MACH_EZX_E2
623 static unsigned int e2_key_map[] = {
662 .matrix_key_cols = 6,
663 .matrix_key_map = e2_key_map,
664 .matrix_key_map_size =
ARRAY_SIZE(e2_key_map),
666 .debounce_interval = 30,
670 #ifdef CONFIG_MACH_EZX_A780
677 .desc =
"A780 flip lid",
692 .platform_data = &a780_gpio_keys_platform_data,
697 static int a780_camera_init(
void)
707 pr_err(
"%s: Failed to request nCAM_EN\n", __func__);
713 pr_err(
"%s: Failed to request CAM_RST\n", __func__);
714 goto fail_gpio_cam_rst;
728 static int a780_camera_power(
struct device *
dev,
int on)
734 static int a780_camera_reset(
struct device *
dev)
757 .board_info = &a780_camera_i2c_board_info,
758 .power = a780_camera_power,
759 .reset = a780_camera_reset,
763 .
name =
"soc-camera-pdrv",
766 .platform_data = &a780_iclink,
774 static void __init a780_init(
void)
790 if (a780_camera_init() == 0) {
800 .atag_offset = 0x100,
806 .init_machine = a780_init,
811 #ifdef CONFIG_MACH_EZX_E680
818 .desc =
"E680 lock switch",
833 .platform_data = &e680_gpio_keys_platform_data,
845 static void __init e680_init(
void)
867 .atag_offset = 0x100,
873 .init_machine = e680_init,
878 #ifdef CONFIG_MACH_EZX_A1200
885 .desc =
"A1200 flip lid",
900 .platform_data = &a1200_gpio_keys_platform_data,
904 static struct i2c_board_info __initdata a1200_i2c_board_info[] = {
912 static void __init a1200_init(
void)
934 .atag_offset = 0x100,
940 .init_machine = a1200_init,
945 #ifdef CONFIG_MACH_EZX_A910
952 .desc =
"A910 flip lid",
967 .platform_data = &a910_gpio_keys_platform_data,
972 static int a910_camera_init(
void)
982 pr_err(
"%s: Failed to request nCAM_EN\n", __func__);
988 pr_err(
"%s: Failed to request CAM_RST\n", __func__);
989 goto fail_gpio_cam_rst;
1003 static int a910_camera_power(
struct device *
dev,
int on)
1009 static int a910_camera_reset(
struct device *
dev)
1030 .i2c_adapter_id = 0,
1031 .board_info = &a910_camera_i2c_board_info,
1032 .power = a910_camera_power,
1033 .reset = a910_camera_reset,
1037 .
name =
"soc-camera-pdrv",
1040 .platform_data = &a910_iclink,
1049 .name =
"a910:red:",
1054 .name =
"a910:green:",
1059 .name =
"a910:blue:",
1065 .name =
"a910::cli_display",
1070 .name =
"a910::main_display",
1076 .name =
"a910::torch",
1081 .name =
"a910::flash",
1088 static struct i2c_board_info __initdata a910_i2c_board_info[] = {
1091 .platform_data = &a910_lp3944_leds,
1099 static void __init a910_init(
void)
1116 if (a910_camera_init() == 0) {
1126 .atag_offset = 0x100,
1132 .init_machine = a910_init,
1137 #ifdef CONFIG_MACH_EZX_E6
1144 .desc =
"E6 lock switch",
1156 .
name =
"gpio-keys",
1159 .platform_data = &e6_gpio_keys_platform_data,
1171 static void __init e6_init(
void)
1193 .atag_offset = 0x100,
1199 .init_machine = e6_init,
1204 #ifdef CONFIG_MACH_EZX_E2
1212 static void __init e2_init(
void)
1234 .atag_offset = 0x100,
1240 .init_machine = e2_init,