diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-05-19 05:05:33 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-19 05:05:33 -0400 |
commit | 1770a8988f6178efdc1bfc85fb29deacac49fe91 (patch) | |
tree | b20b8da8b92e388847a55e7c7da9d919fe3f3abb /arch/arm/mach-s5p6440 | |
parent | 1e8ff636beb6ee5c87868a6081cc4f95b1ccd713 (diff) | |
parent | 734552072335b00476b626b027ca4a9f57147b6f (diff) |
ARM: Merge for-2635/s5p-audio
Merge branch 'for-2635/s5p-audio' into for-linus/samsung2
Diffstat (limited to 'arch/arm/mach-s5p6440')
-rw-r--r-- | arch/arm/mach-s5p6440/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/dev-audio.c | 127 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/map.h | 6 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/mach-smdk6440.c | 1 |
4 files changed, 137 insertions, 0 deletions
diff --git a/arch/arm/mach-s5p6440/Makefile b/arch/arm/mach-s5p6440/Makefile index 3f243dd1ad14..5fd17d3da0cb 100644 --- a/arch/arm/mach-s5p6440/Makefile +++ b/arch/arm/mach-s5p6440/Makefile | |||
@@ -17,3 +17,6 @@ obj-$(CONFIG_CPU_S5P6440) += cpu.o init.o clock.o gpio.o dma.o | |||
17 | # machine support | 17 | # machine support |
18 | 18 | ||
19 | obj-$(CONFIG_MACH_SMDK6440) += mach-smdk6440.o | 19 | obj-$(CONFIG_MACH_SMDK6440) += mach-smdk6440.o |
20 | |||
21 | # device support | ||
22 | obj-y += dev-audio.o | ||
diff --git a/arch/arm/mach-s5p6440/dev-audio.c b/arch/arm/mach-s5p6440/dev-audio.c new file mode 100644 index 000000000000..0c5367962830 --- /dev/null +++ b/arch/arm/mach-s5p6440/dev-audio.c | |||
@@ -0,0 +1,127 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/dev-audio.c | ||
2 | * | ||
3 | * Copyright (c) 2010 Samsung Electronics Co. Ltd | ||
4 | * Jaswinder Singh <jassi.brar@samsung.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/platform_device.h> | ||
12 | #include <linux/dma-mapping.h> | ||
13 | |||
14 | #include <plat/gpio-cfg.h> | ||
15 | #include <plat/audio.h> | ||
16 | |||
17 | #include <mach/gpio.h> | ||
18 | #include <mach/map.h> | ||
19 | #include <mach/dma.h> | ||
20 | #include <mach/irqs.h> | ||
21 | |||
22 | static int s5p6440_cfg_i2s(struct platform_device *pdev) | ||
23 | { | ||
24 | /* configure GPIO for i2s port */ | ||
25 | switch (pdev->id) { | ||
26 | case -1: | ||
27 | s3c_gpio_cfgpin(S5P6440_GPR(4), S3C_GPIO_SFN(5)); | ||
28 | s3c_gpio_cfgpin(S5P6440_GPR(5), S3C_GPIO_SFN(5)); | ||
29 | s3c_gpio_cfgpin(S5P6440_GPR(6), S3C_GPIO_SFN(5)); | ||
30 | s3c_gpio_cfgpin(S5P6440_GPR(7), S3C_GPIO_SFN(5)); | ||
31 | s3c_gpio_cfgpin(S5P6440_GPR(8), S3C_GPIO_SFN(5)); | ||
32 | s3c_gpio_cfgpin(S5P6440_GPR(13), S3C_GPIO_SFN(5)); | ||
33 | s3c_gpio_cfgpin(S5P6440_GPR(14), S3C_GPIO_SFN(5)); | ||
34 | break; | ||
35 | |||
36 | default: | ||
37 | printk(KERN_ERR "Invalid Device %d\n", pdev->id); | ||
38 | return -EINVAL; | ||
39 | } | ||
40 | |||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | static struct s3c_audio_pdata s3c_i2s_pdata = { | ||
45 | .cfg_gpio = s5p6440_cfg_i2s, | ||
46 | }; | ||
47 | |||
48 | static struct resource s5p6440_iis0_resource[] = { | ||
49 | [0] = { | ||
50 | .start = S5P6440_PA_I2S, | ||
51 | .end = S5P6440_PA_I2S + 0x100 - 1, | ||
52 | .flags = IORESOURCE_MEM, | ||
53 | }, | ||
54 | [1] = { | ||
55 | .start = DMACH_I2S0_TX, | ||
56 | .end = DMACH_I2S0_TX, | ||
57 | .flags = IORESOURCE_DMA, | ||
58 | }, | ||
59 | [2] = { | ||
60 | .start = DMACH_I2S0_RX, | ||
61 | .end = DMACH_I2S0_RX, | ||
62 | .flags = IORESOURCE_DMA, | ||
63 | }, | ||
64 | }; | ||
65 | |||
66 | struct platform_device s5p6440_device_iis = { | ||
67 | .name = "s3c64xx-iis-v4", | ||
68 | .id = -1, | ||
69 | .num_resources = ARRAY_SIZE(s5p6440_iis0_resource), | ||
70 | .resource = s5p6440_iis0_resource, | ||
71 | .dev = { | ||
72 | .platform_data = &s3c_i2s_pdata, | ||
73 | }, | ||
74 | }; | ||
75 | |||
76 | /* PCM Controller platform_devices */ | ||
77 | |||
78 | static int s5p6440_pcm_cfg_gpio(struct platform_device *pdev) | ||
79 | { | ||
80 | switch (pdev->id) { | ||
81 | case 0: | ||
82 | s3c_gpio_cfgpin(S5P6440_GPR(7), S3C_GPIO_SFN(2)); | ||
83 | s3c_gpio_cfgpin(S5P6440_GPR(13), S3C_GPIO_SFN(2)); | ||
84 | s3c_gpio_cfgpin(S5P6440_GPR(14), S3C_GPIO_SFN(2)); | ||
85 | s3c_gpio_cfgpin(S5P6440_GPR(8), S3C_GPIO_SFN(2)); | ||
86 | s3c_gpio_cfgpin(S5P6440_GPR(6), S3C_GPIO_SFN(2)); | ||
87 | break; | ||
88 | |||
89 | default: | ||
90 | printk(KERN_DEBUG "Invalid PCM Controller number!"); | ||
91 | return -EINVAL; | ||
92 | } | ||
93 | |||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | static struct s3c_audio_pdata s3c_pcm_pdata = { | ||
98 | .cfg_gpio = s5p6440_pcm_cfg_gpio, | ||
99 | }; | ||
100 | |||
101 | static struct resource s5p6440_pcm0_resource[] = { | ||
102 | [0] = { | ||
103 | .start = S5P6440_PA_PCM, | ||
104 | .end = S5P6440_PA_PCM + 0x100 - 1, | ||
105 | .flags = IORESOURCE_MEM, | ||
106 | }, | ||
107 | [1] = { | ||
108 | .start = DMACH_PCM0_TX, | ||
109 | .end = DMACH_PCM0_TX, | ||
110 | .flags = IORESOURCE_DMA, | ||
111 | }, | ||
112 | [2] = { | ||
113 | .start = DMACH_PCM0_RX, | ||
114 | .end = DMACH_PCM0_RX, | ||
115 | .flags = IORESOURCE_DMA, | ||
116 | }, | ||
117 | }; | ||
118 | |||
119 | struct platform_device s5p6440_device_pcm = { | ||
120 | .name = "samsung-pcm", | ||
121 | .id = 0, | ||
122 | .num_resources = ARRAY_SIZE(s5p6440_pcm0_resource), | ||
123 | .resource = s5p6440_pcm0_resource, | ||
124 | .dev = { | ||
125 | .platform_data = &s3c_pcm_pdata, | ||
126 | }, | ||
127 | }; | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/map.h b/arch/arm/mach-s5p6440/include/mach/map.h index 0275784eb22f..72aedadd412c 100644 --- a/arch/arm/mach-s5p6440/include/mach/map.h +++ b/arch/arm/mach-s5p6440/include/mach/map.h | |||
@@ -63,6 +63,12 @@ | |||
63 | #define S5P6440_PA_SDRAM (0x20000000) | 63 | #define S5P6440_PA_SDRAM (0x20000000) |
64 | #define S5P_PA_SDRAM S5P6440_PA_SDRAM | 64 | #define S5P_PA_SDRAM S5P6440_PA_SDRAM |
65 | 65 | ||
66 | /* I2S */ | ||
67 | #define S5P6440_PA_I2S 0xF2000000 | ||
68 | |||
69 | /* PCM */ | ||
70 | #define S5P6440_PA_PCM 0xF2100000 | ||
71 | |||
66 | /* compatibiltiy defines. */ | 72 | /* compatibiltiy defines. */ |
67 | #define S3C_PA_UART S5P6440_PA_UART | 73 | #define S3C_PA_UART S5P6440_PA_UART |
68 | #define S3C_PA_IIC S5P6440_PA_IIC0 | 74 | #define S3C_PA_IIC S5P6440_PA_IIC0 |
diff --git a/arch/arm/mach-s5p6440/mach-smdk6440.c b/arch/arm/mach-s5p6440/mach-smdk6440.c index 3ae88f2c7c77..d7fede971ca6 100644 --- a/arch/arm/mach-s5p6440/mach-smdk6440.c +++ b/arch/arm/mach-s5p6440/mach-smdk6440.c | |||
@@ -84,6 +84,7 @@ static struct s3c2410_uartcfg smdk6440_uartcfgs[] __initdata = { | |||
84 | }; | 84 | }; |
85 | 85 | ||
86 | static struct platform_device *smdk6440_devices[] __initdata = { | 86 | static struct platform_device *smdk6440_devices[] __initdata = { |
87 | &s5p6440_device_iis, | ||
87 | }; | 88 | }; |
88 | 89 | ||
89 | static void __init smdk6440_map_io(void) | 90 | static void __init smdk6440_map_io(void) |