17 #include <linux/kernel.h>
24 #include <linux/input.h>
43 #include <mach/hardware.h>
53 #include <video/w100fb.h>
60 #define ATI_W3220_PHYS PXA_CS2_PHYS
61 #define ASIC3_PHYS PXA_CS3_PHYS
62 #define ASIC3_SD_PHYS (PXA_CS3_PHYS + 0x02000000)
64 static unsigned long hx4700_pin_config[]
__initdata = {
170 #define INIT_KEY(_code, _gpio, _active_low, _desc) \
172 .code = KEY_##_code, \
174 .active_low = _active_low, \
190 .buttons = gpio_keys_buttons,
197 .platform_data = &gpio_keys_data,
215 .platform_data = &navpoint_platform_data,
223 static u16 asic3_gpio_config[] = {
285 .name =
"hx4700:amber",
286 .default_trigger =
"ds2760-battery.0-charging-blink-full-solid",
289 .name =
"hx4700:green",
290 .default_trigger =
"unused",
293 .name =
"hx4700:blue",
294 .default_trigger =
"hx4700-radio",
298 static struct resource asic3_resources[] = {
309 .gpio_config_num =
ARRAY_SIZE(asic3_gpio_config),
312 .clock_rate = 4000000,
319 .resource = asic3_resources,
322 .platform_data = &asic3_platform_data,
330 static struct resource egpio_resources[] = {
353 .resource = egpio_resources,
356 .platform_data = &egpio_info,
364 static void sony_lcd_init(
void)
392 static void sony_lcd_off(
void)
415 #define w3220_lcd_resume NULL
416 #define w3220_lcd_suspend NULL
426 .lcd_format = 0x00000003,
427 .lcdd_cntl1 = 0x00000000,
428 .lcdd_cntl2 = 0x0003ffff,
429 .genlcd_cntl1 = 0x00abf003,
430 .genlcd_cntl2 = 0x00000003,
431 .genlcd_cntl3 = 0x000102aa,
434 static struct w100_mode w3220_modes[] = {
442 .crtc_ss = 0x00000000,
443 .crtc_ls = 0xa1ff01f9,
444 .crtc_gs = 0xc0000000,
445 .crtc_vpos_gs = 0x0000028f,
446 .crtc_ps1_active = 0x00000000,
448 .crtc_dclk = 0x80000000,
449 .crtc_gclk = 0x040a0104,
453 .pixclk_divider_rotated = 4,
465 .crtc_ss = 0x80150014,
466 .crtc_ls = 0xa0fb00f7,
467 .crtc_gs = 0xc0080007,
468 .crtc_vpos_gs = 0x00080007,
469 .crtc_rev = 0x0000000a,
470 .crtc_dclk = 0x81700030,
471 .crtc_gclk = 0x8015010f,
472 .crtc_goe = 0x00000000,
475 .pixclk_divider_rotated = 4,
483 .ext_cntl = 0x09640011,
484 .sdram_mode_reg = 0x00600021,
485 .ext_timing_cntl = 0x1a001545,
486 .io_cntl = 0x7ddd7333,
491 .ext_mem_bw = 0x50413e01,
493 .ext_timing_ctl = 0x00043f7f,
494 .ext_cntl = 0x00000010,
495 .mode_reg = 0x00250000,
496 .io_cntl = 0x0fff0000,
497 .config = 0x08301480,
501 .init_data1 = 0xdfe00100,
502 .gpio_dir1 = 0xffff0000,
503 .gpio_oe1 = 0x00000000,
504 .init_data2 = 0x00000000,
505 .gpio_dir2 = 0x00000000,
506 .gpio_oe2 = 0x00000000,
510 .tg = &w3220_tg_info,
513 .gpio = &w3220_gpio_info,
515 .modelist = w3220_modes,
517 .xtal_freq = 16000000,
520 static struct resource w3220_resources[] = {
528 .platform_data = &w3220_info,
531 .resource = w3220_resources,
534 static void hx4700_lcd_set_power(
struct plat_lcd_data *pd,
unsigned int power)
543 .set_power = hx4700_lcd_set_power,
547 .name =
"platform-lcd",
550 .platform_data = &hx4700_lcd_data,
551 .parent = &w3220.
dev,
561 .max_brightness = 200,
562 .dft_brightness = 100,
563 .pwm_period_ns = 30923,
567 .name =
"pwm-backlight",
571 .platform_data = &backlight_data,
575 static struct pwm_lookup hx4700_pwm_lookup[] = {
586 .gpio_vbus_inverted = 1,
593 .platform_data = &gpio_vbus_info,
603 .vref_delay_usecs = 100,
604 .pressure_max = 1024,
620 .modalias =
"ads7846",
622 .max_speed_hz = 2600000,
624 .platform_data = &tsc2046_info,
625 .controller_data = &tsc2046_chip,
639 static int power_supply_init(
struct device *
dev)
644 static int hx4700_is_ac_online(
void)
649 static void power_supply_exit(
struct device *
dev)
654 static char *hx4700_supplicants[] = {
655 "ds2760-battery.0",
"backup-battery"
659 .init = power_supply_init,
660 .is_ac_online = hx4700_is_ac_online,
661 .exit = power_supply_exit,
662 .supplied_to = hx4700_supplicants,
663 .num_supplicants =
ARRAY_SIZE(hx4700_supplicants),
666 static struct resource power_supply_resources[] = {
679 .platform_data = &power_supply_info,
681 .resource = power_supply_resources,
682 .num_resources =
ARRAY_SIZE(power_supply_resources),
699 .num_consumer_supplies =
ARRAY_SIZE(bq24022_consumers),
700 .consumer_supplies = bq24022_consumers,
703 static struct gpio bq24022_gpios[] = {
708 { .value = 100000, .gpios = (0 << 0) },
709 { .value = 500000, .gpios = (1 << 0) },
713 .supply_name =
"bq24022",
717 .enabled_at_boot = 0,
719 .gpios = bq24022_gpios,
722 .states = bq24022_states,
726 .init_data = &bq24022_init_data,
730 .name =
"gpio-regulator",
733 .platform_data = &bq24022_info,
746 static struct resource strataflash_resource[] = {
753 .set_vpp = hx4700_set_vpp,
757 .name =
"physmap-flash",
759 .resource = strataflash_resource,
760 .num_resources =
ARRAY_SIZE(strataflash_resource),
762 .platform_data = &strataflash_data,
775 .name =
"vcc_core range",
781 .num_consumer_supplies = 1,
782 .consumer_supplies = &max1587a_consumer,
788 .platform_data = &max1587a_v3_info,
793 .subdevs = &max1587a_subdev,
800 .platform_data = &max1587a_info,
816 .platform_data = &ak4641_info,
821 .name =
"hx4700-audio",
845 static struct gpio global_gpios[] = {
863 static void __init hx4700_init(
void)
873 pr_err (
"hx4700: Failed to request GPIOs.\n");
897 .atag_offset = 0x100,
902 .init_machine = hx4700_init,