diff options
author | Rajeshwari Shinde <rajeshwari.s@samsung.com> | 2010-12-20 19:44:42 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-12-29 18:24:27 -0500 |
commit | e0b9c88b12dd190591eb5903cd0572a97d2a6bf1 (patch) | |
tree | 7fa6d08646ea611e213cfb21ec23204c798574b0 /arch/arm/mach-s5p64x0/dev-audio.c | |
parent | cf57b1a7f288829547b03385bf22124a96c82a4e (diff) |
ARM: S5P64X0: Segregate audio devices
Segregate I2S devices for S5P6440 and S5P6450.
Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5p64x0/dev-audio.c')
-rw-r--r-- | arch/arm/mach-s5p64x0/dev-audio.c | 123 |
1 files changed, 110 insertions, 13 deletions
diff --git a/arch/arm/mach-s5p64x0/dev-audio.c b/arch/arm/mach-s5p64x0/dev-audio.c index 14f89e73b8de..35f1f226dabb 100644 --- a/arch/arm/mach-s5p64x0/dev-audio.c +++ b/arch/arm/mach-s5p64x0/dev-audio.c | |||
@@ -24,13 +24,13 @@ static const char *rclksrc[] = { | |||
24 | [1] = "sclk_audio2", | 24 | [1] = "sclk_audio2", |
25 | }; | 25 | }; |
26 | 26 | ||
27 | static int s5p64x0_cfg_i2s(struct platform_device *pdev) | 27 | static int s5p6440_cfg_i2s(struct platform_device *pdev) |
28 | { | 28 | { |
29 | /* configure GPIO for i2s port */ | ||
30 | switch (pdev->id) { | 29 | switch (pdev->id) { |
31 | case 0: | 30 | case 0: |
32 | s3c_gpio_cfgpin_range(S5P6440_GPR(4), 5, S3C_GPIO_SFN(5)); | 31 | s3c_gpio_cfgpin_range(S5P6440_GPC(4), 2, S3C_GPIO_SFN(5)); |
33 | s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(5)); | 32 | s3c_gpio_cfgpin(S5P6440_GPC(7), S3C_GPIO_SFN(5)); |
33 | s3c_gpio_cfgpin_range(S5P6440_GPH(6), 4, S3C_GPIO_SFN(5)); | ||
34 | break; | 34 | break; |
35 | default: | 35 | default: |
36 | printk(KERN_ERR "Invalid Device %d\n", pdev->id); | 36 | printk(KERN_ERR "Invalid Device %d\n", pdev->id); |
@@ -40,8 +40,8 @@ static int s5p64x0_cfg_i2s(struct platform_device *pdev) | |||
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
42 | 42 | ||
43 | static struct s3c_audio_pdata s5p64x0_i2s_pdata = { | 43 | static struct s3c_audio_pdata s5p6440_i2s_pdata = { |
44 | .cfg_gpio = s5p64x0_cfg_i2s, | 44 | .cfg_gpio = s5p6440_cfg_i2s, |
45 | .type = { | 45 | .type = { |
46 | .i2s = { | 46 | .i2s = { |
47 | .quirks = QUIRK_PRI_6CHAN, | 47 | .quirks = QUIRK_PRI_6CHAN, |
@@ -50,7 +50,7 @@ static struct s3c_audio_pdata s5p64x0_i2s_pdata = { | |||
50 | }, | 50 | }, |
51 | }; | 51 | }; |
52 | 52 | ||
53 | static struct resource s5p64x0_iis0_resource[] = { | 53 | static struct resource s5p64x0_i2s0_resource[] = { |
54 | [0] = { | 54 | [0] = { |
55 | .start = S5P64X0_PA_I2S, | 55 | .start = S5P64X0_PA_I2S, |
56 | .end = S5P64X0_PA_I2S + 0x100 - 1, | 56 | .end = S5P64X0_PA_I2S + 0x100 - 1, |
@@ -71,20 +71,117 @@ static struct resource s5p64x0_iis0_resource[] = { | |||
71 | struct platform_device s5p6440_device_iis = { | 71 | struct platform_device s5p6440_device_iis = { |
72 | .name = "samsung-i2s", | 72 | .name = "samsung-i2s", |
73 | .id = 0, | 73 | .id = 0, |
74 | .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource), | 74 | .num_resources = ARRAY_SIZE(s5p64x0_i2s0_resource), |
75 | .resource = s5p64x0_iis0_resource, | 75 | .resource = s5p64x0_i2s0_resource, |
76 | .dev = { | 76 | .dev = { |
77 | .platform_data = &s5p64x0_i2s_pdata, | 77 | .platform_data = &s5p6440_i2s_pdata, |
78 | }, | ||
79 | }; | ||
80 | |||
81 | static int s5p6450_cfg_i2s(struct platform_device *pdev) | ||
82 | { | ||
83 | switch (pdev->id) { | ||
84 | case 0: | ||
85 | s3c_gpio_cfgpin_range(S5P6450_GPR(4), 5, S3C_GPIO_SFN(5)); | ||
86 | s3c_gpio_cfgpin_range(S5P6450_GPR(13), 2, S3C_GPIO_SFN(5)); | ||
87 | break; | ||
88 | case 1: | ||
89 | s3c_gpio_cfgpin(S5P6440_GPB(4), S3C_GPIO_SFN(5)); | ||
90 | s3c_gpio_cfgpin_range(S5P6450_GPC(0), 4, S3C_GPIO_SFN(5)); | ||
91 | break; | ||
92 | case 2: | ||
93 | s3c_gpio_cfgpin_range(S5P6450_GPK(0), 5, S3C_GPIO_SFN(5)); | ||
94 | break; | ||
95 | default: | ||
96 | printk(KERN_ERR "Invalid Device %d\n", pdev->id); | ||
97 | return -EINVAL; | ||
98 | } | ||
99 | |||
100 | return 0; | ||
101 | } | ||
102 | |||
103 | static struct s3c_audio_pdata s5p6450_i2s0_pdata = { | ||
104 | .cfg_gpio = s5p6450_cfg_i2s, | ||
105 | .type = { | ||
106 | .i2s = { | ||
107 | .quirks = QUIRK_PRI_6CHAN, | ||
108 | .src_clk = rclksrc, | ||
109 | }, | ||
78 | }, | 110 | }, |
79 | }; | 111 | }; |
80 | 112 | ||
81 | struct platform_device s5p6450_device_iis0 = { | 113 | struct platform_device s5p6450_device_iis0 = { |
82 | .name = "samsung-i2s", | 114 | .name = "samsung-i2s", |
83 | .id = 0, | 115 | .id = 0, |
84 | .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource), | 116 | .num_resources = ARRAY_SIZE(s5p64x0_i2s0_resource), |
85 | .resource = s5p64x0_iis0_resource, | 117 | .resource = s5p64x0_i2s0_resource, |
118 | .dev = { | ||
119 | .platform_data = &s5p6450_i2s0_pdata, | ||
120 | }, | ||
121 | }; | ||
122 | |||
123 | static struct s3c_audio_pdata s5p6450_i2s_pdata = { | ||
124 | .cfg_gpio = s5p6450_cfg_i2s, | ||
125 | .type = { | ||
126 | .i2s = { | ||
127 | .src_clk = rclksrc, | ||
128 | }, | ||
129 | }, | ||
130 | }; | ||
131 | |||
132 | static struct resource s5p6450_i2s1_resource[] = { | ||
133 | [0] = { | ||
134 | .start = S5P6450_PA_I2S1, | ||
135 | .end = S5P6450_PA_I2S1 + 0x100 - 1, | ||
136 | .flags = IORESOURCE_MEM, | ||
137 | }, | ||
138 | [1] = { | ||
139 | .start = DMACH_I2S1_TX, | ||
140 | .end = DMACH_I2S1_TX, | ||
141 | .flags = IORESOURCE_DMA, | ||
142 | }, | ||
143 | [2] = { | ||
144 | .start = DMACH_I2S1_RX, | ||
145 | .end = DMACH_I2S1_RX, | ||
146 | .flags = IORESOURCE_DMA, | ||
147 | }, | ||
148 | }; | ||
149 | |||
150 | struct platform_device s5p6450_device_iis1 = { | ||
151 | .name = "samsung-i2s", | ||
152 | .id = 1, | ||
153 | .num_resources = ARRAY_SIZE(s5p6450_i2s1_resource), | ||
154 | .resource = s5p6450_i2s1_resource, | ||
155 | .dev = { | ||
156 | .platform_data = &s5p6450_i2s_pdata, | ||
157 | }, | ||
158 | }; | ||
159 | |||
160 | static struct resource s5p6450_i2s2_resource[] = { | ||
161 | [0] = { | ||
162 | .start = S5P6450_PA_I2S2, | ||
163 | .end = S5P6450_PA_I2S2 + 0x100 - 1, | ||
164 | .flags = IORESOURCE_MEM, | ||
165 | }, | ||
166 | [1] = { | ||
167 | .start = DMACH_I2S2_TX, | ||
168 | .end = DMACH_I2S2_TX, | ||
169 | .flags = IORESOURCE_DMA, | ||
170 | }, | ||
171 | [2] = { | ||
172 | .start = DMACH_I2S2_RX, | ||
173 | .end = DMACH_I2S2_RX, | ||
174 | .flags = IORESOURCE_DMA, | ||
175 | }, | ||
176 | }; | ||
177 | |||
178 | struct platform_device s5p6450_device_iis2 = { | ||
179 | .name = "samsung-i2s", | ||
180 | .id = 2, | ||
181 | .num_resources = ARRAY_SIZE(s5p6450_i2s2_resource), | ||
182 | .resource = s5p6450_i2s2_resource, | ||
86 | .dev = { | 183 | .dev = { |
87 | .platform_data = &s5p64x0_i2s_pdata, | 184 | .platform_data = &s5p6450_i2s_pdata, |
88 | }, | 185 | }, |
89 | }; | 186 | }; |
90 | 187 | ||