diff options
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/blackfin/Kconfig | 98 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-ac97.c | 8 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-ac97.h | 2 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-i2s.c | 30 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-i2s.h | 2 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-sport.c | 2 | ||||
-rw-r--r-- | sound/soc/blackfin/bf5xx-tdm.c | 8 | ||||
-rw-r--r-- | sound/soc/codecs/ad1836.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/ad1938.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/wm8753.c | 1 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-i2s.c | 37 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 104 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.h | 7 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-pcm.c | 13 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-pcm.h | 1 | ||||
-rw-r--r-- | sound/soc/pxa/Kconfig | 2 |
16 files changed, 155 insertions, 165 deletions
diff --git a/sound/soc/blackfin/Kconfig b/sound/soc/blackfin/Kconfig index ac927ffdc961..97f1a251e446 100644 --- a/sound/soc/blackfin/Kconfig +++ b/sound/soc/blackfin/Kconfig | |||
@@ -7,15 +7,6 @@ config SND_BF5XX_I2S | |||
7 | mode (supports single stereo In/Out). | 7 | mode (supports single stereo In/Out). |
8 | You will also need to select the audio interfaces to support below. | 8 | You will also need to select the audio interfaces to support below. |
9 | 9 | ||
10 | config SND_BF5XX_TDM | ||
11 | tristate "SoC I2S(TDM mode) Audio for the ADI BF5xx chip" | ||
12 | depends on (BLACKFIN && SND_SOC) | ||
13 | help | ||
14 | Say Y or M if you want to add support for codecs attached to | ||
15 | the Blackfin SPORT (synchronous serial ports) interface in TDM | ||
16 | mode. | ||
17 | You will also need to select the audio interfaces to support below. | ||
18 | |||
19 | config SND_BF5XX_SOC_SSM2602 | 10 | config SND_BF5XX_SOC_SSM2602 |
20 | tristate "SoC SSM2602 Audio support for BF52x ezkit" | 11 | tristate "SoC SSM2602 Audio support for BF52x ezkit" |
21 | depends on SND_BF5XX_I2S | 12 | depends on SND_BF5XX_I2S |
@@ -41,6 +32,31 @@ config SND_BFIN_AD73311_SE | |||
41 | Enter the GPIO used to control AD73311's SE pin. Acceptable | 32 | Enter the GPIO used to control AD73311's SE pin. Acceptable |
42 | values are 0 to 7 | 33 | values are 0 to 7 |
43 | 34 | ||
35 | config SND_BF5XX_TDM | ||
36 | tristate "SoC I2S(TDM mode) Audio for the ADI BF5xx chip" | ||
37 | depends on (BLACKFIN && SND_SOC) | ||
38 | help | ||
39 | Say Y or M if you want to add support for codecs attached to | ||
40 | the Blackfin SPORT (synchronous serial ports) interface in TDM | ||
41 | mode. | ||
42 | You will also need to select the audio interfaces to support below. | ||
43 | |||
44 | config SND_BF5XX_SOC_AD1836 | ||
45 | tristate "SoC AD1836 Audio support for BF5xx" | ||
46 | depends on SND_BF5XX_TDM | ||
47 | select SND_BF5XX_SOC_TDM | ||
48 | select SND_SOC_AD1836 | ||
49 | help | ||
50 | Say Y if you want to add support for SoC audio on BF5xx STAMP/EZKIT. | ||
51 | |||
52 | config SND_BF5XX_SOC_AD1938 | ||
53 | tristate "SoC AD1938 Audio support for Blackfin" | ||
54 | depends on SND_BF5XX_TDM | ||
55 | select SND_BF5XX_SOC_TDM | ||
56 | select SND_SOC_AD1938 | ||
57 | help | ||
58 | Say Y if you want to add support for AD1938 codec on Blackfin. | ||
59 | |||
44 | config SND_BF5XX_AC97 | 60 | config SND_BF5XX_AC97 |
45 | tristate "SoC AC97 Audio for the ADI BF5xx chip" | 61 | tristate "SoC AC97 Audio for the ADI BF5xx chip" |
46 | depends on BLACKFIN | 62 | depends on BLACKFIN |
@@ -71,6 +87,30 @@ config SND_BF5XX_MULTICHAN_SUPPORT | |||
71 | Say y if you want AC97 driver to support up to 5.1 channel audio. | 87 | Say y if you want AC97 driver to support up to 5.1 channel audio. |
72 | this mode will consume much more memory for DMA. | 88 | this mode will consume much more memory for DMA. |
73 | 89 | ||
90 | config SND_BF5XX_HAVE_COLD_RESET | ||
91 | bool "BOARD has COLD Reset GPIO" | ||
92 | depends on SND_BF5XX_AC97 | ||
93 | default y if BFIN548_EZKIT | ||
94 | default n if !BFIN548_EZKIT | ||
95 | |||
96 | config SND_BF5XX_RESET_GPIO_NUM | ||
97 | int "Set a GPIO for cold reset" | ||
98 | depends on SND_BF5XX_HAVE_COLD_RESET | ||
99 | range 0 159 | ||
100 | default 19 if BFIN548_EZKIT | ||
101 | default 5 if BFIN537_STAMP | ||
102 | default 0 | ||
103 | help | ||
104 | Set the correct GPIO for RESET the sound chip. | ||
105 | |||
106 | config SND_BF5XX_SOC_AD1980 | ||
107 | tristate "SoC AD1980/1 Audio support for BF5xx" | ||
108 | depends on SND_BF5XX_AC97 | ||
109 | select SND_BF5XX_SOC_AC97 | ||
110 | select SND_SOC_AD1980 | ||
111 | help | ||
112 | Say Y if you want to add support for SoC audio on BF5xx STAMP/EZKIT. | ||
113 | |||
74 | config SND_BF5XX_SOC_SPORT | 114 | config SND_BF5XX_SOC_SPORT |
75 | tristate | 115 | tristate |
76 | 116 | ||
@@ -88,30 +128,6 @@ config SND_BF5XX_SOC_AC97 | |||
88 | select SND_SOC_AC97_BUS | 128 | select SND_SOC_AC97_BUS |
89 | select SND_BF5XX_SOC_SPORT | 129 | select SND_BF5XX_SOC_SPORT |
90 | 130 | ||
91 | config SND_BF5XX_SOC_AD1836 | ||
92 | tristate "SoC AD1836 Audio support for BF5xx" | ||
93 | depends on SND_BF5XX_TDM | ||
94 | select SND_BF5XX_SOC_TDM | ||
95 | select SND_SOC_AD1836 | ||
96 | help | ||
97 | Say Y if you want to add support for SoC audio on BF5xx STAMP/EZKIT. | ||
98 | |||
99 | config SND_BF5XX_SOC_AD1980 | ||
100 | tristate "SoC AD1980/1 Audio support for BF5xx" | ||
101 | depends on SND_BF5XX_AC97 | ||
102 | select SND_BF5XX_SOC_AC97 | ||
103 | select SND_SOC_AD1980 | ||
104 | help | ||
105 | Say Y if you want to add support for SoC audio on BF5xx STAMP/EZKIT. | ||
106 | |||
107 | config SND_BF5XX_SOC_AD1938 | ||
108 | tristate "SoC AD1938 Audio support for Blackfin" | ||
109 | depends on SND_BF5XX_TDM | ||
110 | select SND_BF5XX_SOC_TDM | ||
111 | select SND_SOC_AD1938 | ||
112 | help | ||
113 | Say Y if you want to add support for AD1938 codec on Blackfin. | ||
114 | |||
115 | config SND_BF5XX_SPORT_NUM | 131 | config SND_BF5XX_SPORT_NUM |
116 | int "Set a SPORT for Sound chip" | 132 | int "Set a SPORT for Sound chip" |
117 | depends on (SND_BF5XX_I2S || SND_BF5XX_AC97 || SND_BF5XX_TDM) | 133 | depends on (SND_BF5XX_I2S || SND_BF5XX_AC97 || SND_BF5XX_TDM) |
@@ -120,19 +136,3 @@ config SND_BF5XX_SPORT_NUM | |||
120 | default 0 | 136 | default 0 |
121 | help | 137 | help |
122 | Set the correct SPORT for sound chip. | 138 | Set the correct SPORT for sound chip. |
123 | |||
124 | config SND_BF5XX_HAVE_COLD_RESET | ||
125 | bool "BOARD has COLD Reset GPIO" | ||
126 | depends on SND_BF5XX_AC97 | ||
127 | default y if BFIN548_EZKIT | ||
128 | default n if !BFIN548_EZKIT | ||
129 | |||
130 | config SND_BF5XX_RESET_GPIO_NUM | ||
131 | int "Set a GPIO for cold reset" | ||
132 | depends on SND_BF5XX_HAVE_COLD_RESET | ||
133 | range 0 159 | ||
134 | default 19 if BFIN548_EZKIT | ||
135 | default 5 if BFIN537_STAMP | ||
136 | default 0 | ||
137 | help | ||
138 | Set the correct GPIO for RESET the sound chip. | ||
diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c index 2758b9017a7f..e69322978739 100644 --- a/sound/soc/blackfin/bf5xx-ac97.c +++ b/sound/soc/blackfin/bf5xx-ac97.c | |||
@@ -277,7 +277,11 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai) | |||
277 | if (!dai->active) | 277 | if (!dai->active) |
278 | return 0; | 278 | return 0; |
279 | 279 | ||
280 | #if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT) | ||
281 | ret = sport_set_multichannel(sport, 16, 0x3FF, 1); | ||
282 | #else | ||
280 | ret = sport_set_multichannel(sport, 16, 0x1F, 1); | 283 | ret = sport_set_multichannel(sport, 16, 0x1F, 1); |
284 | #endif | ||
281 | if (ret) { | 285 | if (ret) { |
282 | pr_err("SPORT is busy!\n"); | 286 | pr_err("SPORT is busy!\n"); |
283 | return -EBUSY; | 287 | return -EBUSY; |
@@ -334,7 +338,11 @@ static int bf5xx_ac97_probe(struct platform_device *pdev, | |||
334 | goto sport_err; | 338 | goto sport_err; |
335 | } | 339 | } |
336 | /*SPORT works in TDM mode to simulate AC97 transfers*/ | 340 | /*SPORT works in TDM mode to simulate AC97 transfers*/ |
341 | #if defined(CONFIG_SND_BF5XX_MULTICHAN_SUPPORT) | ||
342 | ret = sport_set_multichannel(sport_handle, 16, 0x3FF, 1); | ||
343 | #else | ||
337 | ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1); | 344 | ret = sport_set_multichannel(sport_handle, 16, 0x1F, 1); |
345 | #endif | ||
338 | if (ret) { | 346 | if (ret) { |
339 | pr_err("SPORT is busy!\n"); | 347 | pr_err("SPORT is busy!\n"); |
340 | ret = -EBUSY; | 348 | ret = -EBUSY; |
diff --git a/sound/soc/blackfin/bf5xx-ac97.h b/sound/soc/blackfin/bf5xx-ac97.h index 3f2a911fe0cb..a1f97dd809d6 100644 --- a/sound/soc/blackfin/bf5xx-ac97.h +++ b/sound/soc/blackfin/bf5xx-ac97.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/sound/arm/bf5xx-ac97.h | 2 | * sound/soc/blackfin/bf5xx-ac97.h |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
diff --git a/sound/soc/blackfin/bf5xx-i2s.c b/sound/soc/blackfin/bf5xx-i2s.c index 876abade27e1..084b68884ada 100644 --- a/sound/soc/blackfin/bf5xx-i2s.c +++ b/sound/soc/blackfin/bf5xx-i2s.c | |||
@@ -77,12 +77,12 @@ static struct sport_param sport_params[2] = { | |||
77 | * TFS. When Port G is selected and EMAC then there is a conflict between | 77 | * TFS. When Port G is selected and EMAC then there is a conflict between |
78 | * the PHY interrupt line and TFS. Current settings prevent the conflict | 78 | * the PHY interrupt line and TFS. Current settings prevent the conflict |
79 | * by ignoring the TFS pin when Port G is selected. This allows both | 79 | * by ignoring the TFS pin when Port G is selected. This allows both |
80 | * ssm2602 using Port G and EMAC concurrently. | 80 | * codecs and EMAC using Port G concurrently. |
81 | */ | 81 | */ |
82 | #ifdef CONFIG_BF527_SPORT0_PORTF | 82 | #ifdef CONFIG_BF527_SPORT0_PORTG |
83 | #define LOCAL_SPORT0_TFS (P_SPORT0_TFS) | ||
84 | #else | ||
85 | #define LOCAL_SPORT0_TFS (0) | 83 | #define LOCAL_SPORT0_TFS (0) |
84 | #else | ||
85 | #define LOCAL_SPORT0_TFS (P_SPORT0_TFS) | ||
86 | #endif | 86 | #endif |
87 | 87 | ||
88 | static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, | 88 | static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, |
@@ -227,7 +227,8 @@ static int bf5xx_i2s_probe(struct platform_device *pdev, | |||
227 | return 0; | 227 | return 0; |
228 | } | 228 | } |
229 | 229 | ||
230 | static void bf5xx_i2s_remove(struct snd_soc_dai *dai) | 230 | static void bf5xx_i2s_remove(struct platform_device *pdev, |
231 | struct snd_soc_dai *dai) | ||
231 | { | 232 | { |
232 | pr_debug("%s enter\n", __func__); | 233 | pr_debug("%s enter\n", __func__); |
233 | peripheral_free_list(&sport_req[sport_num][0]); | 234 | peripheral_free_list(&sport_req[sport_num][0]); |
@@ -236,36 +237,31 @@ static void bf5xx_i2s_remove(struct snd_soc_dai *dai) | |||
236 | #ifdef CONFIG_PM | 237 | #ifdef CONFIG_PM |
237 | static int bf5xx_i2s_suspend(struct snd_soc_dai *dai) | 238 | static int bf5xx_i2s_suspend(struct snd_soc_dai *dai) |
238 | { | 239 | { |
239 | struct sport_device *sport = | ||
240 | (struct sport_device *)dai->private_data; | ||
241 | 240 | ||
242 | pr_debug("%s : sport %d\n", __func__, dai->id); | 241 | pr_debug("%s : sport %d\n", __func__, dai->id); |
243 | if (!dai->active) | 242 | |
244 | return 0; | ||
245 | if (dai->capture.active) | 243 | if (dai->capture.active) |
246 | sport_rx_stop(sport); | 244 | sport_rx_stop(sport_handle); |
247 | if (dai->playback.active) | 245 | if (dai->playback.active) |
248 | sport_tx_stop(sport); | 246 | sport_tx_stop(sport_handle); |
249 | return 0; | 247 | return 0; |
250 | } | 248 | } |
251 | 249 | ||
252 | static int bf5xx_i2s_resume(struct snd_soc_dai *dai) | 250 | static int bf5xx_i2s_resume(struct snd_soc_dai *dai) |
253 | { | 251 | { |
254 | int ret; | 252 | int ret; |
255 | struct sport_device *sport = | ||
256 | (struct sport_device *)dai->private_data; | ||
257 | 253 | ||
258 | pr_debug("%s : sport %d\n", __func__, dai->id); | 254 | pr_debug("%s : sport %d\n", __func__, dai->id); |
259 | if (!dai->active) | ||
260 | return 0; | ||
261 | 255 | ||
262 | ret = sport_config_rx(sport, RFSR | RCKFE, RSFSE|0x1f, 0, 0); | 256 | ret = sport_config_rx(sport_handle, bf5xx_i2s.rcr1, |
257 | bf5xx_i2s.rcr2, 0, 0); | ||
263 | if (ret) { | 258 | if (ret) { |
264 | pr_err("SPORT is busy!\n"); | 259 | pr_err("SPORT is busy!\n"); |
265 | return -EBUSY; | 260 | return -EBUSY; |
266 | } | 261 | } |
267 | 262 | ||
268 | ret = sport_config_tx(sport, TFSR | TCKFE, TSFSE|0x1f, 0, 0); | 263 | ret = sport_config_tx(sport_handle, bf5xx_i2s.tcr1, |
264 | bf5xx_i2s.tcr2, 0, 0); | ||
269 | if (ret) { | 265 | if (ret) { |
270 | pr_err("SPORT is busy!\n"); | 266 | pr_err("SPORT is busy!\n"); |
271 | return -EBUSY; | 267 | return -EBUSY; |
diff --git a/sound/soc/blackfin/bf5xx-i2s.h b/sound/soc/blackfin/bf5xx-i2s.h index 7107d1a0b06b..264ecdcba35a 100644 --- a/sound/soc/blackfin/bf5xx-i2s.h +++ b/sound/soc/blackfin/bf5xx-i2s.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/sound/arm/bf5xx-i2s.h | 2 | * sound/soc/blackfin/bf5xx-i2s.h |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
diff --git a/sound/soc/blackfin/bf5xx-sport.c b/sound/soc/blackfin/bf5xx-sport.c index 469ce7fab20c..99051ff0954e 100644 --- a/sound/soc/blackfin/bf5xx-sport.c +++ b/sound/soc/blackfin/bf5xx-sport.c | |||
@@ -326,7 +326,7 @@ static inline int sport_hook_tx_dummy(struct sport_device *sport) | |||
326 | 326 | ||
327 | int sport_tx_start(struct sport_device *sport) | 327 | int sport_tx_start(struct sport_device *sport) |
328 | { | 328 | { |
329 | unsigned flags; | 329 | unsigned long flags; |
330 | pr_debug("%s: tx_run:%d, rx_run:%d\n", __func__, | 330 | pr_debug("%s: tx_run:%d, rx_run:%d\n", __func__, |
331 | sport->tx_run, sport->rx_run); | 331 | sport->tx_run, sport->rx_run); |
332 | if (sport->tx_run) | 332 | if (sport->tx_run) |
diff --git a/sound/soc/blackfin/bf5xx-tdm.c b/sound/soc/blackfin/bf5xx-tdm.c index 3096badf09a5..ff546e91a22e 100644 --- a/sound/soc/blackfin/bf5xx-tdm.c +++ b/sound/soc/blackfin/bf5xx-tdm.c | |||
@@ -78,12 +78,12 @@ static struct sport_param sport_params[2] = { | |||
78 | * TFS. When Port G is selected and EMAC then there is a conflict between | 78 | * TFS. When Port G is selected and EMAC then there is a conflict between |
79 | * the PHY interrupt line and TFS. Current settings prevent the conflict | 79 | * the PHY interrupt line and TFS. Current settings prevent the conflict |
80 | * by ignoring the TFS pin when Port G is selected. This allows both | 80 | * by ignoring the TFS pin when Port G is selected. This allows both |
81 | * ssm2602 using Port G and EMAC concurrently. | 81 | * codecs and EMAC using Port G concurrently. |
82 | */ | 82 | */ |
83 | #ifdef CONFIG_BF527_SPORT0_PORTF | 83 | #ifdef CONFIG_BF527_SPORT0_PORTG |
84 | #define LOCAL_SPORT0_TFS (P_SPORT0_TFS) | ||
85 | #else | ||
86 | #define LOCAL_SPORT0_TFS (0) | 84 | #define LOCAL_SPORT0_TFS (0) |
85 | #else | ||
86 | #define LOCAL_SPORT0_TFS (P_SPORT0_TFS) | ||
87 | #endif | 87 | #endif |
88 | 88 | ||
89 | static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, | 89 | static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, |
diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c index 01343dc984fd..c48485f2c55d 100644 --- a/sound/soc/codecs/ad1836.c +++ b/sound/soc/codecs/ad1836.c | |||
@@ -251,8 +251,7 @@ static int __devexit ad1836_spi_remove(struct spi_device *spi) | |||
251 | 251 | ||
252 | static struct spi_driver ad1836_spi_driver = { | 252 | static struct spi_driver ad1836_spi_driver = { |
253 | .driver = { | 253 | .driver = { |
254 | .name = "ad1836-spi", | 254 | .name = "ad1836", |
255 | .bus = &spi_bus_type, | ||
256 | .owner = THIS_MODULE, | 255 | .owner = THIS_MODULE, |
257 | }, | 256 | }, |
258 | .probe = ad1836_spi_probe, | 257 | .probe = ad1836_spi_probe, |
diff --git a/sound/soc/codecs/ad1938.c b/sound/soc/codecs/ad1938.c index 9a049a1995a3..34b30efc3cb0 100644 --- a/sound/soc/codecs/ad1938.c +++ b/sound/soc/codecs/ad1938.c | |||
@@ -456,7 +456,6 @@ static int __devexit ad1938_spi_remove(struct spi_device *spi) | |||
456 | static struct spi_driver ad1938_spi_driver = { | 456 | static struct spi_driver ad1938_spi_driver = { |
457 | .driver = { | 457 | .driver = { |
458 | .name = "ad1938", | 458 | .name = "ad1938", |
459 | .bus = &spi_bus_type, | ||
460 | .owner = THIS_MODULE, | 459 | .owner = THIS_MODULE, |
461 | }, | 460 | }, |
462 | .probe = ad1938_spi_probe, | 461 | .probe = ad1938_spi_probe, |
@@ -515,6 +514,7 @@ static int ad1938_register(struct ad1938_priv *ad1938) | |||
515 | codec->num_dai = 1; | 514 | codec->num_dai = 1; |
516 | codec->write = ad1938_write_reg; | 515 | codec->write = ad1938_write_reg; |
517 | codec->read = ad1938_read_reg_cache; | 516 | codec->read = ad1938_read_reg_cache; |
517 | codec->set_bias_level = ad1938_set_bias_level; | ||
518 | INIT_LIST_HEAD(&codec->dapm_widgets); | 518 | INIT_LIST_HEAD(&codec->dapm_widgets); |
519 | INIT_LIST_HEAD(&codec->dapm_paths); | 519 | INIT_LIST_HEAD(&codec->dapm_paths); |
520 | 520 | ||
diff --git a/sound/soc/codecs/wm8753.c b/sound/soc/codecs/wm8753.c index d80d414cfbbd..5ad677ce80da 100644 --- a/sound/soc/codecs/wm8753.c +++ b/sound/soc/codecs/wm8753.c | |||
@@ -595,6 +595,7 @@ static const struct snd_soc_dapm_route audio_map[] = { | |||
595 | 595 | ||
596 | /* Mono Capture mixer-mux */ | 596 | /* Mono Capture mixer-mux */ |
597 | {"Capture Right Mixer", "Stereo", "Capture Right Mux"}, | 597 | {"Capture Right Mixer", "Stereo", "Capture Right Mux"}, |
598 | {"Capture Left Mixer", "Stereo", "Capture Left Mux"}, | ||
598 | {"Capture Left Mixer", "Analogue Mix Left", "Capture Left Mux"}, | 599 | {"Capture Left Mixer", "Analogue Mix Left", "Capture Left Mux"}, |
599 | {"Capture Left Mixer", "Analogue Mix Left", "Capture Right Mux"}, | 600 | {"Capture Left Mixer", "Analogue Mix Left", "Capture Right Mux"}, |
600 | {"Capture Right Mixer", "Analogue Mix Right", "Capture Left Mux"}, | 601 | {"Capture Right Mixer", "Analogue Mix Right", "Capture Left Mux"}, |
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index 12a6c549ee6e..4ae707048021 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c | |||
@@ -97,22 +97,19 @@ enum { | |||
97 | DAVINCI_MCBSP_WORD_32, | 97 | DAVINCI_MCBSP_WORD_32, |
98 | }; | 98 | }; |
99 | 99 | ||
100 | static struct davinci_pcm_dma_params davinci_i2s_pcm_out = { | ||
101 | .name = "I2S PCM Stereo out", | ||
102 | }; | ||
103 | |||
104 | static struct davinci_pcm_dma_params davinci_i2s_pcm_in = { | ||
105 | .name = "I2S PCM Stereo in", | ||
106 | }; | ||
107 | |||
108 | struct davinci_mcbsp_dev { | 100 | struct davinci_mcbsp_dev { |
101 | /* | ||
102 | * dma_params must be first because rtd->dai->cpu_dai->private_data | ||
103 | * is cast to a pointer of an array of struct davinci_pcm_dma_params in | ||
104 | * davinci_pcm_open. | ||
105 | */ | ||
106 | struct davinci_pcm_dma_params dma_params[2]; | ||
109 | void __iomem *base; | 107 | void __iomem *base; |
110 | #define MOD_DSP_A 0 | 108 | #define MOD_DSP_A 0 |
111 | #define MOD_DSP_B 1 | 109 | #define MOD_DSP_B 1 |
112 | int mode; | 110 | int mode; |
113 | u32 pcr; | 111 | u32 pcr; |
114 | struct clk *clk; | 112 | struct clk *clk; |
115 | struct davinci_pcm_dma_params *dma_params[2]; | ||
116 | }; | 113 | }; |
117 | 114 | ||
118 | static inline void davinci_mcbsp_write_reg(struct davinci_mcbsp_dev *dev, | 115 | static inline void davinci_mcbsp_write_reg(struct davinci_mcbsp_dev *dev, |
@@ -215,14 +212,6 @@ static void davinci_mcbsp_stop(struct davinci_mcbsp_dev *dev, int playback) | |||
215 | toggle_clock(dev, playback); | 212 | toggle_clock(dev, playback); |
216 | } | 213 | } |
217 | 214 | ||
218 | static int davinci_i2s_startup(struct snd_pcm_substream *substream, | ||
219 | struct snd_soc_dai *cpu_dai) | ||
220 | { | ||
221 | struct davinci_mcbsp_dev *dev = cpu_dai->private_data; | ||
222 | cpu_dai->dma_data = dev->dma_params[substream->stream]; | ||
223 | return 0; | ||
224 | } | ||
225 | |||
226 | #define DEFAULT_BITPERSAMPLE 16 | 215 | #define DEFAULT_BITPERSAMPLE 16 |
227 | 216 | ||
228 | static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, | 217 | static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, |
@@ -353,8 +342,9 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, | |||
353 | struct snd_pcm_hw_params *params, | 342 | struct snd_pcm_hw_params *params, |
354 | struct snd_soc_dai *dai) | 343 | struct snd_soc_dai *dai) |
355 | { | 344 | { |
356 | struct davinci_pcm_dma_params *dma_params = dai->dma_data; | ||
357 | struct davinci_mcbsp_dev *dev = dai->private_data; | 345 | struct davinci_mcbsp_dev *dev = dai->private_data; |
346 | struct davinci_pcm_dma_params *dma_params = | ||
347 | &dev->dma_params[substream->stream]; | ||
358 | struct snd_interval *i = NULL; | 348 | struct snd_interval *i = NULL; |
359 | int mcbsp_word_length; | 349 | int mcbsp_word_length; |
360 | unsigned int rcr, xcr, srgr; | 350 | unsigned int rcr, xcr, srgr; |
@@ -472,7 +462,6 @@ static void davinci_i2s_shutdown(struct snd_pcm_substream *substream, | |||
472 | #define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000 | 462 | #define DAVINCI_I2S_RATES SNDRV_PCM_RATE_8000_96000 |
473 | 463 | ||
474 | static struct snd_soc_dai_ops davinci_i2s_dai_ops = { | 464 | static struct snd_soc_dai_ops davinci_i2s_dai_ops = { |
475 | .startup = davinci_i2s_startup, | ||
476 | .shutdown = davinci_i2s_shutdown, | 465 | .shutdown = davinci_i2s_shutdown, |
477 | .prepare = davinci_i2s_prepare, | 466 | .prepare = davinci_i2s_prepare, |
478 | .trigger = davinci_i2s_trigger, | 467 | .trigger = davinci_i2s_trigger, |
@@ -534,12 +523,10 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
534 | 523 | ||
535 | dev->base = (void __iomem *)IO_ADDRESS(mem->start); | 524 | dev->base = (void __iomem *)IO_ADDRESS(mem->start); |
536 | 525 | ||
537 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK] = &davinci_i2s_pcm_out; | 526 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].dma_addr = |
538 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK]->dma_addr = | ||
539 | (dma_addr_t)(io_v2p(dev->base) + DAVINCI_MCBSP_DXR_REG); | 527 | (dma_addr_t)(io_v2p(dev->base) + DAVINCI_MCBSP_DXR_REG); |
540 | 528 | ||
541 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE] = &davinci_i2s_pcm_in; | 529 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].dma_addr = |
542 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE]->dma_addr = | ||
543 | (dma_addr_t)(io_v2p(dev->base) + DAVINCI_MCBSP_DRR_REG); | 530 | (dma_addr_t)(io_v2p(dev->base) + DAVINCI_MCBSP_DRR_REG); |
544 | 531 | ||
545 | /* first TX, then RX */ | 532 | /* first TX, then RX */ |
@@ -549,7 +536,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
549 | ret = -ENXIO; | 536 | ret = -ENXIO; |
550 | goto err_free_mem; | 537 | goto err_free_mem; |
551 | } | 538 | } |
552 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK]->channel = res->start; | 539 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK].channel = res->start; |
553 | 540 | ||
554 | res = platform_get_resource(pdev, IORESOURCE_DMA, 1); | 541 | res = platform_get_resource(pdev, IORESOURCE_DMA, 1); |
555 | if (!res) { | 542 | if (!res) { |
@@ -557,7 +544,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) | |||
557 | ret = -ENXIO; | 544 | ret = -ENXIO; |
558 | goto err_free_mem; | 545 | goto err_free_mem; |
559 | } | 546 | } |
560 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE]->channel = res->start; | 547 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE].channel = res->start; |
561 | 548 | ||
562 | davinci_i2s_dai.private_data = dev; | 549 | davinci_i2s_dai.private_data = dev; |
563 | ret = snd_soc_register_dai(&davinci_i2s_dai); | 550 | ret = snd_soc_register_dai(&davinci_i2s_dai); |
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index eca22d7829d2..5d1f98a4c978 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -332,14 +332,6 @@ static inline void mcasp_set_ctl_reg(void __iomem *regs, u32 val) | |||
332 | printk(KERN_ERR "GBLCTL write error\n"); | 332 | printk(KERN_ERR "GBLCTL write error\n"); |
333 | } | 333 | } |
334 | 334 | ||
335 | static int davinci_mcasp_startup(struct snd_pcm_substream *substream, | ||
336 | struct snd_soc_dai *cpu_dai) | ||
337 | { | ||
338 | struct davinci_audio_dev *dev = cpu_dai->private_data; | ||
339 | cpu_dai->dma_data = dev->dma_params[substream->stream]; | ||
340 | return 0; | ||
341 | } | ||
342 | |||
343 | static void mcasp_start_rx(struct davinci_audio_dev *dev) | 335 | static void mcasp_start_rx(struct davinci_audio_dev *dev) |
344 | { | 336 | { |
345 | mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXHCLKRST); | 337 | mcasp_set_ctl_reg(dev->base + DAVINCI_MCASP_GBLCTLR_REG, RXHCLKRST); |
@@ -386,17 +378,17 @@ static void mcasp_start_tx(struct davinci_audio_dev *dev) | |||
386 | 378 | ||
387 | static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream) | 379 | static void davinci_mcasp_start(struct davinci_audio_dev *dev, int stream) |
388 | { | 380 | { |
389 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | 381 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) { |
382 | if (dev->txnumevt) /* enable FIFO */ | ||
383 | mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, | ||
384 | FIFO_ENABLE); | ||
390 | mcasp_start_tx(dev); | 385 | mcasp_start_tx(dev); |
391 | else | 386 | } else { |
387 | if (dev->rxnumevt) /* enable FIFO */ | ||
388 | mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, | ||
389 | FIFO_ENABLE); | ||
392 | mcasp_start_rx(dev); | 390 | mcasp_start_rx(dev); |
393 | 391 | } | |
394 | /* enable FIFO */ | ||
395 | if (dev->txnumevt) | ||
396 | mcasp_set_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE); | ||
397 | |||
398 | if (dev->rxnumevt) | ||
399 | mcasp_set_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, FIFO_ENABLE); | ||
400 | } | 392 | } |
401 | 393 | ||
402 | static void mcasp_stop_rx(struct davinci_audio_dev *dev) | 394 | static void mcasp_stop_rx(struct davinci_audio_dev *dev) |
@@ -413,17 +405,17 @@ static void mcasp_stop_tx(struct davinci_audio_dev *dev) | |||
413 | 405 | ||
414 | static void davinci_mcasp_stop(struct davinci_audio_dev *dev, int stream) | 406 | static void davinci_mcasp_stop(struct davinci_audio_dev *dev, int stream) |
415 | { | 407 | { |
416 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | 408 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) { |
409 | if (dev->txnumevt) /* disable FIFO */ | ||
410 | mcasp_clr_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, | ||
411 | FIFO_ENABLE); | ||
417 | mcasp_stop_tx(dev); | 412 | mcasp_stop_tx(dev); |
418 | else | 413 | } else { |
414 | if (dev->rxnumevt) /* disable FIFO */ | ||
415 | mcasp_clr_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, | ||
416 | FIFO_ENABLE); | ||
419 | mcasp_stop_rx(dev); | 417 | mcasp_stop_rx(dev); |
420 | 418 | } | |
421 | /* disable FIFO */ | ||
422 | if (dev->txnumevt) | ||
423 | mcasp_clr_bits(dev->base + DAVINCI_MCASP_WFIFOCTL, FIFO_ENABLE); | ||
424 | |||
425 | if (dev->rxnumevt) | ||
426 | mcasp_clr_bits(dev->base + DAVINCI_MCASP_RFIFOCTL, FIFO_ENABLE); | ||
427 | } | 419 | } |
428 | 420 | ||
429 | static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, | 421 | static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, |
@@ -512,34 +504,49 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev, | |||
512 | int channel_size) | 504 | int channel_size) |
513 | { | 505 | { |
514 | u32 fmt = 0; | 506 | u32 fmt = 0; |
507 | u32 mask, rotate; | ||
515 | 508 | ||
516 | switch (channel_size) { | 509 | switch (channel_size) { |
517 | case DAVINCI_AUDIO_WORD_8: | 510 | case DAVINCI_AUDIO_WORD_8: |
518 | fmt = 0x03; | 511 | fmt = 0x03; |
512 | rotate = 6; | ||
513 | mask = 0x000000ff; | ||
519 | break; | 514 | break; |
520 | 515 | ||
521 | case DAVINCI_AUDIO_WORD_12: | 516 | case DAVINCI_AUDIO_WORD_12: |
522 | fmt = 0x05; | 517 | fmt = 0x05; |
518 | rotate = 5; | ||
519 | mask = 0x00000fff; | ||
523 | break; | 520 | break; |
524 | 521 | ||
525 | case DAVINCI_AUDIO_WORD_16: | 522 | case DAVINCI_AUDIO_WORD_16: |
526 | fmt = 0x07; | 523 | fmt = 0x07; |
524 | rotate = 4; | ||
525 | mask = 0x0000ffff; | ||
527 | break; | 526 | break; |
528 | 527 | ||
529 | case DAVINCI_AUDIO_WORD_20: | 528 | case DAVINCI_AUDIO_WORD_20: |
530 | fmt = 0x09; | 529 | fmt = 0x09; |
530 | rotate = 3; | ||
531 | mask = 0x000fffff; | ||
531 | break; | 532 | break; |
532 | 533 | ||
533 | case DAVINCI_AUDIO_WORD_24: | 534 | case DAVINCI_AUDIO_WORD_24: |
534 | fmt = 0x0B; | 535 | fmt = 0x0B; |
536 | rotate = 2; | ||
537 | mask = 0x00ffffff; | ||
535 | break; | 538 | break; |
536 | 539 | ||
537 | case DAVINCI_AUDIO_WORD_28: | 540 | case DAVINCI_AUDIO_WORD_28: |
538 | fmt = 0x0D; | 541 | fmt = 0x0D; |
542 | rotate = 1; | ||
543 | mask = 0x0fffffff; | ||
539 | break; | 544 | break; |
540 | 545 | ||
541 | case DAVINCI_AUDIO_WORD_32: | 546 | case DAVINCI_AUDIO_WORD_32: |
542 | fmt = 0x0F; | 547 | fmt = 0x0F; |
548 | rotate = 0; | ||
549 | mask = 0xffffffff; | ||
543 | break; | 550 | break; |
544 | 551 | ||
545 | default: | 552 | default: |
@@ -550,6 +557,13 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev, | |||
550 | RXSSZ(fmt), RXSSZ(0x0F)); | 557 | RXSSZ(fmt), RXSSZ(0x0F)); |
551 | mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, | 558 | mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, |
552 | TXSSZ(fmt), TXSSZ(0x0F)); | 559 | TXSSZ(fmt), TXSSZ(0x0F)); |
560 | mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, TXROT(rotate), | ||
561 | TXROT(7)); | ||
562 | mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG, RXROT(rotate), | ||
563 | RXROT(7)); | ||
564 | mcasp_set_reg(dev->base + DAVINCI_MCASP_TXMASK_REG, mask); | ||
565 | mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG, mask); | ||
566 | |||
553 | return 0; | 567 | return 0; |
554 | } | 568 | } |
555 | 569 | ||
@@ -638,7 +652,6 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream) | |||
638 | printk(KERN_ERR "playback tdm slot %d not supported\n", | 652 | printk(KERN_ERR "playback tdm slot %d not supported\n", |
639 | dev->tdm_slots); | 653 | dev->tdm_slots); |
640 | 654 | ||
641 | mcasp_set_reg(dev->base + DAVINCI_MCASP_TXMASK_REG, 0xFFFFFFFF); | ||
642 | mcasp_clr_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG, FSXDUR); | 655 | mcasp_clr_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG, FSXDUR); |
643 | } else { | 656 | } else { |
644 | /* bit stream is MSB first with no delay */ | 657 | /* bit stream is MSB first with no delay */ |
@@ -655,7 +668,6 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream) | |||
655 | printk(KERN_ERR "capture tdm slot %d not supported\n", | 668 | printk(KERN_ERR "capture tdm slot %d not supported\n", |
656 | dev->tdm_slots); | 669 | dev->tdm_slots); |
657 | 670 | ||
658 | mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG, 0xFFFFFFFF); | ||
659 | mcasp_clr_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG, FSRDUR); | 671 | mcasp_clr_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG, FSRDUR); |
660 | } | 672 | } |
661 | } | 673 | } |
@@ -700,7 +712,7 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream, | |||
700 | { | 712 | { |
701 | struct davinci_audio_dev *dev = cpu_dai->private_data; | 713 | struct davinci_audio_dev *dev = cpu_dai->private_data; |
702 | struct davinci_pcm_dma_params *dma_params = | 714 | struct davinci_pcm_dma_params *dma_params = |
703 | dev->dma_params[substream->stream]; | 715 | &dev->dma_params[substream->stream]; |
704 | int word_length; | 716 | int word_length; |
705 | u8 numevt; | 717 | u8 numevt; |
706 | 718 | ||
@@ -778,7 +790,6 @@ static int davinci_mcasp_trigger(struct snd_pcm_substream *substream, | |||
778 | } | 790 | } |
779 | 791 | ||
780 | static struct snd_soc_dai_ops davinci_mcasp_dai_ops = { | 792 | static struct snd_soc_dai_ops davinci_mcasp_dai_ops = { |
781 | .startup = davinci_mcasp_startup, | ||
782 | .trigger = davinci_mcasp_trigger, | 793 | .trigger = davinci_mcasp_trigger, |
783 | .hw_params = davinci_mcasp_hw_params, | 794 | .hw_params = davinci_mcasp_hw_params, |
784 | .set_fmt = davinci_mcasp_set_dai_fmt, | 795 | .set_fmt = davinci_mcasp_set_dai_fmt, |
@@ -829,20 +840,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
829 | struct resource *mem, *ioarea, *res; | 840 | struct resource *mem, *ioarea, *res; |
830 | struct snd_platform_data *pdata; | 841 | struct snd_platform_data *pdata; |
831 | struct davinci_audio_dev *dev; | 842 | struct davinci_audio_dev *dev; |
832 | int count = 0; | ||
833 | int ret = 0; | 843 | int ret = 0; |
834 | 844 | ||
835 | dev = kzalloc(sizeof(struct davinci_audio_dev), GFP_KERNEL); | 845 | dev = kzalloc(sizeof(struct davinci_audio_dev), GFP_KERNEL); |
836 | if (!dev) | 846 | if (!dev) |
837 | return -ENOMEM; | 847 | return -ENOMEM; |
838 | 848 | ||
839 | dma_data = kzalloc(sizeof(struct davinci_pcm_dma_params) * 2, | ||
840 | GFP_KERNEL); | ||
841 | if (!dma_data) { | ||
842 | ret = -ENOMEM; | ||
843 | goto err_release_dev; | ||
844 | } | ||
845 | |||
846 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 849 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
847 | if (!mem) { | 850 | if (!mem) { |
848 | dev_err(&pdev->dev, "no mem resource?\n"); | 851 | dev_err(&pdev->dev, "no mem resource?\n"); |
@@ -877,11 +880,10 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
877 | dev->txnumevt = pdata->txnumevt; | 880 | dev->txnumevt = pdata->txnumevt; |
878 | dev->rxnumevt = pdata->rxnumevt; | 881 | dev->rxnumevt = pdata->rxnumevt; |
879 | 882 | ||
880 | dma_data[count].name = "I2S PCM Stereo out"; | 883 | dma_data = &dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK]; |
881 | dma_data[count].eventq_no = pdata->eventq_no; | 884 | dma_data->eventq_no = pdata->eventq_no; |
882 | dma_data[count].dma_addr = (dma_addr_t) (pdata->tx_dma_offset + | 885 | dma_data->dma_addr = (dma_addr_t) (pdata->tx_dma_offset + |
883 | io_v2p(dev->base)); | 886 | io_v2p(dev->base)); |
884 | dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK] = &dma_data[count]; | ||
885 | 887 | ||
886 | /* first TX, then RX */ | 888 | /* first TX, then RX */ |
887 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); | 889 | res = platform_get_resource(pdev, IORESOURCE_DMA, 0); |
@@ -890,13 +892,12 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
890 | goto err_release_region; | 892 | goto err_release_region; |
891 | } | 893 | } |
892 | 894 | ||
893 | dma_data[count].channel = res->start; | 895 | dma_data->channel = res->start; |
894 | count++; | 896 | |
895 | dma_data[count].name = "I2S PCM Stereo in"; | 897 | dma_data = &dev->dma_params[SNDRV_PCM_STREAM_CAPTURE]; |
896 | dma_data[count].eventq_no = pdata->eventq_no; | 898 | dma_data->eventq_no = pdata->eventq_no; |
897 | dma_data[count].dma_addr = (dma_addr_t)(pdata->rx_dma_offset + | 899 | dma_data->dma_addr = (dma_addr_t)(pdata->rx_dma_offset + |
898 | io_v2p(dev->base)); | 900 | io_v2p(dev->base)); |
899 | dev->dma_params[SNDRV_PCM_STREAM_CAPTURE] = &dma_data[count]; | ||
900 | 901 | ||
901 | res = platform_get_resource(pdev, IORESOURCE_DMA, 1); | 902 | res = platform_get_resource(pdev, IORESOURCE_DMA, 1); |
902 | if (!res) { | 903 | if (!res) { |
@@ -904,7 +905,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
904 | goto err_release_region; | 905 | goto err_release_region; |
905 | } | 906 | } |
906 | 907 | ||
907 | dma_data[count].channel = res->start; | 908 | dma_data->channel = res->start; |
908 | davinci_mcasp_dai[pdata->op_mode].private_data = dev; | 909 | davinci_mcasp_dai[pdata->op_mode].private_data = dev; |
909 | davinci_mcasp_dai[pdata->op_mode].dev = &pdev->dev; | 910 | davinci_mcasp_dai[pdata->op_mode].dev = &pdev->dev; |
910 | ret = snd_soc_register_dai(&davinci_mcasp_dai[pdata->op_mode]); | 911 | ret = snd_soc_register_dai(&davinci_mcasp_dai[pdata->op_mode]); |
@@ -916,8 +917,6 @@ static int davinci_mcasp_probe(struct platform_device *pdev) | |||
916 | err_release_region: | 917 | err_release_region: |
917 | release_mem_region(mem->start, (mem->end - mem->start) + 1); | 918 | release_mem_region(mem->start, (mem->end - mem->start) + 1); |
918 | err_release_data: | 919 | err_release_data: |
919 | kfree(dma_data); | ||
920 | err_release_dev: | ||
921 | kfree(dev); | 920 | kfree(dev); |
922 | 921 | ||
923 | return ret; | 922 | return ret; |
@@ -926,7 +925,6 @@ err_release_dev: | |||
926 | static int davinci_mcasp_remove(struct platform_device *pdev) | 925 | static int davinci_mcasp_remove(struct platform_device *pdev) |
927 | { | 926 | { |
928 | struct snd_platform_data *pdata = pdev->dev.platform_data; | 927 | struct snd_platform_data *pdata = pdev->dev.platform_data; |
929 | struct davinci_pcm_dma_params *dma_data; | ||
930 | struct davinci_audio_dev *dev; | 928 | struct davinci_audio_dev *dev; |
931 | struct resource *mem; | 929 | struct resource *mem; |
932 | 930 | ||
@@ -939,8 +937,6 @@ static int davinci_mcasp_remove(struct platform_device *pdev) | |||
939 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 937 | mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
940 | release_mem_region(mem->start, (mem->end - mem->start) + 1); | 938 | release_mem_region(mem->start, (mem->end - mem->start) + 1); |
941 | 939 | ||
942 | dma_data = dev->dma_params[SNDRV_PCM_STREAM_PLAYBACK]; | ||
943 | kfree(dma_data); | ||
944 | kfree(dev); | 940 | kfree(dev); |
945 | 941 | ||
946 | return 0; | 942 | return 0; |
diff --git a/sound/soc/davinci/davinci-mcasp.h b/sound/soc/davinci/davinci-mcasp.h index 554354c1cc2f..9d179cc88f7b 100644 --- a/sound/soc/davinci/davinci-mcasp.h +++ b/sound/soc/davinci/davinci-mcasp.h | |||
@@ -39,10 +39,15 @@ enum { | |||
39 | }; | 39 | }; |
40 | 40 | ||
41 | struct davinci_audio_dev { | 41 | struct davinci_audio_dev { |
42 | /* | ||
43 | * dma_params must be first because rtd->dai->cpu_dai->private_data | ||
44 | * is cast to a pointer of an array of struct davinci_pcm_dma_params in | ||
45 | * davinci_pcm_open. | ||
46 | */ | ||
47 | struct davinci_pcm_dma_params dma_params[2]; | ||
42 | void __iomem *base; | 48 | void __iomem *base; |
43 | int sample_rate; | 49 | int sample_rate; |
44 | struct clk *clk; | 50 | struct clk *clk; |
45 | struct davinci_pcm_dma_params *dma_params[2]; | ||
46 | unsigned int codec_fmt; | 51 | unsigned int codec_fmt; |
47 | 52 | ||
48 | /* McASP specific data */ | 53 | /* McASP specific data */ |
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index 091dacb78b4d..359e99ec7244 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c | |||
@@ -126,16 +126,9 @@ static void davinci_pcm_dma_irq(unsigned lch, u16 ch_status, void *data) | |||
126 | static int davinci_pcm_dma_request(struct snd_pcm_substream *substream) | 126 | static int davinci_pcm_dma_request(struct snd_pcm_substream *substream) |
127 | { | 127 | { |
128 | struct davinci_runtime_data *prtd = substream->runtime->private_data; | 128 | struct davinci_runtime_data *prtd = substream->runtime->private_data; |
129 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
130 | struct davinci_pcm_dma_params *dma_data = rtd->dai->cpu_dai->dma_data; | ||
131 | struct edmacc_param p_ram; | 129 | struct edmacc_param p_ram; |
132 | int ret; | 130 | int ret; |
133 | 131 | ||
134 | if (!dma_data) | ||
135 | return -ENODEV; | ||
136 | |||
137 | prtd->params = dma_data; | ||
138 | |||
139 | /* Request master DMA channel */ | 132 | /* Request master DMA channel */ |
140 | ret = edma_alloc_channel(prtd->params->channel, | 133 | ret = edma_alloc_channel(prtd->params->channel, |
141 | davinci_pcm_dma_irq, substream, | 134 | davinci_pcm_dma_irq, substream, |
@@ -244,6 +237,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream) | |||
244 | struct snd_pcm_runtime *runtime = substream->runtime; | 237 | struct snd_pcm_runtime *runtime = substream->runtime; |
245 | struct davinci_runtime_data *prtd; | 238 | struct davinci_runtime_data *prtd; |
246 | int ret = 0; | 239 | int ret = 0; |
240 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | ||
241 | struct davinci_pcm_dma_params *pa = rtd->dai->cpu_dai->private_data; | ||
242 | struct davinci_pcm_dma_params *params = &pa[substream->stream]; | ||
243 | if (!params) | ||
244 | return -ENODEV; | ||
247 | 245 | ||
248 | snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware); | 246 | snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware); |
249 | /* ensure that buffer size is a multiple of period size */ | 247 | /* ensure that buffer size is a multiple of period size */ |
@@ -257,6 +255,7 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream) | |||
257 | return -ENOMEM; | 255 | return -ENOMEM; |
258 | 256 | ||
259 | spin_lock_init(&prtd->lock); | 257 | spin_lock_init(&prtd->lock); |
258 | prtd->params = params; | ||
260 | 259 | ||
261 | runtime->private_data = prtd; | 260 | runtime->private_data = prtd; |
262 | 261 | ||
diff --git a/sound/soc/davinci/davinci-pcm.h b/sound/soc/davinci/davinci-pcm.h index 63d96253c73a..8746606efc89 100644 --- a/sound/soc/davinci/davinci-pcm.h +++ b/sound/soc/davinci/davinci-pcm.h | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | 18 | ||
19 | struct davinci_pcm_dma_params { | 19 | struct davinci_pcm_dma_params { |
20 | char *name; /* stream identifier */ | ||
21 | int channel; /* sync dma channel ID */ | 20 | int channel; /* sync dma channel ID */ |
22 | unsigned short acnt; | 21 | unsigned short acnt; |
23 | dma_addr_t dma_addr; /* device physical address for DMA */ | 22 | dma_addr_t dma_addr; /* device physical address for DMA */ |
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 6375b4ea525d..dcb3181bb340 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig | |||
@@ -138,7 +138,7 @@ config SND_PXA2XX_SOC_MIOA701 | |||
138 | 138 | ||
139 | config SND_PXA2XX_SOC_IMOTE2 | 139 | config SND_PXA2XX_SOC_IMOTE2 |
140 | tristate "SoC Audio support for IMote 2" | 140 | tristate "SoC Audio support for IMote 2" |
141 | depends on SND_PXA2XX_SOC && MACH_INTELMOTE2 | 141 | depends on SND_PXA2XX_SOC && MACH_INTELMOTE2 && I2C |
142 | select SND_PXA2XX_SOC_I2S | 142 | select SND_PXA2XX_SOC_I2S |
143 | select SND_SOC_WM8940 | 143 | select SND_SOC_WM8940 |
144 | help | 144 | help |