diff options
Diffstat (limited to 'arch/arm/mach-s3c2440')
-rw-r--r-- | arch/arm/mach-s3c2440/mach-gta02.c | 71 |
1 files changed, 54 insertions, 17 deletions
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c2440/mach-gta02.c index 37405d9abe32..0db2411ef4bb 100644 --- a/arch/arm/mach-s3c2440/mach-gta02.c +++ b/arch/arm/mach-s3c2440/mach-gta02.c | |||
@@ -58,6 +58,9 @@ | |||
58 | #include <linux/mfd/pcf50633/pmic.h> | 58 | #include <linux/mfd/pcf50633/pmic.h> |
59 | #include <linux/mfd/pcf50633/backlight.h> | 59 | #include <linux/mfd/pcf50633/backlight.h> |
60 | 60 | ||
61 | #include <linux/input.h> | ||
62 | #include <linux/gpio_keys.h> | ||
63 | |||
61 | #include <asm/mach/arch.h> | 64 | #include <asm/mach/arch.h> |
62 | #include <asm/mach/map.h> | 65 | #include <asm/mach/map.h> |
63 | #include <asm/mach/irq.h> | 66 | #include <asm/mach/irq.h> |
@@ -86,6 +89,8 @@ | |||
86 | #include <plat/udc.h> | 89 | #include <plat/udc.h> |
87 | #include <plat/gpio-cfg.h> | 90 | #include <plat/gpio-cfg.h> |
88 | #include <plat/iic.h> | 91 | #include <plat/iic.h> |
92 | #include <plat/ts.h> | ||
93 | |||
89 | 94 | ||
90 | static struct pcf50633 *gta02_pcf; | 95 | static struct pcf50633 *gta02_pcf; |
91 | 96 | ||
@@ -280,9 +285,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = { | |||
280 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | 285 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
281 | .always_on = 1, | 286 | .always_on = 1, |
282 | .apply_uV = 1, | 287 | .apply_uV = 1, |
283 | .state_mem = { | ||
284 | .enabled = 1, | ||
285 | }, | ||
286 | }, | 288 | }, |
287 | }, | 289 | }, |
288 | [PCF50633_REGULATOR_DOWN1] = { | 290 | [PCF50633_REGULATOR_DOWN1] = { |
@@ -301,9 +303,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = { | |||
301 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | 303 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
302 | .apply_uV = 1, | 304 | .apply_uV = 1, |
303 | .always_on = 1, | 305 | .always_on = 1, |
304 | .state_mem = { | ||
305 | .enabled = 1, | ||
306 | }, | ||
307 | }, | 306 | }, |
308 | }, | 307 | }, |
309 | [PCF50633_REGULATOR_HCLDO] = { | 308 | [PCF50633_REGULATOR_HCLDO] = { |
@@ -311,8 +310,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = { | |||
311 | .min_uV = 2000000, | 310 | .min_uV = 2000000, |
312 | .max_uV = 3300000, | 311 | .max_uV = 3300000, |
313 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | 312 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
314 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | 313 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
315 | .always_on = 1, | 314 | REGULATOR_CHANGE_STATUS, |
316 | }, | 315 | }, |
317 | }, | 316 | }, |
318 | [PCF50633_REGULATOR_LDO1] = { | 317 | [PCF50633_REGULATOR_LDO1] = { |
@@ -320,10 +319,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = { | |||
320 | .min_uV = 3300000, | 319 | .min_uV = 3300000, |
321 | .max_uV = 3300000, | 320 | .max_uV = 3300000, |
322 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | 321 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
322 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
323 | .apply_uV = 1, | 323 | .apply_uV = 1, |
324 | .state_mem = { | ||
325 | .enabled = 0, | ||
326 | }, | ||
327 | }, | 324 | }, |
328 | }, | 325 | }, |
329 | [PCF50633_REGULATOR_LDO2] = { | 326 | [PCF50633_REGULATOR_LDO2] = { |
@@ -347,6 +344,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = { | |||
347 | .min_uV = 3200000, | 344 | .min_uV = 3200000, |
348 | .max_uV = 3200000, | 345 | .max_uV = 3200000, |
349 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | 346 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
347 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
350 | .apply_uV = 1, | 348 | .apply_uV = 1, |
351 | }, | 349 | }, |
352 | }, | 350 | }, |
@@ -355,10 +353,8 @@ struct pcf50633_platform_data gta02_pcf_pdata = { | |||
355 | .min_uV = 3000000, | 353 | .min_uV = 3000000, |
356 | .max_uV = 3000000, | 354 | .max_uV = 3000000, |
357 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | 355 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
356 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
358 | .apply_uV = 1, | 357 | .apply_uV = 1, |
359 | .state_mem = { | ||
360 | .enabled = 1, | ||
361 | }, | ||
362 | }, | 358 | }, |
363 | }, | 359 | }, |
364 | [PCF50633_REGULATOR_LDO6] = { | 360 | [PCF50633_REGULATOR_LDO6] = { |
@@ -373,9 +369,6 @@ struct pcf50633_platform_data gta02_pcf_pdata = { | |||
373 | .min_uV = 1800000, | 369 | .min_uV = 1800000, |
374 | .max_uV = 1800000, | 370 | .max_uV = 1800000, |
375 | .valid_modes_mask = REGULATOR_MODE_NORMAL, | 371 | .valid_modes_mask = REGULATOR_MODE_NORMAL, |
376 | .state_mem = { | ||
377 | .enabled = 1, | ||
378 | }, | ||
379 | }, | 372 | }, |
380 | }, | 373 | }, |
381 | 374 | ||
@@ -471,6 +464,43 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = { | |||
471 | }, | 464 | }, |
472 | }; | 465 | }; |
473 | 466 | ||
467 | /* Touchscreen */ | ||
468 | static struct s3c2410_ts_mach_info gta02_ts_info = { | ||
469 | .delay = 10000, | ||
470 | .presc = 0xff, /* slow as we can go */ | ||
471 | .oversampling_shift = 2, | ||
472 | }; | ||
473 | |||
474 | /* Buttons */ | ||
475 | static struct gpio_keys_button gta02_buttons[] = { | ||
476 | { | ||
477 | .gpio = GTA02_GPIO_AUX_KEY, | ||
478 | .code = KEY_PHONE, | ||
479 | .desc = "Aux", | ||
480 | .type = EV_KEY, | ||
481 | .debounce_interval = 100, | ||
482 | }, | ||
483 | { | ||
484 | .gpio = GTA02_GPIO_HOLD_KEY, | ||
485 | .code = KEY_PAUSE, | ||
486 | .desc = "Hold", | ||
487 | .type = EV_KEY, | ||
488 | .debounce_interval = 100, | ||
489 | }, | ||
490 | }; | ||
491 | |||
492 | static struct gpio_keys_platform_data gta02_buttons_pdata = { | ||
493 | .buttons = gta02_buttons, | ||
494 | .nbuttons = ARRAY_SIZE(gta02_buttons), | ||
495 | }; | ||
496 | |||
497 | static struct platform_device gta02_buttons_device = { | ||
498 | .name = "gpio-keys", | ||
499 | .id = -1, | ||
500 | .dev = { | ||
501 | .platform_data = >a02_buttons_pdata, | ||
502 | }, | ||
503 | }; | ||
474 | 504 | ||
475 | static void __init gta02_map_io(void) | 505 | static void __init gta02_map_io(void) |
476 | { | 506 | { |
@@ -491,7 +521,11 @@ static struct platform_device *gta02_devices[] __initdata = { | |||
491 | >a02_nor_flash, | 521 | >a02_nor_flash, |
492 | &s3c24xx_pwm_device, | 522 | &s3c24xx_pwm_device, |
493 | &s3c_device_iis, | 523 | &s3c_device_iis, |
524 | &samsung_asoc_dma, | ||
494 | &s3c_device_i2c0, | 525 | &s3c_device_i2c0, |
526 | >a02_buttons_device, | ||
527 | &s3c_device_adc, | ||
528 | &s3c_device_ts, | ||
495 | }; | 529 | }; |
496 | 530 | ||
497 | /* These guys DO need to be children of PMU. */ | 531 | /* These guys DO need to be children of PMU. */ |
@@ -541,6 +575,7 @@ static void __init gta02_machine_init(void) | |||
541 | #endif | 575 | #endif |
542 | 576 | ||
543 | s3c24xx_udc_set_platdata(>a02_udc_cfg); | 577 | s3c24xx_udc_set_platdata(>a02_udc_cfg); |
578 | s3c24xx_ts_set_platdata(>a02_ts_info); | ||
544 | s3c_ohci_set_platdata(>a02_usb_info); | 579 | s3c_ohci_set_platdata(>a02_usb_info); |
545 | s3c_nand_set_platdata(>a02_nand_info); | 580 | s3c_nand_set_platdata(>a02_nand_info); |
546 | s3c_i2c0_set_platdata(NULL); | 581 | s3c_i2c0_set_platdata(NULL); |
@@ -549,6 +584,8 @@ static void __init gta02_machine_init(void) | |||
549 | 584 | ||
550 | platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices)); | 585 | platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices)); |
551 | pm_power_off = gta02_poweroff; | 586 | pm_power_off = gta02_poweroff; |
587 | |||
588 | regulator_has_full_constraints(); | ||
552 | } | 589 | } |
553 | 590 | ||
554 | 591 | ||