15 #include <linux/kernel.h>
26 #include <linux/i2c.h>
35 #include <linux/module.h>
36 #include <video/w100fb.h>
38 #include <asm/setup.h>
39 #include <asm/memory.h>
41 #include <mach/hardware.h>
61 static unsigned long corgi_pin_config[]
__initdata = {
149 static struct resource corgi_scoop_resources[] = {
164 .name =
"sharp-scoop",
167 .platform_data = &corgi_scoop_setup,
169 .num_resources =
ARRAY_SIZE(corgi_scoop_resources),
170 .resource = corgi_scoop_resources,
175 .dev = &corgiscoop_device.
dev,
178 .cd_irq_str =
"PCMCIA0 CD",
183 .devs = &corgi_pcmcia_scoop[0],
188 .ext_cntl = 0x00040003,
189 .sdram_mode_reg = 0x00650021,
190 .ext_timing_cntl = 0x10002a4a,
191 .io_cntl = 0x7ff87012,
196 .lcd_format = 0x00000003,
197 .lcdd_cntl1 = 0x01CC0000,
198 .lcdd_cntl2 = 0x0003FFFF,
199 .genlcd_cntl1 = 0x00FFFF0D,
200 .genlcd_cntl2 = 0x003F3003,
201 .genlcd_cntl3 = 0x000102aa,
205 .init_data1 = 0x000000bf,
206 .init_data2 = 0x00000000,
207 .gpio_dir1 = 0x00000000,
208 .gpio_oe1 = 0x03c0feff,
209 .gpio_dir2 = 0x00000000,
210 .gpio_oe2 = 0x00000000,
213 static struct w100_mode corgi_fb_modes[] = {
218 .right_margin = 0x55,
219 .upper_margin = 0x03,
220 .lower_margin = 0x00,
221 .crtc_ss = 0x82360056,
222 .crtc_ls = 0xA0280000,
223 .crtc_gs = 0x80280028,
224 .crtc_vpos_gs = 0x02830002,
225 .crtc_rev = 0x00400008,
226 .crtc_dclk = 0xA0000000,
227 .crtc_gclk = 0x8015010F,
228 .crtc_goe = 0x80100110,
229 .crtc_ps1_active = 0x41060010,
231 .fast_pll_freq = 100,
236 .pixclk_divider_rotated = 6,
241 .right_margin = 0x2e,
242 .upper_margin = 0x01,
243 .lower_margin = 0x00,
244 .crtc_ss = 0x81170027,
245 .crtc_ls = 0xA0140000,
246 .crtc_gs = 0xC0140014,
247 .crtc_vpos_gs = 0x00010141,
248 .crtc_rev = 0x00400008,
249 .crtc_dclk = 0xA0000000,
250 .crtc_gclk = 0x8015010F,
251 .crtc_goe = 0x80100110,
252 .crtc_ps1_active = 0x41060010,
259 .pixclk_divider_rotated = 1,
266 .mem = &corgi_fb_mem,
267 .regs = &corgi_fb_regs,
268 .modelist = &corgi_fb_modes[0],
270 .gpio = &corgi_fb_gpio,
271 .xtal_freq = 12500000,
275 static struct resource corgi_fb_resources[] = {
286 .num_resources =
ARRAY_SIZE(corgi_fb_resources),
287 .resource = corgi_fb_resources,
289 .platform_data = &corgi_fb_info,
297 #define CORGI_KEY_CALENDER KEY_F1
298 #define CORGI_KEY_ADDRESS KEY_F2
299 #define CORGI_KEY_FN KEY_F3
300 #define CORGI_KEY_CANCEL KEY_F4
301 #define CORGI_KEY_OFF KEY_SUSPEND
302 #define CORGI_KEY_EXOK KEY_F5
303 #define CORGI_KEY_EXCANCEL KEY_F6
304 #define CORGI_KEY_EXJOGDOWN KEY_F7
305 #define CORGI_KEY_EXJOGUP KEY_F8
306 #define CORGI_KEY_JAP1 KEY_LEFTCTRL
307 #define CORGI_KEY_JAP2 KEY_LEFTALT
308 #define CORGI_KEY_MAIL KEY_F10
309 #define CORGI_KEY_OK KEY_F11
310 #define CORGI_KEY_MENU KEY_F12
312 static const uint32_t corgikbd_keymap[] = {
380 .keymap = corgikbd_keymap,
384 static const int corgikbd_row_gpios[] =
385 { 58, 59, 60, 61, 62, 63, 64, 65 };
386 static const int corgikbd_col_gpios[] =
387 { 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77 };
390 .keymap_data = &corgikbd_keymap_data,
391 .row_gpios = corgikbd_row_gpios,
392 .col_gpios = corgikbd_col_gpios,
393 .num_row_gpios =
ARRAY_SIZE(corgikbd_row_gpios),
394 .num_col_gpios =
ARRAY_SIZE(corgikbd_col_gpios),
395 .col_scan_delay_us = 10,
401 .name =
"matrix-keypad",
404 .platform_data = &corgikbd_pdata,
411 static struct gpio_led corgi_gpio_leds[] = {
413 .name =
"corgi:amber:charge",
414 .default_trigger =
"sharpsl-charge",
418 .name =
"corgi:green:mail",
419 .default_trigger =
"nand-disk",
425 .leds = corgi_gpio_leds,
433 .platform_data = &corgi_gpio_leds_info,
441 .name =
"corgi-audio",
452 .detect_delay_ms = 250,
477 #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MASTER)
482 static void corgi_wait_for_hsync(
void)
493 .vref_delay_usecs = 100,
497 .wait_for_sync = corgi_wait_for_hsync,
504 static void corgi_bl_kick_battery(
void)
517 .max_intensity = 0x2f,
518 .default_intensity = 0x1f,
521 .gpio_backlight_on = -1,
522 .kick_battery = corgi_bl_kick_battery,
536 .max_speed_hz = 1200000,
539 .platform_data = &corgi_ads7846_info,
540 .controller_data= &corgi_ads7846_chip,
543 .modalias =
"corgi-lcd",
544 .max_speed_hz = 50000,
547 .platform_data = &corgi_lcdcon_info,
548 .controller_data= &corgi_lcdcon_chip,
550 .modalias =
"max1111",
551 .max_speed_hz = 450000,
554 .controller_data= &corgi_max1111_chip,
558 static void __init corgi_init_spi(
void)
564 static inline void corgi_init_spi(
void) {}
569 .name =
"System Area",
571 .size = 7 * 1024 * 1024,
574 .name =
"Root Filesystem",
575 .offset = 7 * 1024 * 1024,
576 .size = 25 * 1024 * 1024,
579 .name =
"Home Filesystem",
585 static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
591 .pattern = scan_ff_pattern
596 .partitions = sharpsl_nand_partitions,
597 .nr_partitions =
ARRAY_SIZE(sharpsl_nand_partitions),
600 static struct resource sharpsl_nand_resources[] = {
609 .name =
"sharpsl-nand",
611 .resource = sharpsl_nand_resources,
612 .num_resources =
ARRAY_SIZE(sharpsl_nand_resources),
613 .dev.platform_data = &sharpsl_nand_platform_data,
618 .name =
"Boot PROM Filesystem",
619 .offset = 0x00120000,
627 .parts = sharpsl_rom_parts,
630 static struct resource sharpsl_rom_resources[] = {
639 .name =
"physmap-flash",
641 .resource = sharpsl_rom_resources,
642 .num_resources =
ARRAY_SIZE(sharpsl_rom_resources),
643 .dev.platform_data = &sharpsl_rom_data,
652 &sharpsl_nand_device,
660 static void corgi_poweroff(
void)
662 if (!machine_is_corgi())
669 static void corgi_restart(
char mode,
const char *
cmd)
671 if (!machine_is_corgi())
678 static void __init corgi_init(
void)
693 if (!machine_is_corgi())
710 if (machine_is_husky())
711 sharpsl_nand_partitions[1].
size = 53 * 1024 * 1024;
721 mi->
bank[0].start = 0xa0000000;
722 if (machine_is_corgi())
723 mi->
bank[0].size = (32*1024*1024);
725 mi->
bank[0].size = (64*1024*1024);
728 #ifdef CONFIG_MACH_CORGI
730 .fixup = fixup_corgi,
735 .init_machine = corgi_init,
737 .restart = corgi_restart,
741 #ifdef CONFIG_MACH_SHEPHERD
743 .fixup = fixup_corgi,
748 .init_machine = corgi_init,
750 .restart = corgi_restart,
754 #ifdef CONFIG_MACH_HUSKY
756 .fixup = fixup_corgi,
761 .init_machine = corgi_init,
763 .restart = corgi_restart,