15 #include <linux/kernel.h>
21 #include <linux/i2c.h>
33 #include <linux/module.h>
35 #include <asm/setup.h>
43 #include <mach/reset.h>
58 static unsigned long spitz_pin_config[]
__initdata = {
137 #if defined(CONFIG_SHARP_SCOOP) || defined(CONFIG_SHARP_SCOOP_MODULE)
139 static struct resource spitz_scoop_1_resources[] = {
156 .
name =
"sharp-scoop",
159 .platform_data = &spitz_scoop_1_setup,
161 .num_resources =
ARRAY_SIZE(spitz_scoop_1_resources),
162 .resource = spitz_scoop_1_resources,
166 static struct resource spitz_scoop_2_resources[] = {
183 .
name =
"sharp-scoop",
186 .platform_data = &spitz_scoop_2_setup,
188 .num_resources =
ARRAY_SIZE(spitz_scoop_2_resources),
189 .resource = spitz_scoop_2_resources,
192 static void __init spitz_scoop_init(
void)
197 if (!machine_is_akita())
216 if (enable & new_cpr)
232 static inline void spitz_scoop_init(
void) {}
233 static inline void spitz_card_pwr_ctrl(
uint8_t enable,
uint8_t new_cpr) {}
239 #if defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE)
252 .
dev = &spitz_scoop_1_device.
dev,
255 .cd_irq_str =
"PCMCIA0 CD",
257 .dev = &spitz_scoop_2_device.
dev,
264 .
devs = &spitz_pcmcia_scoop[0],
266 .power_ctrl = spitz_pcmcia_pwr,
269 static void __init spitz_pcmcia_init(
void)
272 if (machine_is_akita())
278 static inline void spitz_pcmcia_init(
void) {}
284 #if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE)
286 #define SPITZ_KEY_CALENDAR KEY_F1
287 #define SPITZ_KEY_ADDRESS KEY_F2
288 #define SPITZ_KEY_FN KEY_F3
289 #define SPITZ_KEY_CANCEL KEY_F4
290 #define SPITZ_KEY_EXOK KEY_F5
291 #define SPITZ_KEY_EXCANCEL KEY_F6
292 #define SPITZ_KEY_EXJOGDOWN KEY_F7
293 #define SPITZ_KEY_EXJOGUP KEY_F8
294 #define SPITZ_KEY_JAP1 KEY_LEFTALT
295 #define SPITZ_KEY_JAP2 KEY_RIGHTCTRL
296 #define SPITZ_KEY_SYNC KEY_F9
297 #define SPITZ_KEY_MAIL KEY_F10
298 #define SPITZ_KEY_OK KEY_F11
299 #define SPITZ_KEY_MENU KEY_F12
301 static const uint32_t spitz_keymap[] = {
311 KEY(0, 9, SPITZ_KEY_EXOK),
312 KEY(0, 10, SPITZ_KEY_EXCANCEL),
321 KEY(1, 9, SPITZ_KEY_EXJOGDOWN),
322 KEY(1, 10, SPITZ_KEY_EXJOGUP),
331 KEY(3, 0, SPITZ_KEY_ADDRESS),
340 KEY(4, 0, SPITZ_KEY_CALENDAR),
349 KEY(5, 0, SPITZ_KEY_MAIL),
356 KEY(5, 10, SPITZ_KEY_FN),
358 KEY(6, 1, SPITZ_KEY_JAP1),
359 KEY(6, 2, SPITZ_KEY_JAP2),
360 KEY(6, 3, SPITZ_KEY_CANCEL),
361 KEY(6, 4, SPITZ_KEY_OK),
362 KEY(6, 5, SPITZ_KEY_MENU),
373 static const uint32_t spitz_row_gpios[] =
374 { 12, 17, 91, 34, 36, 38, 39 };
375 static const uint32_t spitz_col_gpios[] =
376 { 88, 23, 24, 25, 26, 27, 52, 103, 107, 108, 114 };
380 .row_gpios = spitz_row_gpios,
381 .col_gpios = spitz_col_gpios,
384 .col_scan_delay_us = 10,
390 .
name =
"matrix-keypad",
393 .platform_data = &spitz_mkp_pdata,
397 static void __init spitz_mkp_init(
void)
402 static inline void spitz_mkp_init(
void) {}
408 #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
422 .desc =
"Display Down",
428 .desc =
"Lid Closed",
441 .platform_data = &spitz_gpio_keys_platform_data,
445 static void __init spitz_keys_init(
void)
450 static inline void spitz_keys_init(
void) {}
456 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
457 static struct gpio_led spitz_gpio_leds[] = {
459 .
name =
"spitz:amber:charge",
460 .default_trigger =
"sharpsl-charge",
464 .name =
"spitz:green:hddactivity",
465 .default_trigger =
"ide-disk",
471 .
leds = spitz_gpio_leds,
479 .platform_data = &spitz_gpio_leds_info,
483 static void __init spitz_leds_init(
void)
488 static inline void spitz_leds_init(
void) {}
494 #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
495 static void spitz_ads7846_wait_for_hsync(
void)
506 .vref_delay_usecs = 100,
509 .pressure_max = 1024,
511 .wait_for_sync = spitz_ads7846_wait_for_hsync,
518 static void spitz_bl_kick_battery(
void)
531 .max_intensity = 0x2f,
532 .default_intensity = 0x1f,
536 .kick_battery = spitz_bl_kick_battery,
550 .max_speed_hz = 1200000,
553 .platform_data = &spitz_ads7846_info,
554 .controller_data = &spitz_ads7846_chip,
557 .modalias =
"corgi-lcd",
558 .max_speed_hz = 50000,
561 .platform_data = &spitz_lcdcon_info,
562 .controller_data = &spitz_lcdcon_chip,
564 .modalias =
"max1111",
565 .max_speed_hz = 450000,
568 .controller_data = &spitz_max1111_chip,
576 static void __init spitz_spi_init(
void)
580 if (machine_is_akita()) {
589 static inline void spitz_spi_init(
void) {}
595 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
600 static void spitz_mci_setpower(
struct device *
dev,
unsigned int vdd)
613 .setpower = spitz_mci_setpower,
619 static void __init spitz_mmc_init(
void)
624 static inline void spitz_mmc_init(
void) {}
630 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
631 static int spitz_ohci_init(
struct device *dev)
645 static void spitz_ohci_exit(
struct device *dev)
652 .init = spitz_ohci_init,
653 .exit = spitz_ohci_exit,
658 static void __init spitz_uhc_init(
void)
663 static inline void spitz_uhc_init(
void) {}
669 #if defined(CONFIG_PXA_FICP) || defined(CONFIG_PXA_FICP_MODULE)
674 static void __init spitz_irda_init(
void)
676 if (machine_is_akita())
684 static inline void spitz_irda_init(
void) {}
690 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
720 .
modes = spitz_pxafb_modes,
726 static void __init spitz_lcd_init(
void)
731 static inline void spitz_lcd_init(
void) {}
737 #if defined(CONFIG_MTD_NAND_SHARPSL) || defined(CONFIG_MTD_NAND_SHARPSL_MODULE)
740 .
name =
"System Area",
742 .size = 7 * 1024 * 1024,
744 .name =
"Root Filesystem",
745 .offset = 7 * 1024 * 1024,
747 .name =
"Home Filesystem",
753 static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
759 .pattern = scan_ff_pattern
766 0x05, 0x01, 0x02, 0x03, 0x06, 0x07, 0x15, 0x11,
767 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
768 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37,
774 .partitions = spitz_nand_partitions,
775 .nr_partitions =
ARRAY_SIZE(spitz_nand_partitions),
778 static struct resource spitz_nand_resources[] = {
787 .
name =
"sharpsl-nand",
789 .resource = spitz_nand_resources,
790 .num_resources =
ARRAY_SIZE(spitz_nand_resources),
792 .platform_data = &spitz_nand_pdata,
796 static void __init spitz_nand_init(
void)
798 if (machine_is_spitz()) {
799 spitz_nand_partitions[1].
size = 5 * 1024 * 1024;
800 }
else if (machine_is_akita()) {
801 spitz_nand_partitions[1].
size = 58 * 1024 * 1024;
802 spitz_nand_bbt.
len = 1;
804 }
else if (machine_is_borzoi()) {
805 spitz_nand_partitions[1].
size = 32 * 1024 * 1024;
806 spitz_nand_bbt.
len = 1;
813 static inline void spitz_nand_init(
void) {}
819 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
822 .
name =
"Boot PROM Filesystem",
823 .offset = 0x00140000,
831 .parts = spitz_rom_parts,
834 static struct resource spitz_rom_resources[] = {
843 .
name =
"physmap-flash",
845 .resource = spitz_rom_resources,
846 .num_resources =
ARRAY_SIZE(spitz_rom_resources),
848 .platform_data = &spitz_rom_data,
852 static void __init spitz_nor_init(
void)
857 static inline void spitz_nor_init(
void) {}
863 #if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
875 .platform_data = &akita_pca953x_pdata,
886 .name =
"vcc_core range",
892 .consumer_supplies = isl6271a_consumers,
893 .num_consumer_supplies =
ARRAY_SIZE(isl6271a_consumers),
901 .platform_data = &isl6271a_info,
905 static void __init spitz_i2c_init(
void)
910 if (!machine_is_akita())
919 static inline void spitz_i2c_init(
void) {}
925 static void spitz_poweroff(
void)
930 static void spitz_restart(
char mode,
const char *
cmd)
934 if ((msc0 & 0xffff0000) == 0x7ff00000)
940 static void __init spitz_init(
void)
976 mi->
bank[0].start = 0xa0000000;
977 mi->
bank[0].size = (64*1024*1024);
980 #ifdef CONFIG_MACH_SPITZ
983 .fixup = spitz_fixup,
988 .init_machine = spitz_init,
990 .restart = spitz_restart,
994 #ifdef CONFIG_MACH_BORZOI
997 .fixup = spitz_fixup,
1002 .init_machine = spitz_init,
1004 .restart = spitz_restart,
1008 #ifdef CONFIG_MACH_AKITA
1010 .restart_mode =
'g',
1011 .fixup = spitz_fixup,
1016 .init_machine = spitz_init,
1018 .restart = spitz_restart,