diff options
Diffstat (limited to 'arch/mips/alchemy')
-rw-r--r-- | arch/mips/alchemy/devboards/db1200/platform.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/mips/alchemy/devboards/db1200/platform.c b/arch/mips/alchemy/devboards/db1200/platform.c index 5a6ef8deda10..d6b3e64376c0 100644 --- a/arch/mips/alchemy/devboards/db1200/platform.c +++ b/arch/mips/alchemy/devboards/db1200/platform.c | |||
@@ -399,12 +399,43 @@ static struct platform_device db1200_spi_dev = { | |||
399 | .resource = au1200_psc0_res, | 399 | .resource = au1200_psc0_res, |
400 | }; | 400 | }; |
401 | 401 | ||
402 | static struct resource au1200_psc1_res[] = { | ||
403 | [0] = { | ||
404 | .start = PSC1_PHYS_ADDR, | ||
405 | .end = PSC1_PHYS_ADDR + 0x000fffff, | ||
406 | .flags = IORESOURCE_MEM, | ||
407 | }, | ||
408 | [1] = { | ||
409 | .start = AU1200_PSC1_INT, | ||
410 | .end = AU1200_PSC1_INT, | ||
411 | .flags = IORESOURCE_IRQ, | ||
412 | }, | ||
413 | [2] = { | ||
414 | .start = DSCR_CMD0_PSC1_TX, | ||
415 | .end = DSCR_CMD0_PSC1_TX, | ||
416 | .flags = IORESOURCE_DMA, | ||
417 | }, | ||
418 | [3] = { | ||
419 | .start = DSCR_CMD0_PSC1_RX, | ||
420 | .end = DSCR_CMD0_PSC1_RX, | ||
421 | .flags = IORESOURCE_DMA, | ||
422 | }, | ||
423 | }; | ||
424 | |||
425 | static struct platform_device db1200_audio_dev = { | ||
426 | /* name assigned later based on switch setting */ | ||
427 | .id = 1, /* PSC ID */ | ||
428 | .num_resources = ARRAY_SIZE(au1200_psc1_res), | ||
429 | .resource = au1200_psc1_res, | ||
430 | }; | ||
431 | |||
402 | static struct platform_device *db1200_devs[] __initdata = { | 432 | static struct platform_device *db1200_devs[] __initdata = { |
403 | NULL, /* PSC0, selected by S6.8 */ | 433 | NULL, /* PSC0, selected by S6.8 */ |
404 | &db1200_ide_dev, | 434 | &db1200_ide_dev, |
405 | &db1200_eth_dev, | 435 | &db1200_eth_dev, |
406 | &db1200_rtc_dev, | 436 | &db1200_rtc_dev, |
407 | &db1200_nand_dev, | 437 | &db1200_nand_dev, |
438 | &db1200_audio_dev, | ||
408 | }; | 439 | }; |
409 | 440 | ||
410 | static int __init db1200_dev_init(void) | 441 | static int __init db1200_dev_init(void) |
@@ -419,6 +450,7 @@ static int __init db1200_dev_init(void) | |||
419 | ARRAY_SIZE(db1200_i2c_devs)); | 450 | ARRAY_SIZE(db1200_i2c_devs)); |
420 | 451 | ||
421 | /* SWITCHES: S6.8 I2C/SPI selector (OFF=I2C ON=SPI) | 452 | /* SWITCHES: S6.8 I2C/SPI selector (OFF=I2C ON=SPI) |
453 | * S6.7 AC97/I2S selector (OFF=AC97 ON=I2S) | ||
422 | */ | 454 | */ |
423 | 455 | ||
424 | /* NOTE: GPIO215 controls OTG VBUS supply. In SPI mode however | 456 | /* NOTE: GPIO215 controls OTG VBUS supply. In SPI mode however |
@@ -456,6 +488,25 @@ static int __init db1200_dev_init(void) | |||
456 | __raw_writel(pfc, (void __iomem *)SYS_PINFUNC); | 488 | __raw_writel(pfc, (void __iomem *)SYS_PINFUNC); |
457 | wmb(); | 489 | wmb(); |
458 | 490 | ||
491 | /* Audio: DIP7 selects I2S(0)/AC97(1), but need I2C for I2S! | ||
492 | * so: DIP7=1 || DIP8=0 => AC97, DIP7=0 && DIP8=1 => I2S | ||
493 | */ | ||
494 | sw &= BCSR_SWITCHES_DIP_8 | BCSR_SWITCHES_DIP_7; | ||
495 | if (sw == BCSR_SWITCHES_DIP_8) { | ||
496 | bcsr_mod(BCSR_RESETS, 0, BCSR_RESETS_PSC1MUX); | ||
497 | db1200_audio_dev.name = "au1xpsc_i2s"; | ||
498 | printk(KERN_INFO " S6.7 ON : PSC1 mode I2S\n"); | ||
499 | } else { | ||
500 | bcsr_mod(BCSR_RESETS, BCSR_RESETS_PSC1MUX, 0); | ||
501 | db1200_audio_dev.name = "au1xpsc_ac97"; | ||
502 | printk(KERN_INFO " S6.7 OFF: PSC1 mode AC97\n"); | ||
503 | } | ||
504 | |||
505 | /* Audio PSC clock is supplied externally. (FIXME: platdata!!) */ | ||
506 | __raw_writel(PSC_SEL_CLK_SERCLK, | ||
507 | (void __iomem *)KSEG1ADDR(PSC1_PHYS_ADDR) + PSC_SEL_OFFSET); | ||
508 | wmb(); | ||
509 | |||
459 | db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS, | 510 | db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS, |
460 | PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1, | 511 | PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1, |
461 | PCMCIA_MEM_PSEUDO_PHYS, | 512 | PCMCIA_MEM_PSEUDO_PHYS, |