2 * Support for Sharp SL-C6000x PDAs
5 * Copyright (c) 2005 Dirk Opfer
7 * Based on code written by Sharp/Lineo for 2.4 kernels
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/platform_device.h>
18 #include <linux/major.h>
20 #include <linux/interrupt.h>
21 #include <linux/delay.h>
23 #include <linux/mmc/host.h>
24 #include <linux/mfd/tc6393xb.h>
25 #include <linux/mfd/tmio.h>
26 #include <linux/mtd/nand.h>
27 #include <linux/mtd/partitions.h>
28 #include <linux/mtd/physmap.h>
30 #include <linux/gpio_keys.h>
31 #include <linux/input.h>
32 #include <linux/gpio.h>
33 #include <linux/pda_power.h>
34 #include <linux/spi/spi.h>
35 #include <linux/spi/pxa2xx_spi.h>
36 #include <linux/input/matrix_keypad.h>
37 #include <linux/i2c/pxa-i2c.h>
38 #include <linux/usb/gpio_vbus.h>
40 #include <asm/setup.h>
41 #include <asm/mach-types.h>
43 #include <mach/pxa25x.h>
44 #include <mach/reset.h>
45 #include <mach/irda.h>
48 #include <mach/tosa_bt.h>
49 #include <mach/audio.h>
50 #include <mach/smemc.h>
52 #include <asm/mach/arch.h>
53 #include <mach/tosa.h>
55 #include <asm/hardware/scoop.h>
56 #include <asm/mach/sharpsl_param.h>
62 static unsigned long tosa_pin_config
[] = {
63 GPIO78_nCS_2
, /* Scoop */
64 GPIO80_nCS_4
, /* tg6393xb */
65 GPIO33_nCS_5
, /* Scoop */
67 // GPIO76 CARD_VCC_ON1
69 GPIO19_GPIO
, /* Reset out */
70 GPIO1_RST
| WAKEUP_ON_EDGE_FALL
,
72 GPIO0_GPIO
| WAKEUP_ON_EDGE_FALL
, /* WAKE_UP */
73 GPIO2_GPIO
| WAKEUP_ON_EDGE_BOTH
, /* AC_IN */
74 GPIO3_GPIO
| WAKEUP_ON_EDGE_FALL
, /* RECORD */
75 GPIO4_GPIO
| WAKEUP_ON_EDGE_FALL
, /* SYNC */
76 GPIO20_GPIO
, /* EAR_IN */
79 GPIO5_GPIO
, /* USB_IN */
80 GPIO32_GPIO
, /* Pen IRQ */
82 GPIO7_GPIO
, /* Jacket Detect */
83 GPIO14_GPIO
, /* BAT0_CRG */
84 GPIO12_GPIO
, /* BAT1_CRG */
85 GPIO17_GPIO
, /* BAT0_LOW */
86 GPIO84_GPIO
, /* BAT1_LOW */
87 GPIO38_GPIO
, /* BAT_LOCK */
90 GPIO15_GPIO
, /* TC6393XB IRQ */
92 GPIO27_GPIO
, /* LCD Sync */
97 GPIO9_GPIO
, /* Detect */
98 GPIO10_GPIO
, /* nSD_INT */
101 GPIO13_GPIO
, /* CD_IRQ */
102 GPIO21_GPIO
, /* Main Slot IRQ */
103 GPIO36_GPIO
, /* Jacket Slot IRQ */
117 GPIO30_AC97_SDATA_OUT
,
119 GPIO29_AC97_SDATA_IN_0
,
137 GPIO58_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 0 */
138 GPIO59_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 1 */
139 GPIO60_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 2 */
140 GPIO61_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 3 */
141 GPIO62_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 4 */
142 GPIO63_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 5 */
143 GPIO64_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 6 */
144 GPIO65_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 7 */
145 GPIO66_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 8 */
146 GPIO67_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 9 */
147 GPIO68_GPIO
| MFP_LPM_DRIVE_LOW
, /* Column 10 */
148 GPIO69_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 0 */
149 GPIO70_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 1 */
150 GPIO71_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 2 */
151 GPIO72_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 3 */
152 GPIO73_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 4 */
153 GPIO74_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 5 */
154 GPIO75_GPIO
| MFP_LPM_DRIVE_LOW
, /* Row 6 */
161 /* IrDA is managed in other way */
169 static struct resource tosa_scoop_resources
[] = {
171 .start
= TOSA_CF_PHYS
,
172 .end
= TOSA_CF_PHYS
+ 0xfff,
173 .flags
= IORESOURCE_MEM
,
177 static struct scoop_config tosa_scoop_setup
= {
178 .io_dir
= TOSA_SCOOP_IO_DIR
,
179 .gpio_base
= TOSA_SCOOP_GPIO_BASE
,
182 static struct platform_device tosascoop_device
= {
183 .name
= "sharp-scoop",
186 .platform_data
= &tosa_scoop_setup
,
188 .num_resources
= ARRAY_SIZE(tosa_scoop_resources
),
189 .resource
= tosa_scoop_resources
,
194 * SCOOP Device Jacket
196 static struct resource tosa_scoop_jc_resources
[] = {
198 .start
= TOSA_SCOOP_PHYS
+ 0x40,
199 .end
= TOSA_SCOOP_PHYS
+ 0xfff,
200 .flags
= IORESOURCE_MEM
,
204 static struct scoop_config tosa_scoop_jc_setup
= {
205 .io_dir
= TOSA_SCOOP_JC_IO_DIR
,
206 .gpio_base
= TOSA_SCOOP_JC_GPIO_BASE
,
209 static struct platform_device tosascoop_jc_device
= {
210 .name
= "sharp-scoop",
213 .platform_data
= &tosa_scoop_jc_setup
,
214 .parent
= &tosascoop_device
.dev
,
216 .num_resources
= ARRAY_SIZE(tosa_scoop_jc_resources
),
217 .resource
= tosa_scoop_jc_resources
,
223 static struct scoop_pcmcia_dev tosa_pcmcia_scoop
[] = {
225 .dev
= &tosascoop_device
.dev
,
226 .irq
= TOSA_IRQ_GPIO_CF_IRQ
,
227 .cd_irq
= TOSA_IRQ_GPIO_CF_CD
,
228 .cd_irq_str
= "PCMCIA0 CD",
230 .dev
= &tosascoop_jc_device
.dev
,
231 .irq
= TOSA_IRQ_GPIO_JC_CF_IRQ
,
236 static struct scoop_pcmcia_config tosa_pcmcia_config
= {
237 .devs
= &tosa_pcmcia_scoop
[0],
242 * USB Device Controller
244 static struct gpio_vbus_mach_info tosa_udc_info
= {
245 .gpio_pullup
= TOSA_GPIO_USB_PULLUP
,
246 .gpio_vbus
= TOSA_GPIO_USB_IN
,
247 .gpio_vbus_inverted
= 1,
250 static struct platform_device tosa_gpio_vbus
= {
254 .platform_data
= &tosa_udc_info
,
261 static int tosa_mci_init(struct device
*dev
, irq_handler_t tosa_detect_int
, void *data
)
265 err
= gpio_request(TOSA_GPIO_nSD_INT
, "SD Int");
267 printk(KERN_ERR
"tosa_mci_init: can't request SD_PWR gpio\n");
270 err
= gpio_direction_input(TOSA_GPIO_nSD_INT
);
272 goto err_gpio_int_dir
;
277 gpio_free(TOSA_GPIO_nSD_INT
);
282 static void tosa_mci_exit(struct device
*dev
, void *data
)
284 gpio_free(TOSA_GPIO_nSD_INT
);
287 static struct pxamci_platform_data tosa_mci_platform_data
= {
288 .detect_delay_ms
= 250,
289 .ocr_mask
= MMC_VDD_32_33
|MMC_VDD_33_34
,
290 .init
= tosa_mci_init
,
291 .exit
= tosa_mci_exit
,
292 .gpio_card_detect
= TOSA_GPIO_nSD_DETECT
,
293 .gpio_card_ro
= TOSA_GPIO_SD_WP
,
294 .gpio_power
= TOSA_GPIO_PWR_ON
,
300 static void tosa_irda_transceiver_mode(struct device
*dev
, int mode
)
303 gpio_set_value(TOSA_GPIO_IR_POWERDWN
, 0);
304 pxa2xx_transceiver_mode(dev
, mode
);
305 gpio_direction_output(TOSA_GPIO_IRDA_TX
, 0);
307 pxa2xx_transceiver_mode(dev
, mode
);
308 gpio_set_value(TOSA_GPIO_IR_POWERDWN
, 1);
312 static int tosa_irda_startup(struct device
*dev
)
316 ret
= gpio_request(TOSA_GPIO_IRDA_TX
, "IrDA TX");
319 ret
= gpio_direction_output(TOSA_GPIO_IRDA_TX
, 0);
323 ret
= gpio_request(TOSA_GPIO_IR_POWERDWN
, "IrDA powerdown");
327 ret
= gpio_direction_output(TOSA_GPIO_IR_POWERDWN
, 0);
331 tosa_irda_transceiver_mode(dev
, IR_SIRMODE
| IR_OFF
);
336 gpio_free(TOSA_GPIO_IR_POWERDWN
);
339 gpio_free(TOSA_GPIO_IRDA_TX
);
344 static void tosa_irda_shutdown(struct device
*dev
)
346 tosa_irda_transceiver_mode(dev
, IR_SIRMODE
| IR_OFF
);
347 gpio_free(TOSA_GPIO_IR_POWERDWN
);
348 gpio_free(TOSA_GPIO_IRDA_TX
);
351 static struct pxaficp_platform_data tosa_ficp_platform_data
= {
353 .transceiver_cap
= IR_SIRMODE
| IR_OFF
,
354 .transceiver_mode
= tosa_irda_transceiver_mode
,
355 .startup
= tosa_irda_startup
,
356 .shutdown
= tosa_irda_shutdown
,
362 static int tosa_power_init(struct device
*dev
)
364 int ret
= gpio_request(TOSA_GPIO_AC_IN
, "ac in");
368 ret
= gpio_direction_input(TOSA_GPIO_AC_IN
);
375 gpio_free(TOSA_GPIO_AC_IN
);
380 static void tosa_power_exit(struct device
*dev
)
382 gpio_free(TOSA_GPIO_AC_IN
);
385 static int tosa_power_ac_online(void)
387 return gpio_get_value(TOSA_GPIO_AC_IN
) == 0;
390 static char *tosa_ac_supplied_to
[] = {
396 static struct pda_power_pdata tosa_power_data
= {
397 .init
= tosa_power_init
,
398 .is_ac_online
= tosa_power_ac_online
,
399 .exit
= tosa_power_exit
,
400 .supplied_to
= tosa_ac_supplied_to
,
401 .num_supplicants
= ARRAY_SIZE(tosa_ac_supplied_to
),
404 static struct resource tosa_power_resource
[] = {
407 .start
= gpio_to_irq(TOSA_GPIO_AC_IN
),
408 .end
= gpio_to_irq(TOSA_GPIO_AC_IN
),
409 .flags
= IORESOURCE_IRQ
|
410 IORESOURCE_IRQ_HIGHEDGE
|
411 IORESOURCE_IRQ_LOWEDGE
,
415 static struct platform_device tosa_power_device
= {
418 .dev
.platform_data
= &tosa_power_data
,
419 .resource
= tosa_power_resource
,
420 .num_resources
= ARRAY_SIZE(tosa_power_resource
),
426 static const uint32_t tosakbd_keymap
[] = {
429 KEY(0, 7, KEY_BACKSPACE
),
437 KEY(1, 8, KEY_COMMA
),
443 KEY(2, 7, KEY_ENTER
),
449 KEY(3, 5, TOSA_KEY_ADDRESSBOOK
),
450 KEY(3, 6, TOSA_KEY_CANCEL
),
451 KEY(3, 7, TOSA_KEY_CENTER
),
452 KEY(3, 8, TOSA_KEY_OK
),
453 KEY(3, 9, KEY_LEFTSHIFT
),
458 KEY(4, 5, TOSA_KEY_CALENDAR
),
459 KEY(4, 6, TOSA_KEY_HOMEPAGE
),
460 KEY(4, 7, KEY_LEFTCTRL
),
461 KEY(4, 8, TOSA_KEY_LIGHT
),
462 KEY(4, 10, KEY_RIGHTSHIFT
),
464 KEY(5, 2, KEY_SLASH
),
467 KEY(5, 5, TOSA_KEY_MENU
),
469 KEY(5, 11, TOSA_KEY_FN
),
472 KEY(6, 3, KEY_SPACE
),
473 KEY(6, 4, KEY_APOSTROPHE
),
474 KEY(6, 5, TOSA_KEY_MAIL
),
477 KEY(6, 8, KEY_RIGHT
),
480 static struct matrix_keymap_data tosakbd_keymap_data
= {
481 .keymap
= tosakbd_keymap
,
482 .keymap_size
= ARRAY_SIZE(tosakbd_keymap
),
485 static const int tosakbd_col_gpios
[] =
486 { 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68 };
487 static const int tosakbd_row_gpios
[] =
488 { 69, 70, 71, 72, 73, 74, 75 };
490 static struct matrix_keypad_platform_data tosakbd_pdata
= {
491 .keymap_data
= &tosakbd_keymap_data
,
492 .row_gpios
= tosakbd_row_gpios
,
493 .col_gpios
= tosakbd_col_gpios
,
494 .num_row_gpios
= ARRAY_SIZE(tosakbd_row_gpios
),
495 .num_col_gpios
= ARRAY_SIZE(tosakbd_col_gpios
),
496 .col_scan_delay_us
= 10,
501 static struct platform_device tosakbd_device
= {
502 .name
= "matrix-keypad",
505 .platform_data
= &tosakbd_pdata
,
509 static struct gpio_keys_button tosa_gpio_keys
[] = {
511 * Two following keys are directly tied to "ON" button of tosa. Why?
512 * The first one can be used as a wakeup source, the second can't;
513 * also the first one is OR of ac_powered and on_button.
517 .code
= KEY_RESERVED
,
518 .gpio
= TOSA_GPIO_POWERON
,
526 .gpio
= TOSA_GPIO_ON_KEY
,
529 * can't be used as wakeup
536 .code
= TOSA_KEY_RECORD
,
537 .gpio
= TOSA_GPIO_RECORD_BTN
,
538 .desc
= "Record Button",
544 .code
= TOSA_KEY_SYNC
,
545 .gpio
= TOSA_GPIO_SYNC
,
546 .desc
= "Sync Button",
552 .code
= SW_HEADPHONE_INSERT
,
553 .gpio
= TOSA_GPIO_EAR_IN
,
554 .desc
= "HeadPhone insert",
556 .debounce_interval
= 300,
560 static struct gpio_keys_platform_data tosa_gpio_keys_platform_data
= {
561 .buttons
= tosa_gpio_keys
,
562 .nbuttons
= ARRAY_SIZE(tosa_gpio_keys
),
565 static struct platform_device tosa_gpio_keys_device
= {
569 .platform_data
= &tosa_gpio_keys_platform_data
,
576 static struct gpio_led tosa_gpio_leds
[] = {
578 .name
= "tosa:amber:charge",
579 .default_trigger
= "main-battery-charging",
580 .gpio
= TOSA_GPIO_CHRG_ERR_LED
,
583 .name
= "tosa:green:mail",
584 .default_trigger
= "nand-disk",
585 .gpio
= TOSA_GPIO_NOTE_LED
,
588 .name
= "tosa:dual:wlan",
589 .default_trigger
= "none",
590 .gpio
= TOSA_GPIO_WLAN_LED
,
593 .name
= "tosa:blue:bluetooth",
594 .default_trigger
= "tosa-bt",
595 .gpio
= TOSA_GPIO_BT_LED
,
599 static struct gpio_led_platform_data tosa_gpio_leds_platform_data
= {
600 .leds
= tosa_gpio_leds
,
601 .num_leds
= ARRAY_SIZE(tosa_gpio_leds
),
604 static struct platform_device tosaled_device
= {
608 .platform_data
= &tosa_gpio_leds_platform_data
,
613 * Toshiba Mobile IO Controller
615 static struct resource tc6393xb_resources
[] = {
617 .start
= TOSA_LCDC_PHYS
,
618 .end
= TOSA_LCDC_PHYS
+ 0x3ffffff,
619 .flags
= IORESOURCE_MEM
,
623 .start
= TOSA_IRQ_GPIO_TC6393XB_INT
,
624 .end
= TOSA_IRQ_GPIO_TC6393XB_INT
,
625 .flags
= IORESOURCE_IRQ
,
630 static int tosa_tc6393xb_enable(struct platform_device
*dev
)
634 rc
= gpio_request(TOSA_GPIO_TC6393XB_REST_IN
, "tc6393xb #pclr");
637 rc
= gpio_request(TOSA_GPIO_TC6393XB_SUSPEND
, "tc6393xb #suspend");
639 goto err_req_suspend
;
640 rc
= gpio_request(TOSA_GPIO_TC6393XB_L3V_ON
, "tc6393xb l3v");
643 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_L3V_ON
, 0);
646 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_SUSPEND
, 0);
648 goto err_dir_suspend
;
649 rc
= gpio_direction_output(TOSA_GPIO_TC6393XB_REST_IN
, 0);
655 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 1);
659 gpio_set_value(TOSA_GPIO_TC6393XB_REST_IN
, 1);
660 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 1);
666 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON
);
668 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND
);
670 gpio_free(TOSA_GPIO_TC6393XB_REST_IN
);
675 static int tosa_tc6393xb_disable(struct platform_device
*dev
)
677 gpio_free(TOSA_GPIO_TC6393XB_L3V_ON
);
678 gpio_free(TOSA_GPIO_TC6393XB_SUSPEND
);
679 gpio_free(TOSA_GPIO_TC6393XB_REST_IN
);
684 static int tosa_tc6393xb_resume(struct platform_device
*dev
)
686 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 1);
688 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 1);
694 static int tosa_tc6393xb_suspend(struct platform_device
*dev
)
696 gpio_set_value(TOSA_GPIO_TC6393XB_L3V_ON
, 0);
697 gpio_set_value(TOSA_GPIO_TC6393XB_SUSPEND
, 0);
701 static struct mtd_partition tosa_nand_partition
[] = {
705 .size
= 7 * 1024 * 1024,
709 .offset
= MTDPART_OFS_APPEND
,
710 .size
= 28 * 1024 * 1024,
714 .offset
= MTDPART_OFS_APPEND
,
715 .size
= MTDPART_SIZ_FULL
,
719 static uint8_t scan_ff_pattern
[] = { 0xff, 0xff };
721 static struct nand_bbt_descr tosa_tc6393xb_nand_bbt
= {
725 .pattern
= scan_ff_pattern
728 static struct tmio_nand_data tosa_tc6393xb_nand_config
= {
729 .num_partitions
= ARRAY_SIZE(tosa_nand_partition
),
730 .partition
= tosa_nand_partition
,
731 .badblock_pattern
= &tosa_tc6393xb_nand_bbt
,
734 static int tosa_tc6393xb_setup(struct platform_device
*dev
)
738 rc
= gpio_request(TOSA_GPIO_CARD_VCC_ON
, "CARD_VCC_ON");
742 rc
= gpio_direction_output(TOSA_GPIO_CARD_VCC_ON
, 1);
749 gpio_free(TOSA_GPIO_CARD_VCC_ON
);
754 static void tosa_tc6393xb_teardown(struct platform_device
*dev
)
756 gpio_free(TOSA_GPIO_CARD_VCC_ON
);
759 #ifdef CONFIG_MFD_TC6393XB
760 static struct fb_videomode tosa_tc6393xb_lcd_mode
[] = {
764 .pixclock
= 0x002cdf00,/* PLL divisor */
765 .left_margin
= 0x004c,
766 .right_margin
= 0x005b,
767 .upper_margin
= 0x0001,
768 .lower_margin
= 0x000d,
771 .sync
= FB_SYNC_HOR_HIGH_ACT
| FB_SYNC_VERT_HIGH_ACT
,
772 .vmode
= FB_VMODE_NONINTERLACED
,
776 .pixclock
= 0x00e7f203,/* PLL divisor */
777 .left_margin
= 0x0024,
778 .right_margin
= 0x002f,
779 .upper_margin
= 0x0001,
780 .lower_margin
= 0x000d,
783 .sync
= FB_SYNC_HOR_HIGH_ACT
| FB_SYNC_VERT_HIGH_ACT
,
784 .vmode
= FB_VMODE_NONINTERLACED
,
788 static struct tmio_fb_data tosa_tc6393xb_fb_config
= {
789 .lcd_set_power
= tc6393xb_lcd_set_power
,
790 .lcd_mode
= tc6393xb_lcd_mode
,
791 .num_modes
= ARRAY_SIZE(tosa_tc6393xb_lcd_mode
),
792 .modes
= &tosa_tc6393xb_lcd_mode
[0],
798 static struct tc6393xb_platform_data tosa_tc6393xb_data
= {
799 .scr_pll2cr
= 0x0cc1,
802 .irq_base
= IRQ_BOARD_START
,
803 .gpio_base
= TOSA_TC6393XB_GPIO_BASE
,
804 .setup
= tosa_tc6393xb_setup
,
805 .teardown
= tosa_tc6393xb_teardown
,
807 .enable
= tosa_tc6393xb_enable
,
808 .disable
= tosa_tc6393xb_disable
,
809 .suspend
= tosa_tc6393xb_suspend
,
810 .resume
= tosa_tc6393xb_resume
,
812 .nand_data
= &tosa_tc6393xb_nand_config
,
813 #ifdef CONFIG_MFD_TC6393XB
814 .fb_data
= &tosa_tc6393xb_fb_config
,
821 static struct platform_device tc6393xb_device
= {
825 .platform_data
= &tosa_tc6393xb_data
,
827 .num_resources
= ARRAY_SIZE(tc6393xb_resources
),
828 .resource
= tc6393xb_resources
,
831 static struct tosa_bt_data tosa_bt_data
= {
832 .gpio_pwr
= TOSA_GPIO_BT_PWR_EN
,
833 .gpio_reset
= TOSA_GPIO_BT_RESET
,
836 static struct platform_device tosa_bt_device
= {
839 .dev
.platform_data
= &tosa_bt_data
,
842 static struct pxa2xx_spi_master pxa_ssp_master_info
= {
846 static struct spi_board_info spi_board_info
[] __initdata
= {
848 .modalias
= "tosa-lcd",
850 .max_speed_hz
= 28750,
857 static struct mtd_partition sharpsl_rom_parts
[] = {
859 .name
="Boot PROM Filesystem",
860 .offset
= 0x00160000,
861 .size
= MTDPART_SIZ_FULL
,
865 static struct physmap_flash_data sharpsl_rom_data
= {
867 .nr_parts
= ARRAY_SIZE(sharpsl_rom_parts
),
868 .parts
= sharpsl_rom_parts
,
871 static struct resource sharpsl_rom_resources
[] = {
875 .flags
= IORESOURCE_MEM
,
879 static struct platform_device sharpsl_rom_device
= {
880 .name
= "physmap-flash",
882 .resource
= sharpsl_rom_resources
,
883 .num_resources
= ARRAY_SIZE(sharpsl_rom_resources
),
884 .dev
.platform_data
= &sharpsl_rom_data
,
887 static struct platform_device wm9712_device
= {
888 .name
= "wm9712-codec",
892 static struct platform_device
*devices
[] __initdata
= {
894 &tosascoop_jc_device
,
898 &tosa_gpio_keys_device
,
906 static void tosa_poweroff(void)
908 arm_machine_restart('g', NULL
);
911 static void tosa_restart(char mode
, const char *cmd
)
913 uint32_t msc0
= __raw_readl(MSC0
);
915 /* Bootloader magic for a reboot */
916 if((msc0
& 0xffff0000) == 0x7ff00000)
917 __raw_writel((msc0
& 0xffff) | 0x7ee00000, MSC0
);
922 static void __init
tosa_init(void)
926 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config
));
928 pxa_set_ffuart_info(NULL
);
929 pxa_set_btuart_info(NULL
);
930 pxa_set_stuart_info(NULL
);
932 gpio_set_wake(MFP_PIN_GPIO1
, 1);
933 /* We can't pass to gpio-keys since it will drop the Reset altfunc */
935 init_gpio_reset(TOSA_GPIO_ON_RESET
, 0, 0);
937 pm_power_off
= tosa_poweroff
;
938 arm_pm_restart
= tosa_restart
;
942 /* enable batt_fault */
945 dummy
= gpiochip_reserve(TOSA_SCOOP_GPIO_BASE
, 12);
946 dummy
= gpiochip_reserve(TOSA_SCOOP_JC_GPIO_BASE
, 12);
947 dummy
= gpiochip_reserve(TOSA_TC6393XB_GPIO_BASE
, 16);
949 pxa_set_mci_info(&tosa_mci_platform_data
);
950 pxa_set_ficp_info(&tosa_ficp_platform_data
);
951 pxa_set_i2c_info(NULL
);
952 pxa_set_ac97_info(NULL
);
953 platform_scoop_config
= &tosa_pcmcia_config
;
955 pxa2xx_set_spi_info(2, &pxa_ssp_master_info
);
956 spi_register_board_info(spi_board_info
, ARRAY_SIZE(spi_board_info
));
958 clk_add_alias("CLK_CK3P6MI", tc6393xb_device
.name
, "GPIO11_CLK", NULL
);
960 platform_add_devices(devices
, ARRAY_SIZE(devices
));
963 static void __init
fixup_tosa(struct tag
*tags
, char **cmdline
,
966 sharpsl_save_param();
968 mi
->bank
[0].start
= 0xa0000000;
969 mi
->bank
[0].size
= (64*1024*1024);
972 MACHINE_START(TOSA
, "SHARP Tosa")
974 .map_io
= pxa25x_map_io
,
975 .nr_irqs
= TOSA_NR_IRQS
,
976 .init_irq
= pxa25x_init_irq
,
977 .handle_irq
= pxa25x_handle_irq
,
978 .init_machine
= tosa_init
,