aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSeungwhan Youn <sw.youn@samsung.com>2010-10-13 21:35:23 -0400
committerKukjin Kim <kgene.kim@samsung.com>2010-10-25 03:05:11 -0400
commit068b432d74e4d3d17ee0c292337e7194bba655c0 (patch)
treeaaef0cb22ad8bac7147cec123b4eb2b5d12c38e4 /arch
parent6b2cff96063f36b83b87d47fbcbff4140940f0c8 (diff)
ARM: S5PC100: Add S/PDIF platform device
This patch add S/PDIF platform device to support S/PDIF PCM audio on S5PC100. Signed-off-by: Seungwhan Youn <sw.youn@samsung.com> Acked-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')
-rw-r--r--arch/arm/mach-s5pc100/dev-audio.c54
-rw-r--r--arch/arm/mach-s5pc100/include/mach/map.h2
-rw-r--r--arch/arm/mach-s5pc100/mach-smdkc100.c4
-rw-r--r--arch/arm/plat-samsung/include/plat/audio.h9
-rw-r--r--arch/arm/plat-samsung/include/plat/devs.h1
5 files changed, 70 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pc100/dev-audio.c b/arch/arm/mach-s5pc100/dev-audio.c
index 7f6d01e74b8..564e195ec49 100644
--- a/arch/arm/mach-s5pc100/dev-audio.c
+++ b/arch/arm/mach-s5pc100/dev-audio.c
@@ -263,3 +263,57 @@ struct platform_device s5pc100_device_ac97 = {
263 .coherent_dma_mask = DMA_BIT_MASK(32), 263 .coherent_dma_mask = DMA_BIT_MASK(32),
264 }, 264 },
265}; 265};
266
267/* S/PDIF Controller platform_device */
268static int s5pc100_spdif_cfg_gpd(struct platform_device *pdev)
269{
270 s3c_gpio_cfgpin_range(S5PC100_GPD(5), 2, S3C_GPIO_SFN(3));
271
272 return 0;
273}
274
275static int s5pc100_spdif_cfg_gpg3(struct platform_device *pdev)
276{
277 s3c_gpio_cfgpin_range(S5PC100_GPG3(5), 2, S3C_GPIO_SFN(3));
278
279 return 0;
280}
281
282static struct resource s5pc100_spdif_resource[] = {
283 [0] = {
284 .start = S5PC100_PA_SPDIF,
285 .end = S5PC100_PA_SPDIF + 0x100 - 1,
286 .flags = IORESOURCE_MEM,
287 },
288 [1] = {
289 .start = DMACH_SPDIF,
290 .end = DMACH_SPDIF,
291 .flags = IORESOURCE_DMA,
292 },
293};
294
295static struct s3c_audio_pdata s5p_spdif_pdata = {
296 .cfg_gpio = s5pc100_spdif_cfg_gpd,
297};
298
299static u64 s5pc100_spdif_dmamask = DMA_BIT_MASK(32);
300
301struct platform_device s5pc100_device_spdif = {
302 .name = "samsung-spdif",
303 .id = -1,
304 .num_resources = ARRAY_SIZE(s5pc100_spdif_resource),
305 .resource = s5pc100_spdif_resource,
306 .dev = {
307 .platform_data = &s5p_spdif_pdata,
308 .dma_mask = &s5pc100_spdif_dmamask,
309 .coherent_dma_mask = DMA_BIT_MASK(32),
310 },
311};
312
313void __init s5pc100_spdif_setup_gpio(int gpio)
314{
315 if (gpio == S5PC100_SPDIF_GPD)
316 s5p_spdif_pdata.cfg_gpio = s5pc100_spdif_cfg_gpd;
317 else
318 s5p_spdif_pdata.cfg_gpio = s5pc100_spdif_cfg_gpg3;
319}
diff --git a/arch/arm/mach-s5pc100/include/mach/map.h b/arch/arm/mach-s5pc100/include/mach/map.h
index 8751ef4a680..32e9cab5c86 100644
--- a/arch/arm/mach-s5pc100/include/mach/map.h
+++ b/arch/arm/mach-s5pc100/include/mach/map.h
@@ -110,6 +110,8 @@
110#define S5PC100_PA_PCM0 0xF2400000 110#define S5PC100_PA_PCM0 0xF2400000
111#define S5PC100_PA_PCM1 0xF2500000 111#define S5PC100_PA_PCM1 0xF2500000
112 112
113#define S5PC100_PA_SPDIF 0xF2600000
114
113#define S5PC100_PA_TSADC (0xF3000000) 115#define S5PC100_PA_TSADC (0xF3000000)
114 116
115/* KEYPAD */ 117/* KEYPAD */
diff --git a/arch/arm/mach-s5pc100/mach-smdkc100.c b/arch/arm/mach-s5pc100/mach-smdkc100.c
index 020c3f98f81..994a1e15273 100644
--- a/arch/arm/mach-s5pc100/mach-smdkc100.c
+++ b/arch/arm/mach-s5pc100/mach-smdkc100.c
@@ -47,6 +47,7 @@
47#include <plat/adc.h> 47#include <plat/adc.h>
48#include <plat/keypad.h> 48#include <plat/keypad.h>
49#include <plat/ts.h> 49#include <plat/ts.h>
50#include <plat/audio.h>
50 51
51/* Following are default values for UCON, ULCON and UFCON UART registers */ 52/* Following are default values for UCON, ULCON and UFCON UART registers */
52#define SMDKC100_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 53#define SMDKC100_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -196,6 +197,7 @@ static struct platform_device *smdkc100_devices[] __initdata = {
196 &s5p_device_fimc0, 197 &s5p_device_fimc0,
197 &s5p_device_fimc1, 198 &s5p_device_fimc1,
198 &s5p_device_fimc2, 199 &s5p_device_fimc2,
200 &s5pc100_device_spdif,
199}; 201};
200 202
201static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = { 203static struct s3c2410_ts_mach_info s3c_ts_platform __initdata = {
@@ -226,6 +228,8 @@ static void __init smdkc100_machine_init(void)
226 228
227 samsung_keypad_set_platdata(&smdkc100_keypad_data); 229 samsung_keypad_set_platdata(&smdkc100_keypad_data);
228 230
231 s5pc100_spdif_setup_gpio(S5PC100_SPDIF_GPD);
232
229 /* LCD init */ 233 /* LCD init */
230 gpio_request(S5PC100_GPD(0), "GPD"); 234 gpio_request(S5PC100_GPD(0), "GPD");
231 gpio_request(S5PC100_GPH0(6), "GPH0"); 235 gpio_request(S5PC100_GPH0(6), "GPH0");
diff --git a/arch/arm/plat-samsung/include/plat/audio.h b/arch/arm/plat-samsung/include/plat/audio.h
index e32f9edfd4b..7712ff6336f 100644
--- a/arch/arm/plat-samsung/include/plat/audio.h
+++ b/arch/arm/plat-samsung/include/plat/audio.h
@@ -16,6 +16,15 @@
16#define S3C64XX_AC97_GPE 1 16#define S3C64XX_AC97_GPE 1
17extern void s3c64xx_ac97_setup_gpio(int); 17extern void s3c64xx_ac97_setup_gpio(int);
18 18
19/*
20 * The machine init code calls s5p*_spdif_setup_gpio with
21 * one of these defines in order to select appropriate bank
22 * of GPIO for S/PDIF pins
23 */
24#define S5PC100_SPDIF_GPD 0
25#define S5PC100_SPDIF_GPG3 1
26extern void s5pc100_spdif_setup_gpio(int);
27
19/** 28/**
20 * struct s3c_audio_pdata - common platform data for audio device drivers 29 * struct s3c_audio_pdata - common platform data for audio device drivers
21 * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode 30 * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode
diff --git a/arch/arm/plat-samsung/include/plat/devs.h b/arch/arm/plat-samsung/include/plat/devs.h
index 71bcc0fc47c..547110da110 100644
--- a/arch/arm/plat-samsung/include/plat/devs.h
+++ b/arch/arm/plat-samsung/include/plat/devs.h
@@ -111,6 +111,7 @@ extern struct platform_device s5pc100_device_pcm1;
111extern struct platform_device s5pc100_device_iis0; 111extern struct platform_device s5pc100_device_iis0;
112extern struct platform_device s5pc100_device_iis1; 112extern struct platform_device s5pc100_device_iis1;
113extern struct platform_device s5pc100_device_iis2; 113extern struct platform_device s5pc100_device_iis2;
114extern struct platform_device s5pc100_device_spdif;
114 115
115extern struct platform_device samsung_device_keypad; 116extern struct platform_device samsung_device_keypad;
116 117