23 #include <linux/i2c.h>
25 #include <linux/module.h>
50 static int __init db1200_detect_board(
void)
85 unsigned long freq0, clksrc,
div, pfc;
86 unsigned short whoami;
88 if (db1200_detect_board())
94 (whoami >> 4) & 0xf, (whoami >> 8) & 0xf, whoami & 0xf);
110 div = ((div >> 1) - 1) & 0xff;
139 .parts = db1200_spiflash_parts,
140 .nr_parts =
ARRAY_SIZE(db1200_spiflash_parts),
147 .modalias =
"tmp121",
148 .max_speed_hz = 2000000,
155 .modalias =
"m25p80",
156 .max_speed_hz = 50000000,
160 .platform_data = &db1200_spiflash_data,
172 static void au1200_nand_cmd_ctrl(
struct mtd_info *mtd,
int cmd,
178 ioaddr &= 0xffffff00;
195 static int au1200_nand_device_ready(
struct mtd_info *mtd)
204 .size = 8 * 1024 * 1024,
217 .nr_partitions =
ARRAY_SIZE(db1200_nand_parts),
218 .partitions = db1200_nand_parts,
222 .dev_ready = au1200_nand_device_ready,
223 .cmd_ctrl = au1200_nand_cmd_ctrl,
227 static struct resource db1200_nand_res[] = {
238 .resource = db1200_nand_res,
253 static struct resource db1200_eth_res[] = {
268 .platform_data = &db1200_eth_data,
273 .resource = db1200_eth_res,
278 static struct resource db1200_ide_res[] = {
299 .name =
"au1200-ide",
302 .dma_mask = &au1200_ide_dmamask,
306 .resource = db1200_ide_res,
338 static int db1200_mmc_cd_setup(
void *
mmc_host,
int en)
344 0,
"sd_insert", mmc_host);
349 0,
"sd_eject", mmc_host);
369 static void db1200_mmc_set_power(
void *mmc_host,
int state)
378 static int db1200_mmc_card_readonly(
void *mmc_host)
383 static int db1200_mmc_card_inserted(
void *mmc_host)
398 .brightness_set = db1200_mmcled_set,
403 static irqreturn_t pb1200_mmc1_cd(
int irq,
void *ptr)
405 void(*mmc_cd)(
struct mmc_host *,
unsigned long);
425 static int pb1200_mmc1_cd_setup(
void *mmc_host,
int en)
431 "sd1_insert", mmc_host);
436 "sd1_eject", mmc_host);
456 static void pb1200_mmc1led_set(
struct led_classdev *led,
466 .brightness_set = pb1200_mmc1led_set,
469 static void pb1200_mmc1_set_power(
void *mmc_host,
int state)
478 static int pb1200_mmc1_card_readonly(
void *mmc_host)
483 static int pb1200_mmc1_card_inserted(
void *mmc_host)
491 .cd_setup = db1200_mmc_cd_setup,
492 .set_power = db1200_mmc_set_power,
493 .card_inserted = db1200_mmc_card_inserted,
494 .card_readonly = db1200_mmc_card_readonly,
495 .led = &db1200_mmc_led,
498 .cd_setup = pb1200_mmc1_cd_setup,
499 .set_power = pb1200_mmc1_set_power,
500 .card_inserted = pb1200_mmc1_card_inserted,
501 .card_readonly = pb1200_mmc1_card_readonly,
502 .led = &pb1200_mmc1_led,
506 static struct resource au1200_mmc0_resources[] = {
532 .name =
"au1xxx-mmc",
535 .dma_mask = &au1xxx_mmc_dmamask,
537 .platform_data = &db1200_mmc_platdata[0],
539 .num_resources =
ARRAY_SIZE(au1200_mmc0_resources),
540 .resource = au1200_mmc0_resources,
543 static struct resource au1200_mmc1_res[] = {
567 .name =
"au1xxx-mmc",
570 .dma_mask = &au1xxx_mmc_dmamask,
572 .platform_data = &db1200_mmc_platdata[1],
575 .resource = au1200_mmc1_res,
580 static int db1200fb_panel_index(
void)
585 static int db1200fb_panel_init(
void)
593 static int db1200fb_panel_shutdown(
void)
602 .panel_index = db1200fb_panel_index,
603 .panel_init = db1200fb_panel_init,
604 .panel_shutdown = db1200fb_panel_shutdown,
607 static struct resource au1200_lcd_res[] = {
623 .name =
"au1200-lcd",
626 .dma_mask = &au1200_lcd_dmamask,
628 .platform_data = &db1200fb_pd,
631 .resource = au1200_lcd_res,
636 static struct resource au1200_psc0_res[] = {
660 .name =
"au1xpsc_smbus",
663 .resource = au1200_psc0_res,
675 .mainclk_hz = 50000000,
677 .activate_cs = db1200_spi_cs_en,
684 .dma_mask = &spi_dmamask,
686 .platform_data = &db1200_spi_platdata,
688 .name =
"au1550-spi",
691 .resource = au1200_psc0_res,
694 static struct resource au1200_psc1_res[] = {
722 .resource = au1200_psc1_res,
732 .name =
"ac97-codec",
737 .name =
"au1xpsc-pcm",
748 &db1200_audiodma_dev,
759 static int __init pb1200_res_fixup(
void)
792 if (pb1200_res_fixup())
837 db1200_devs[0] = &db1200_i2c_dev;
845 db1200_devs[0] = &db1200_spi_dev;
860 if (sw == BCSR_SWITCHES_DIP_8) {
862 db1200_audio_dev.
name =
"au1xpsc_i2s";
863 db1200_sound_dev.
name =
"db1200-i2s";
867 db1200_audio_dev.
name =
"au1xpsc_ac97";
868 db1200_sound_dev.
name =
"db1200-ac97";