diff options
Diffstat (limited to 'arch/arm/mach-s5pv210/dev-audio.c')
-rw-r--r-- | arch/arm/mach-s5pv210/dev-audio.c | 56 |
1 files changed, 42 insertions, 14 deletions
diff --git a/arch/arm/mach-s5pv210/dev-audio.c b/arch/arm/mach-s5pv210/dev-audio.c index 1303fcb12b5..ddd2704b346 100644 --- a/arch/arm/mach-s5pv210/dev-audio.c +++ b/arch/arm/mach-s5pv210/dev-audio.c | |||
@@ -19,22 +19,24 @@ | |||
19 | #include <mach/dma.h> | 19 | #include <mach/dma.h> |
20 | #include <mach/irqs.h> | 20 | #include <mach/irqs.h> |
21 | 21 | ||
22 | static const char *rclksrc[] = { | ||
23 | [0] = "busclk", | ||
24 | [1] = "i2sclk", | ||
25 | }; | ||
26 | |||
22 | static int s5pv210_cfg_i2s(struct platform_device *pdev) | 27 | static int s5pv210_cfg_i2s(struct platform_device *pdev) |
23 | { | 28 | { |
24 | /* configure GPIO for i2s port */ | 29 | /* configure GPIO for i2s port */ |
25 | switch (pdev->id) { | 30 | switch (pdev->id) { |
31 | case 0: | ||
32 | s3c_gpio_cfgpin_range(S5PV210_GPI(0), 7, S3C_GPIO_SFN(2)); | ||
33 | break; | ||
26 | case 1: | 34 | case 1: |
27 | s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(2)); | 35 | s3c_gpio_cfgpin_range(S5PV210_GPC0(0), 5, S3C_GPIO_SFN(2)); |
28 | break; | 36 | break; |
29 | |||
30 | case 2: | 37 | case 2: |
31 | s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(4)); | 38 | s3c_gpio_cfgpin_range(S5PV210_GPC1(0), 5, S3C_GPIO_SFN(4)); |
32 | break; | 39 | break; |
33 | |||
34 | case -1: | ||
35 | s3c_gpio_cfgpin_range(S5PV210_GPI(0), 7, S3C_GPIO_SFN(2)); | ||
36 | break; | ||
37 | |||
38 | default: | 40 | default: |
39 | printk(KERN_ERR "Invalid Device %d\n", pdev->id); | 41 | printk(KERN_ERR "Invalid Device %d\n", pdev->id); |
40 | return -EINVAL; | 42 | return -EINVAL; |
@@ -43,8 +45,15 @@ static int s5pv210_cfg_i2s(struct platform_device *pdev) | |||
43 | return 0; | 45 | return 0; |
44 | } | 46 | } |
45 | 47 | ||
46 | static struct s3c_audio_pdata s3c_i2s_pdata = { | 48 | static struct s3c_audio_pdata i2sv5_pdata = { |
47 | .cfg_gpio = s5pv210_cfg_i2s, | 49 | .cfg_gpio = s5pv210_cfg_i2s, |
50 | .type = { | ||
51 | .i2s = { | ||
52 | .quirks = QUIRK_PRI_6CHAN | QUIRK_SEC_DAI | ||
53 | | QUIRK_NEED_RSTCLR, | ||
54 | .src_clk = rclksrc, | ||
55 | }, | ||
56 | }, | ||
48 | }; | 57 | }; |
49 | 58 | ||
50 | static struct resource s5pv210_iis0_resource[] = { | 59 | static struct resource s5pv210_iis0_resource[] = { |
@@ -63,15 +72,34 @@ static struct resource s5pv210_iis0_resource[] = { | |||
63 | .end = DMACH_I2S0_RX, | 72 | .end = DMACH_I2S0_RX, |
64 | .flags = IORESOURCE_DMA, | 73 | .flags = IORESOURCE_DMA, |
65 | }, | 74 | }, |
75 | [3] = { | ||
76 | .start = DMACH_I2S0S_TX, | ||
77 | .end = DMACH_I2S0S_TX, | ||
78 | .flags = IORESOURCE_DMA, | ||
79 | }, | ||
66 | }; | 80 | }; |
67 | 81 | ||
68 | struct platform_device s5pv210_device_iis0 = { | 82 | struct platform_device s5pv210_device_iis0 = { |
69 | .name = "s3c64xx-iis-v4", | 83 | .name = "samsung-i2s", |
70 | .id = -1, | 84 | .id = 0, |
71 | .num_resources = ARRAY_SIZE(s5pv210_iis0_resource), | 85 | .num_resources = ARRAY_SIZE(s5pv210_iis0_resource), |
72 | .resource = s5pv210_iis0_resource, | 86 | .resource = s5pv210_iis0_resource, |
73 | .dev = { | 87 | .dev = { |
74 | .platform_data = &s3c_i2s_pdata, | 88 | .platform_data = &i2sv5_pdata, |
89 | }, | ||
90 | }; | ||
91 | |||
92 | static const char *rclksrc_v3[] = { | ||
93 | [0] = "iis", | ||
94 | [1] = "audio-bus", | ||
95 | }; | ||
96 | |||
97 | static struct s3c_audio_pdata i2sv3_pdata = { | ||
98 | .cfg_gpio = s5pv210_cfg_i2s, | ||
99 | .type = { | ||
100 | .i2s = { | ||
101 | .src_clk = rclksrc_v3, | ||
102 | }, | ||
75 | }, | 103 | }, |
76 | }; | 104 | }; |
77 | 105 | ||
@@ -94,12 +122,12 @@ static struct resource s5pv210_iis1_resource[] = { | |||
94 | }; | 122 | }; |
95 | 123 | ||
96 | struct platform_device s5pv210_device_iis1 = { | 124 | struct platform_device s5pv210_device_iis1 = { |
97 | .name = "s3c64xx-iis", | 125 | .name = "samsung-i2s", |
98 | .id = 1, | 126 | .id = 1, |
99 | .num_resources = ARRAY_SIZE(s5pv210_iis1_resource), | 127 | .num_resources = ARRAY_SIZE(s5pv210_iis1_resource), |
100 | .resource = s5pv210_iis1_resource, | 128 | .resource = s5pv210_iis1_resource, |
101 | .dev = { | 129 | .dev = { |
102 | .platform_data = &s3c_i2s_pdata, | 130 | .platform_data = &i2sv3_pdata, |
103 | }, | 131 | }, |
104 | }; | 132 | }; |
105 | 133 | ||
@@ -122,12 +150,12 @@ static struct resource s5pv210_iis2_resource[] = { | |||
122 | }; | 150 | }; |
123 | 151 | ||
124 | struct platform_device s5pv210_device_iis2 = { | 152 | struct platform_device s5pv210_device_iis2 = { |
125 | .name = "s3c64xx-iis", | 153 | .name = "samsung-i2s", |
126 | .id = 2, | 154 | .id = 2, |
127 | .num_resources = ARRAY_SIZE(s5pv210_iis2_resource), | 155 | .num_resources = ARRAY_SIZE(s5pv210_iis2_resource), |
128 | .resource = s5pv210_iis2_resource, | 156 | .resource = s5pv210_iis2_resource, |
129 | .dev = { | 157 | .dev = { |
130 | .platform_data = &s3c_i2s_pdata, | 158 | .platform_data = &i2sv3_pdata, |
131 | }, | 159 | }, |
132 | }; | 160 | }; |
133 | 161 | ||