aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500/board-mop500-audio.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2012-09-14 10:46:29 -0400
committerLee Jones <lee.jones@linaro.org>2012-09-20 06:32:41 -0400
commit39b740bf142ab34566c6d1f4498176bb7600ca18 (patch)
tree23795e0c563e502f9d80f9a3bc0dd05b9941ecb5 /arch/arm/mach-ux500/board-mop500-audio.c
parent4fa469419f8f9216c0313489f3819e1099a4933f (diff)
ARM: ux500: Rename MSP board file to something more meaningful
The 'msp' board file does more than just register MSP devices. It also registers some other components necessary to get audio working on ux500 based platforms; such as the PCM and Machine Drivers. For that reason we're changing the filename to be more encompassing - 'audio'. Acked-by: Ola Lilja <ola.o.lilja@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500/board-mop500-audio.c')
-rw-r--r--arch/arm/mach-ux500/board-mop500-audio.c195
1 files changed, 195 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-audio.c b/arch/arm/mach-ux500/board-mop500-audio.c
new file mode 100644
index 000000000000..070629a95625
--- /dev/null
+++ b/arch/arm/mach-ux500/board-mop500-audio.c
@@ -0,0 +1,195 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License terms: GNU General Public License (GPL), version 2
5 */
6
7#include <linux/platform_device.h>
8#include <linux/init.h>
9#include <linux/gpio.h>
10
11#include <plat/gpio-nomadik.h>
12#include <plat/pincfg.h>
13#include <plat/ste_dma40.h>
14
15#include <mach/devices.h>
16#include <mach/hardware.h>
17#include <mach/irqs.h>
18#include <mach/msp.h>
19
20#include "ste-dma40-db8500.h"
21#include "board-mop500.h"
22#include "devices-db8500.h"
23#include "pins-db8500.h"
24
25static struct stedma40_chan_cfg msp0_dma_rx = {
26 .high_priority = true,
27 .dir = STEDMA40_PERIPH_TO_MEM,
28
29 .src_dev_type = DB8500_DMA_DEV31_MSP0_RX_SLIM0_CH0_RX,
30 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
31
32 .src_info.psize = STEDMA40_PSIZE_LOG_4,
33 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
34
35 /* data_width is set during configuration */
36};
37
38static struct stedma40_chan_cfg msp0_dma_tx = {
39 .high_priority = true,
40 .dir = STEDMA40_MEM_TO_PERIPH,
41
42 .src_dev_type = STEDMA40_DEV_DST_MEMORY,
43 .dst_dev_type = DB8500_DMA_DEV31_MSP0_TX_SLIM0_CH0_TX,
44
45 .src_info.psize = STEDMA40_PSIZE_LOG_4,
46 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
47
48 /* data_width is set during configuration */
49};
50
51struct msp_i2s_platform_data msp0_platform_data = {
52 .id = MSP_I2S_0,
53 .msp_i2s_dma_rx = &msp0_dma_rx,
54 .msp_i2s_dma_tx = &msp0_dma_tx,
55};
56
57static struct stedma40_chan_cfg msp1_dma_rx = {
58 .high_priority = true,
59 .dir = STEDMA40_PERIPH_TO_MEM,
60
61 .src_dev_type = DB8500_DMA_DEV30_MSP3_RX,
62 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
63
64 .src_info.psize = STEDMA40_PSIZE_LOG_4,
65 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
66
67 /* data_width is set during configuration */
68};
69
70static struct stedma40_chan_cfg msp1_dma_tx = {
71 .high_priority = true,
72 .dir = STEDMA40_MEM_TO_PERIPH,
73
74 .src_dev_type = STEDMA40_DEV_DST_MEMORY,
75 .dst_dev_type = DB8500_DMA_DEV30_MSP1_TX,
76
77 .src_info.psize = STEDMA40_PSIZE_LOG_4,
78 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
79
80 /* data_width is set during configuration */
81};
82
83struct msp_i2s_platform_data msp1_platform_data = {
84 .id = MSP_I2S_1,
85 .msp_i2s_dma_rx = NULL,
86 .msp_i2s_dma_tx = &msp1_dma_tx,
87};
88
89static struct stedma40_chan_cfg msp2_dma_rx = {
90 .high_priority = true,
91 .dir = STEDMA40_PERIPH_TO_MEM,
92
93 .src_dev_type = DB8500_DMA_DEV14_MSP2_RX,
94 .dst_dev_type = STEDMA40_DEV_DST_MEMORY,
95
96 /* MSP2 DMA doesn't work with PSIZE == 4 on DB8500v2 */
97 .src_info.psize = STEDMA40_PSIZE_LOG_1,
98 .dst_info.psize = STEDMA40_PSIZE_LOG_1,
99
100 /* data_width is set during configuration */
101};
102
103static struct stedma40_chan_cfg msp2_dma_tx = {
104 .high_priority = true,
105 .dir = STEDMA40_MEM_TO_PERIPH,
106
107 .src_dev_type = STEDMA40_DEV_DST_MEMORY,
108 .dst_dev_type = DB8500_DMA_DEV14_MSP2_TX,
109
110 .src_info.psize = STEDMA40_PSIZE_LOG_4,
111 .dst_info.psize = STEDMA40_PSIZE_LOG_4,
112
113 .use_fixed_channel = true,
114 .phy_channel = 1,
115
116 /* data_width is set during configuration */
117};
118
119static struct platform_device *db8500_add_msp_i2s(struct device *parent,
120 int id,
121 resource_size_t base, int irq,
122 struct msp_i2s_platform_data *pdata)
123{
124 struct platform_device *pdev;
125 struct resource res[] = {
126 DEFINE_RES_MEM(base, SZ_4K),
127 DEFINE_RES_IRQ(irq),
128 };
129
130 pr_info("Register platform-device 'ux500-msp-i2s', id %d, irq %d\n",
131 id, irq);
132 pdev = platform_device_register_resndata(parent, "ux500-msp-i2s", id,
133 res, ARRAY_SIZE(res),
134 pdata, sizeof(*pdata));
135 if (!pdev) {
136 pr_err("Failed to register platform-device 'ux500-msp-i2s.%d'!\n",
137 id);
138 return NULL;
139 }
140
141 return pdev;
142}
143
144/* Platform device for ASoC MOP500 machine */
145static struct platform_device snd_soc_mop500 = {
146 .name = "snd-soc-mop500",
147 .id = 0,
148 .dev = {
149 .platform_data = NULL,
150 },
151};
152
153/* Platform device for Ux500-PCM */
154static struct platform_device ux500_pcm = {
155 .name = "ux500-pcm",
156 .id = 0,
157 .dev = {
158 .platform_data = NULL,
159 },
160};
161
162struct msp_i2s_platform_data msp2_platform_data = {
163 .id = MSP_I2S_2,
164 .msp_i2s_dma_rx = &msp2_dma_rx,
165 .msp_i2s_dma_tx = &msp2_dma_tx,
166};
167
168struct msp_i2s_platform_data msp3_platform_data = {
169 .id = MSP_I2S_3,
170 .msp_i2s_dma_rx = &msp1_dma_rx,
171 .msp_i2s_dma_tx = NULL,
172};
173
174void mop500_audio_init(struct device *parent)
175{
176 pr_info("%s: Register platform-device 'snd-soc-mop500'.\n", __func__);
177 platform_device_register(&snd_soc_mop500);
178
179 pr_info("Initialize MSP I2S-devices.\n");
180 db8500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0,
181 &msp0_platform_data);
182 db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1,
183 &msp1_platform_data);
184 db8500_add_msp_i2s(parent, 2, U8500_MSP2_BASE, IRQ_DB8500_MSP2,
185 &msp2_platform_data);
186 db8500_add_msp_i2s(parent, 3, U8500_MSP3_BASE, IRQ_DB8500_MSP1,
187 &msp3_platform_data);
188}
189
190/* Due for removal once the MSP driver has been fully DT:ed. */
191void mop500_of_audio_init(struct device *parent)
192{
193 pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__);
194 platform_device_register(&ux500_pcm);
195}