diff options
author | wanzongshun <mcuos.com@gmail.com> | 2010-05-22 10:23:23 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-24 17:25:34 -0400 |
commit | 3d34a0d80ab51b6838c08c22e7f47aec408eb837 (patch) | |
tree | fc4e2f3e6546b2ef16dc6e7faa00c036051cd6e8 /arch/arm | |
parent | 27ada410c7a56e72fd8c5d304704fbf5cb685659 (diff) |
ARM: 6141/1: Add audio support part in arch/arm/mach-w90x900
Add audio support part in arch/arm/mach-w90x900
Signed-off-by: Wan ZongShun<mcuos.com@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-w90x900/dev.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/include/mach/mfp.h | 24 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/mfp.c | 6 |
3 files changed, 58 insertions, 0 deletions
diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c index e2958eb567f9..b2eda4dc1c34 100644 --- a/arch/arm/mach-w90x900/dev.c +++ b/arch/arm/mach-w90x900/dev.c | |||
@@ -423,6 +423,33 @@ void nuc900_fb_set_platdata(struct nuc900fb_mach_info *pd) | |||
423 | } | 423 | } |
424 | #endif | 424 | #endif |
425 | 425 | ||
426 | /* AUDIO controller*/ | ||
427 | static u64 nuc900_device_audio_dmamask = -1; | ||
428 | static struct resource nuc900_ac97_resource[] = { | ||
429 | [0] = { | ||
430 | .start = W90X900_PA_ACTL, | ||
431 | .end = W90X900_PA_ACTL + W90X900_SZ_ACTL - 1, | ||
432 | .flags = IORESOURCE_MEM, | ||
433 | }, | ||
434 | [1] = { | ||
435 | .start = IRQ_ACTL, | ||
436 | .end = IRQ_ACTL, | ||
437 | .flags = IORESOURCE_IRQ, | ||
438 | } | ||
439 | |||
440 | }; | ||
441 | |||
442 | struct platform_device nuc900_device_audio = { | ||
443 | .name = "nuc900-audio", | ||
444 | .id = -1, | ||
445 | .num_resources = ARRAY_SIZE(nuc900_ac97_resource), | ||
446 | .resource = nuc900_ac97_resource, | ||
447 | .dev = { | ||
448 | .dma_mask = &nuc900_device_audio_dmamask, | ||
449 | .coherent_dma_mask = -1, | ||
450 | } | ||
451 | }; | ||
452 | |||
426 | /*Here should be your evb resourse,such as LCD*/ | 453 | /*Here should be your evb resourse,such as LCD*/ |
427 | 454 | ||
428 | static struct platform_device *nuc900_public_dev[] __initdata = { | 455 | static struct platform_device *nuc900_public_dev[] __initdata = { |
@@ -434,6 +461,7 @@ static struct platform_device *nuc900_public_dev[] __initdata = { | |||
434 | &nuc900_device_emc, | 461 | &nuc900_device_emc, |
435 | &nuc900_device_spi, | 462 | &nuc900_device_spi, |
436 | &nuc900_device_wdt, | 463 | &nuc900_device_wdt, |
464 | &nuc900_device_audio, | ||
437 | }; | 465 | }; |
438 | 466 | ||
439 | /* Provide adding specific CPU platform devices API */ | 467 | /* Provide adding specific CPU platform devices API */ |
diff --git a/arch/arm/mach-w90x900/include/mach/mfp.h b/arch/arm/mach-w90x900/include/mach/mfp.h new file mode 100644 index 000000000000..94c0e71617c6 --- /dev/null +++ b/arch/arm/mach-w90x900/include/mach/mfp.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-w90x900/include/mach/mfp.h | ||
3 | * | ||
4 | * Copyright (c) 2010 Nuvoton technology corporation. | ||
5 | * | ||
6 | * Wan ZongShun <mcuos.com@gmail.com> | ||
7 | * | ||
8 | * Based on arch/arm/mach-s3c2410/include/mach/map.h | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation;version 2 of the License. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_MFP_H | ||
17 | #define __ASM_ARCH_MFP_H | ||
18 | |||
19 | extern void mfp_set_groupf(struct device *dev); | ||
20 | extern void mfp_set_groupc(struct device *dev); | ||
21 | extern void mfp_set_groupi(struct device *dev); | ||
22 | extern void mfp_set_groupg(struct device *dev); | ||
23 | |||
24 | #endif /* __ASM_ARCH_MFP_H */ | ||
diff --git a/arch/arm/mach-w90x900/mfp.c b/arch/arm/mach-w90x900/mfp.c index a47dc9a708ee..fb7fb627b1a5 100644 --- a/arch/arm/mach-w90x900/mfp.c +++ b/arch/arm/mach-w90x900/mfp.c | |||
@@ -36,9 +36,12 @@ | |||
36 | 36 | ||
37 | #define GPIOG0TO1 (0x03 << 14) | 37 | #define GPIOG0TO1 (0x03 << 14) |
38 | #define GPIOG2TO3 (0x03 << 16) | 38 | #define GPIOG2TO3 (0x03 << 16) |
39 | #define GPIOG22TO23 (0x03 << 22) | ||
40 | |||
39 | #define ENSPI (0x0a << 14) | 41 | #define ENSPI (0x0a << 14) |
40 | #define ENI2C0 (0x01 << 14) | 42 | #define ENI2C0 (0x01 << 14) |
41 | #define ENI2C1 (0x01 << 16) | 43 | #define ENI2C1 (0x01 << 16) |
44 | #define ENAC97 (0x02 << 22) | ||
42 | 45 | ||
43 | static DEFINE_MUTEX(mfp_mutex); | 46 | static DEFINE_MUTEX(mfp_mutex); |
44 | 47 | ||
@@ -146,6 +149,9 @@ void mfp_set_groupg(struct device *dev) | |||
146 | } else if (strcmp(dev_id, "nuc900-i2c1") == 0) { | 149 | } else if (strcmp(dev_id, "nuc900-i2c1") == 0) { |
147 | mfpen &= ~(GPIOG2TO3); | 150 | mfpen &= ~(GPIOG2TO3); |
148 | mfpen |= ENI2C1;/*enable i2c1*/ | 151 | mfpen |= ENI2C1;/*enable i2c1*/ |
152 | } else if (strcmp(dev_id, "nuc900-audio") == 0) { | ||
153 | mfpen &= ~(GPIOG22TO23); | ||
154 | mfpen |= ENAC97;/*enable AC97*/ | ||
149 | } else { | 155 | } else { |
150 | mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);/*GPIOG[3:0]*/ | 156 | mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);/*GPIOG[3:0]*/ |
151 | } | 157 | } |