20 #include <linux/kernel.h>
25 #include <linux/input.h>
31 #include <linux/sched.h>
33 #include <linux/i2c.h>
64 #define GPIO_ON_OFF (14)
65 #define GPIO_VOLENC_A (19)
66 #define GPIO_VOLENC_B (20)
67 #define GPIO_CHARGE_DONE (23)
68 #define GPIO_CHARGE_IND (27)
69 #define GPIO_TOUCH_IRQ (32)
70 #define GPIO_ETH_IRQ (40)
71 #define GPIO_SPI_MISO (98)
72 #define GPIO_ACCEL_IRQ (104)
73 #define GPIO_RESCUE_BOOT (115)
74 #define GPIO_DOCK_DETECT (116)
75 #define GPIO_KEY1 (117)
76 #define GPIO_KEY2 (118)
77 #define GPIO_KEY3 (119)
78 #define GPIO_CHARGE_USB_OK (112)
79 #define GPIO_CHARGE_DC_OK (101)
80 #define GPIO_CHARGE_USB_SUSP (102)
83 #define GPIO_SHUTDOWN_SUPPLY (16)
84 #define GPIO_SHUTDOWN_BATT (18)
85 #define GPIO_CHRG_PEN2 (31)
86 #define GPIO_TFT_VA_EN (33)
87 #define GPIO_SPDIF_CS (34)
88 #define GPIO_LED2 (35)
89 #define GPIO_LED1 (36)
90 #define GPIO_SPDIF_RESET (38)
91 #define GPIO_SPI_CLK (95)
92 #define GPIO_MCLK_DAC_CS (96)
93 #define GPIO_SPI_MOSI (97)
94 #define GPIO_W1_PULLUP_ENABLE (105)
95 #define GPIO_DISPLAY_ENABLE (106)
96 #define GPIO_MCLK_RESET (111)
97 #define GPIO_W2W_RESET (113)
98 #define GPIO_W2W_PDN (114)
99 #define GPIO_CODEC_RESET (120)
100 #define GPIO_AUDIO_VA_ENABLE (124)
101 #define GPIO_ACCEL_CS (125)
102 #define GPIO_ONE_WIRE (126)
290 static struct resource smc91x_resources[] = {
313 .num_resources =
ARRAY_SIZE(smc91x_resources),
314 .resource = smc91x_resources,
316 .platform_data = &raumfeld_smsc911x_config,
326 .name =
"Bootloader",
332 .name =
"BootloaderEnvironment",
337 .name =
"BootloaderSplashScreen",
352 .parts[0] = raumfeld_nand_partitions,
353 .nr_parts[0] =
ARRAY_SIZE(raumfeld_nand_partitions),
380 .name =
"rotary-encoder",
383 .platform_data = &raumfeld_rotary_encoder_info,
398 .debounce_interval = 5,
407 .debounce_interval = 5,
416 .debounce_interval = 5,
425 .debounce_interval = 5,
426 .desc =
"rescue boot button",
434 .debounce_interval = 5,
435 .desc =
"dock detect",
443 .debounce_interval = 5,
444 .desc =
"on_off button",
458 .platform_data = &gpio_keys_platform_data,
466 static struct gpio_led raumfeld_leds[] = {
468 .name =
"raumfeld:1",
474 .name =
"raumfeld:2",
482 .leds = raumfeld_leds,
490 .platform_data = &raumfeld_led_platform_data,
498 static void w1_enable_external_pullup(
int enable)
507 .enable_external_pullup = w1_enable_external_pullup,
513 .platform_data = &w1_gpio_platform_data
517 static void __init raumfeld_w1_init(
void)
520 "W1 external pullup enable");
523 pr_warning(
"Unable to request GPIO_W1_PULLUP_ENABLE\n");
537 .max_brightness = 100,
538 .dft_brightness = 100,
540 .pwm_period_ns = 10000,
544 .name =
"pwm-backlight",
547 .platform_data = &raumfeld_pwm_backlight_data,
552 static struct gpio_led raumfeld_lt3593_led = {
559 .leds = &raumfeld_lt3593_led,
564 .name =
"leds-lt3593",
567 .platform_data = &raumfeld_lt3593_platform_data,
586 .modes = &sharp_lq043t3dx02_mode,
588 .video_mem_size = 0x400000,
590 #ifdef CONFIG_PXA3XX_GCU
591 .acceleration_enabled = 1,
595 static void __init raumfeld_lcd_init(
void)
601 pr_warning(
"Unable to request GPIO_TFT_VA_EN\n");
609 pr_warning(
"Unable to request GPIO_DISPLAY_ENABLE\n");
619 pxa3xx_mfp_config(&raumfeld_pwm_pin_config, 1);
655 .click_thresh_x = 10,
656 .click_thresh_y = 10,
657 .click_thresh_z = 10,
662 .modalias = "ak4104-codec", \
663 .max_speed_hz = 10000, \
666 .controller_data = (void *) GPIO_SPDIF_CS, \
671 .modalias = "lis3lv02d_spi", \
672 .max_speed_hz = 1000000, \
675 .controller_data = (void *) GPIO_ACCEL_CS, \
676 .platform_data = &lis3_pdata, \
677 .irq = PXA_GPIO_TO_IRQ(GPIO_ACCEL_IRQ), \
680 #define SPI_DAC7512 \
682 .modalias = "dac7512", \
683 .max_speed_hz = 1000000, \
686 .controller_data = (void *) GPIO_MCLK_DAC_CS, \
698 static struct spi_board_info controller_spi_devices[] __initdata = {
714 static void raumfeld_mci_exit(
struct device *
dev,
void *
data)
721 .init = raumfeld_mci_init,
722 .exit = raumfeld_mci_exit,
723 .detect_delay_ms = 200,
724 .gpio_card_detect = -1,
733 static int power_supply_init(
struct device *
dev)
738 static void power_supply_exit(
struct device *
dev)
742 static int raumfeld_is_ac_online(
void)
747 static int raumfeld_is_usb_online(
void)
752 static char *raumfeld_power_supplicants[] = {
"ds2760-battery.0" };
754 static void raumfeld_power_signal_charged(
void)
763 static int raumfeld_power_resume(
void)
767 raumfeld_power_signal_charged();
773 .init = power_supply_init,
774 .is_ac_online = raumfeld_is_ac_online,
775 .is_usb_online = raumfeld_is_usb_online,
776 .exit = power_supply_exit,
777 .supplied_to = raumfeld_power_supplicants,
778 .num_supplicants =
ARRAY_SIZE(raumfeld_power_supplicants),
779 .resume = raumfeld_power_resume,
782 static struct resource power_supply_resources[] = {
794 raumfeld_power_signal_charged();
802 .platform_data = &power_supply_info,
804 .resource = power_supply_resources,
805 .num_resources =
ARRAY_SIZE(power_supply_resources),
808 static void __init raumfeld_power_init(
void)
815 pr_warning(
"Unable to request GPIO_CHRG_PEN2\n");
821 pr_warning(
"Unable to request GPIO_CHARGE_DC_OK\n");
825 pr_warning(
"Unable to request GPIO_CHARGE_USB_SUSP\n");
834 "charge_done",
NULL);
849 .consumer_supplies = &audio_va_consumer_supply,
850 .num_consumer_supplies = 1,
857 .supply_name =
"audio_va",
858 .microvolts = 5000000,
861 .enabled_at_boot = 0,
866 .name =
"reg-fixed-voltage",
869 .platform_data = &audio_va_config,
881 .consumer_supplies = audio_dummy_supplies,
882 .num_consumer_supplies =
ARRAY_SIZE(audio_dummy_supplies),
889 .supply_name =
"audio_vd",
890 .microvolts = 3300000,
896 .name =
"reg-fixed-voltage",
899 .platform_data = &audio_dummy_config,
905 &audio_supply_dummy_device,
924 .consumer_supplies = &vcc_mmc_supply,
925 .num_consumer_supplies = 1,
931 .platform_data = &vcc_mmc_init_data,
946 .platform_data = &max8660_pdata,
949 static struct i2c_board_info raumfeld_connector_i2c_board_info __initdata = {
955 .irq_active_high = 1,
959 static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = {
962 .platform_data = &eeti_ts_pdata,
966 &raumfeld_gpio_keys_device,
967 &raumfeld_led_device,
968 &raumfeld_spi_device,
971 static void __init raumfeld_audio_init(
void)
977 pr_warning(
"unable to request GPIO_CODEC_RESET\n");
983 pr_warning(
"unable to request GPIO_SPDIF_RESET\n");
989 pr_warning(
"unable to request GPIO_MCLK_RESET\n");
996 static void __init raumfeld_common_init(
void)
1004 for (i = 0; i <
ARRAY_SIZE(gpio_keys_button); i++)
1005 if (!
strcmp(gpio_keys_button[i].
desc,
"on_off button"))
1006 gpio_keys_button[i].active_low = 1;
1020 pr_warning(
"Unable to request GPIO_W2W_RESET\n");
1026 pr_warning(
"Unable to request GPIO_W2W_PDN\n");
1033 pr_warning(
"Unable to request GPIO_SHUTDOWN_SUPPLY\n");
1041 static void __init raumfeld_controller_init(
void)
1045 pxa3xx_mfp_config(
ARRAY_AND_SIZE(raumfeld_controller_pin_config));
1052 pr_warning(
"Unable to request GPIO_SHUTDOWN_BATT\n");
1056 raumfeld_common_init();
1057 raumfeld_power_init();
1058 raumfeld_lcd_init();
1062 static void __init raumfeld_connector_init(
void)
1064 pxa3xx_mfp_config(
ARRAY_AND_SIZE(raumfeld_connector_pin_config));
1070 raumfeld_audio_init();
1071 raumfeld_common_init();
1074 static void __init raumfeld_speaker_init(
void)
1083 raumfeld_audio_init();
1084 raumfeld_common_init();
1088 #define RAUMFELD_SDRAM_BASE 0xa0000000
1090 #ifdef CONFIG_MACH_RAUMFELD_RC
1092 .atag_offset = 0x100,
1093 .init_machine = raumfeld_controller_init,
1103 #ifdef CONFIG_MACH_RAUMFELD_CONNECTOR
1105 .atag_offset = 0x100,
1106 .init_machine = raumfeld_connector_init,
1116 #ifdef CONFIG_MACH_RAUMFELD_SPEAKER
1118 .atag_offset = 0x100,
1119 .init_machine = raumfeld_speaker_init,