diff options
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r-- | sound/soc/pxa/corgi.c | 81 | ||||
-rw-r--r-- | sound/soc/pxa/e740_wm9705.c | 84 | ||||
-rw-r--r-- | sound/soc/pxa/e750_wm9705.c | 73 | ||||
-rw-r--r-- | sound/soc/pxa/e800_wm9712.c | 73 | ||||
-rw-r--r-- | sound/soc/pxa/em-x270.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/hx4700.c | 30 | ||||
-rw-r--r-- | sound/soc/pxa/imote2.c | 58 | ||||
-rw-r--r-- | sound/soc/pxa/magician.c | 1 | ||||
-rw-r--r-- | sound/soc/pxa/mioa701_wm9713.c | 14 | ||||
-rw-r--r-- | sound/soc/pxa/palm27x.c | 14 | ||||
-rw-r--r-- | sound/soc/pxa/poodle.c | 79 | ||||
-rw-r--r-- | sound/soc/pxa/pxa-ssp.c | 14 | ||||
-rw-r--r-- | sound/soc/pxa/pxa2xx-ac97.c | 18 | ||||
-rw-r--r-- | sound/soc/pxa/pxa2xx-i2s.c | 2 | ||||
-rw-r--r-- | sound/soc/pxa/pxa2xx-pcm.c | 12 | ||||
-rw-r--r-- | sound/soc/pxa/raumfeld.c | 2 | ||||
-rw-r--r-- | sound/soc/pxa/saarb.c | 24 | ||||
-rw-r--r-- | sound/soc/pxa/spitz.c | 38 | ||||
-rw-r--r-- | sound/soc/pxa/tavorevb3.c | 25 | ||||
-rw-r--r-- | sound/soc/pxa/tosa.c | 78 | ||||
-rw-r--r-- | sound/soc/pxa/z2.c | 29 | ||||
-rw-r--r-- | sound/soc/pxa/zylonite.c | 1 |
22 files changed, 282 insertions, 469 deletions
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c index b0e2fb720910..bc21944851c4 100644 --- a/sound/soc/pxa/corgi.c +++ b/sound/soc/pxa/corgi.c | |||
@@ -142,18 +142,6 @@ static int corgi_hw_params(struct snd_pcm_substream *substream, | |||
142 | break; | 142 | break; |
143 | } | 143 | } |
144 | 144 | ||
145 | /* set codec DAI configuration */ | ||
146 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | ||
147 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
148 | if (ret < 0) | ||
149 | return ret; | ||
150 | |||
151 | /* set cpu DAI configuration */ | ||
152 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | ||
153 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
154 | if (ret < 0) | ||
155 | return ret; | ||
156 | |||
157 | /* set the codec system clock for DAC and ADC */ | 145 | /* set the codec system clock for DAC and ADC */ |
158 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL, clk, | 146 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL, clk, |
159 | SND_SOC_CLOCK_IN); | 147 | SND_SOC_CLOCK_IN); |
@@ -239,7 +227,7 @@ SND_SOC_DAPM_HP("Headset Jack", NULL), | |||
239 | }; | 227 | }; |
240 | 228 | ||
241 | /* Corgi machine audio map (connections to the codec pins) */ | 229 | /* Corgi machine audio map (connections to the codec pins) */ |
242 | static const struct snd_soc_dapm_route audio_map[] = { | 230 | static const struct snd_soc_dapm_route corgi_audio_map[] = { |
243 | 231 | ||
244 | /* headset Jack - in = micin, out = LHPOUT*/ | 232 | /* headset Jack - in = micin, out = LHPOUT*/ |
245 | {"Headset Jack", NULL, "LHPOUT"}, | 233 | {"Headset Jack", NULL, "LHPOUT"}, |
@@ -281,24 +269,10 @@ static int corgi_wm8731_init(struct snd_soc_pcm_runtime *rtd) | |||
281 | { | 269 | { |
282 | struct snd_soc_codec *codec = rtd->codec; | 270 | struct snd_soc_codec *codec = rtd->codec; |
283 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 271 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
284 | int err; | ||
285 | 272 | ||
286 | snd_soc_dapm_nc_pin(dapm, "LLINEIN"); | 273 | snd_soc_dapm_nc_pin(dapm, "LLINEIN"); |
287 | snd_soc_dapm_nc_pin(dapm, "RLINEIN"); | 274 | snd_soc_dapm_nc_pin(dapm, "RLINEIN"); |
288 | 275 | ||
289 | /* Add corgi specific controls */ | ||
290 | err = snd_soc_add_controls(codec, wm8731_corgi_controls, | ||
291 | ARRAY_SIZE(wm8731_corgi_controls)); | ||
292 | if (err < 0) | ||
293 | return err; | ||
294 | |||
295 | /* Add corgi specific widgets */ | ||
296 | snd_soc_dapm_new_controls(dapm, wm8731_dapm_widgets, | ||
297 | ARRAY_SIZE(wm8731_dapm_widgets)); | ||
298 | |||
299 | /* Set up corgi specific audio path audio_map */ | ||
300 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
301 | |||
302 | return 0; | 276 | return 0; |
303 | } | 277 | } |
304 | 278 | ||
@@ -311,48 +285,61 @@ static struct snd_soc_dai_link corgi_dai = { | |||
311 | .platform_name = "pxa-pcm-audio", | 285 | .platform_name = "pxa-pcm-audio", |
312 | .codec_name = "wm8731.0-001b", | 286 | .codec_name = "wm8731.0-001b", |
313 | .init = corgi_wm8731_init, | 287 | .init = corgi_wm8731_init, |
288 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
289 | SND_SOC_DAIFMT_CBS_CFS, | ||
314 | .ops = &corgi_ops, | 290 | .ops = &corgi_ops, |
315 | }; | 291 | }; |
316 | 292 | ||
317 | /* corgi audio machine driver */ | 293 | /* corgi audio machine driver */ |
318 | static struct snd_soc_card snd_soc_corgi = { | 294 | static struct snd_soc_card corgi = { |
319 | .name = "Corgi", | 295 | .name = "Corgi", |
296 | .owner = THIS_MODULE, | ||
320 | .dai_link = &corgi_dai, | 297 | .dai_link = &corgi_dai, |
321 | .num_links = 1, | 298 | .num_links = 1, |
322 | }; | ||
323 | 299 | ||
324 | static struct platform_device *corgi_snd_device; | 300 | .controls = wm8731_corgi_controls, |
301 | .num_controls = ARRAY_SIZE(wm8731_corgi_controls), | ||
302 | .dapm_widgets = wm8731_dapm_widgets, | ||
303 | .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), | ||
304 | .dapm_routes = corgi_audio_map, | ||
305 | .num_dapm_routes = ARRAY_SIZE(corgi_audio_map), | ||
306 | }; | ||
325 | 307 | ||
326 | static int __init corgi_init(void) | 308 | static int __devinit corgi_probe(struct platform_device *pdev) |
327 | { | 309 | { |
310 | struct snd_soc_card *card = &corgi; | ||
328 | int ret; | 311 | int ret; |
329 | 312 | ||
330 | if (!(machine_is_corgi() || machine_is_shepherd() || | 313 | card->dev = &pdev->dev; |
331 | machine_is_husky())) | ||
332 | return -ENODEV; | ||
333 | |||
334 | corgi_snd_device = platform_device_alloc("soc-audio", -1); | ||
335 | if (!corgi_snd_device) | ||
336 | return -ENOMEM; | ||
337 | |||
338 | platform_set_drvdata(corgi_snd_device, &snd_soc_corgi); | ||
339 | ret = platform_device_add(corgi_snd_device); | ||
340 | 314 | ||
315 | ret = snd_soc_register_card(card); | ||
341 | if (ret) | 316 | if (ret) |
342 | platform_device_put(corgi_snd_device); | 317 | dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", |
343 | 318 | ret); | |
344 | return ret; | 319 | return ret; |
345 | } | 320 | } |
346 | 321 | ||
347 | static void __exit corgi_exit(void) | 322 | static int __devexit corgi_remove(struct platform_device *pdev) |
348 | { | 323 | { |
349 | platform_device_unregister(corgi_snd_device); | 324 | struct snd_soc_card *card = platform_get_drvdata(pdev); |
325 | |||
326 | snd_soc_unregister_card(card); | ||
327 | return 0; | ||
350 | } | 328 | } |
351 | 329 | ||
352 | module_init(corgi_init); | 330 | static struct platform_driver corgi_driver = { |
353 | module_exit(corgi_exit); | 331 | .driver = { |
332 | .name = "corgi-audio", | ||
333 | .owner = THIS_MODULE, | ||
334 | }, | ||
335 | .probe = corgi_probe, | ||
336 | .remove = __devexit_p(corgi_remove), | ||
337 | }; | ||
338 | |||
339 | module_platform_driver(corgi_driver); | ||
354 | 340 | ||
355 | /* Module information */ | 341 | /* Module information */ |
356 | MODULE_AUTHOR("Richard Purdie"); | 342 | MODULE_AUTHOR("Richard Purdie"); |
357 | MODULE_DESCRIPTION("ALSA SoC Corgi"); | 343 | MODULE_DESCRIPTION("ALSA SoC Corgi"); |
358 | MODULE_LICENSE("GPL"); | 344 | MODULE_LICENSE("GPL"); |
345 | MODULE_ALIAS("platform:corgi-audio"); | ||
diff --git a/sound/soc/pxa/e740_wm9705.c b/sound/soc/pxa/e740_wm9705.c index 35ed7eb8cff2..7b1bc2390039 100644 --- a/sound/soc/pxa/e740_wm9705.c +++ b/sound/soc/pxa/e740_wm9705.c | |||
@@ -133,78 +133,60 @@ static struct snd_soc_dai_link e740_dai[] = { | |||
133 | 133 | ||
134 | static struct snd_soc_card e740 = { | 134 | static struct snd_soc_card e740 = { |
135 | .name = "Toshiba e740", | 135 | .name = "Toshiba e740", |
136 | .owner = THIS_MODULE, | ||
136 | .dai_link = e740_dai, | 137 | .dai_link = e740_dai, |
137 | .num_links = ARRAY_SIZE(e740_dai), | 138 | .num_links = ARRAY_SIZE(e740_dai), |
138 | }; | 139 | }; |
139 | 140 | ||
140 | static struct platform_device *e740_snd_device; | 141 | static struct gpio e740_audio_gpios[] = { |
142 | { GPIO_E740_MIC_ON, GPIOF_OUT_INIT_LOW, "Mic amp" }, | ||
143 | { GPIO_E740_AMP_ON, GPIOF_OUT_INIT_LOW, "Output amp" }, | ||
144 | { GPIO_E740_WM9705_nAVDD2, GPIOF_OUT_INIT_HIGH, "Audio power" }, | ||
145 | }; | ||
141 | 146 | ||
142 | static int __init e740_init(void) | 147 | static int __devinit e740_probe(struct platform_device *pdev) |
143 | { | 148 | { |
149 | struct snd_soc_card *card = &e740; | ||
144 | int ret; | 150 | int ret; |
145 | 151 | ||
146 | if (!machine_is_e740()) | 152 | ret = gpio_request_array(e740_audio_gpios, |
147 | return -ENODEV; | 153 | ARRAY_SIZE(e740_audio_gpios)); |
148 | |||
149 | ret = gpio_request(GPIO_E740_MIC_ON, "Mic amp"); | ||
150 | if (ret) | 154 | if (ret) |
151 | return ret; | 155 | return ret; |
152 | 156 | ||
153 | ret = gpio_request(GPIO_E740_AMP_ON, "Output amp"); | 157 | card->dev = &pdev->dev; |
154 | if (ret) | ||
155 | goto free_mic_amp_gpio; | ||
156 | |||
157 | ret = gpio_request(GPIO_E740_WM9705_nAVDD2, "Audio power"); | ||
158 | if (ret) | ||
159 | goto free_op_amp_gpio; | ||
160 | |||
161 | /* Disable audio */ | ||
162 | ret = gpio_direction_output(GPIO_E740_MIC_ON, 0); | ||
163 | if (ret) | ||
164 | goto free_apwr_gpio; | ||
165 | ret = gpio_direction_output(GPIO_E740_AMP_ON, 0); | ||
166 | if (ret) | ||
167 | goto free_apwr_gpio; | ||
168 | ret = gpio_direction_output(GPIO_E740_WM9705_nAVDD2, 1); | ||
169 | if (ret) | ||
170 | goto free_apwr_gpio; | ||
171 | 158 | ||
172 | e740_snd_device = platform_device_alloc("soc-audio", -1); | 159 | ret = snd_soc_register_card(card); |
173 | if (!e740_snd_device) { | 160 | if (ret) { |
174 | ret = -ENOMEM; | 161 | dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", |
175 | goto free_apwr_gpio; | 162 | ret); |
163 | gpio_free_array(e740_audio_gpios, ARRAY_SIZE(e740_audio_gpios)); | ||
176 | } | 164 | } |
177 | |||
178 | platform_set_drvdata(e740_snd_device, &e740); | ||
179 | ret = platform_device_add(e740_snd_device); | ||
180 | |||
181 | if (!ret) | ||
182 | return 0; | ||
183 | |||
184 | /* Fail gracefully */ | ||
185 | platform_device_put(e740_snd_device); | ||
186 | free_apwr_gpio: | ||
187 | gpio_free(GPIO_E740_WM9705_nAVDD2); | ||
188 | free_op_amp_gpio: | ||
189 | gpio_free(GPIO_E740_AMP_ON); | ||
190 | free_mic_amp_gpio: | ||
191 | gpio_free(GPIO_E740_MIC_ON); | ||
192 | |||
193 | return ret; | 165 | return ret; |
194 | } | 166 | } |
195 | 167 | ||
196 | static void __exit e740_exit(void) | 168 | static int __devexit e740_remove(struct platform_device *pdev) |
197 | { | 169 | { |
198 | platform_device_unregister(e740_snd_device); | 170 | struct snd_soc_card *card = platform_get_drvdata(pdev); |
199 | gpio_free(GPIO_E740_WM9705_nAVDD2); | 171 | |
200 | gpio_free(GPIO_E740_AMP_ON); | 172 | gpio_free_array(e740_audio_gpios, ARRAY_SIZE(e740_audio_gpios)); |
201 | gpio_free(GPIO_E740_MIC_ON); | 173 | snd_soc_unregister_card(card); |
174 | return 0; | ||
202 | } | 175 | } |
203 | 176 | ||
204 | module_init(e740_init); | 177 | static struct platform_driver e740_driver = { |
205 | module_exit(e740_exit); | 178 | .driver = { |
179 | .name = "e740-audio", | ||
180 | .owner = THIS_MODULE, | ||
181 | }, | ||
182 | .probe = e740_probe, | ||
183 | .remove = __devexit_p(e740_remove), | ||
184 | }; | ||
185 | |||
186 | module_platform_driver(e740_driver); | ||
206 | 187 | ||
207 | /* Module information */ | 188 | /* Module information */ |
208 | MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); | 189 | MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); |
209 | MODULE_DESCRIPTION("ALSA SoC driver for e740"); | 190 | MODULE_DESCRIPTION("ALSA SoC driver for e740"); |
210 | MODULE_LICENSE("GPL v2"); | 191 | MODULE_LICENSE("GPL v2"); |
192 | MODULE_ALIAS("platform:e740-audio"); | ||
diff --git a/sound/soc/pxa/e750_wm9705.c b/sound/soc/pxa/e750_wm9705.c index ce5f056009a7..47b89d71e287 100644 --- a/sound/soc/pxa/e750_wm9705.c +++ b/sound/soc/pxa/e750_wm9705.c | |||
@@ -116,68 +116,59 @@ static struct snd_soc_dai_link e750_dai[] = { | |||
116 | 116 | ||
117 | static struct snd_soc_card e750 = { | 117 | static struct snd_soc_card e750 = { |
118 | .name = "Toshiba e750", | 118 | .name = "Toshiba e750", |
119 | .owner = THIS_MODULE, | ||
119 | .dai_link = e750_dai, | 120 | .dai_link = e750_dai, |
120 | .num_links = ARRAY_SIZE(e750_dai), | 121 | .num_links = ARRAY_SIZE(e750_dai), |
121 | }; | 122 | }; |
122 | 123 | ||
123 | static struct platform_device *e750_snd_device; | 124 | static struct gpio e750_audio_gpios[] = { |
125 | { GPIO_E750_HP_AMP_OFF, GPIOF_OUT_INIT_HIGH, "Headphone amp" }, | ||
126 | { GPIO_E750_SPK_AMP_OFF, GPIOF_OUT_INIT_HIGH, "Speaker amp" }, | ||
127 | }; | ||
124 | 128 | ||
125 | static int __init e750_init(void) | 129 | static int __devinit e750_probe(struct platform_device *pdev) |
126 | { | 130 | { |
131 | struct snd_soc_card *card = &e750; | ||
127 | int ret; | 132 | int ret; |
128 | 133 | ||
129 | if (!machine_is_e750()) | 134 | ret = gpio_request_array(e750_audio_gpios, |
130 | return -ENODEV; | 135 | ARRAY_SIZE(e750_audio_gpios)); |
131 | |||
132 | ret = gpio_request(GPIO_E750_HP_AMP_OFF, "Headphone amp"); | ||
133 | if (ret) | 136 | if (ret) |
134 | return ret; | 137 | return ret; |
135 | 138 | ||
136 | ret = gpio_request(GPIO_E750_SPK_AMP_OFF, "Speaker amp"); | 139 | card->dev = &pdev->dev; |
137 | if (ret) | ||
138 | goto free_hp_amp_gpio; | ||
139 | |||
140 | ret = gpio_direction_output(GPIO_E750_HP_AMP_OFF, 1); | ||
141 | if (ret) | ||
142 | goto free_spk_amp_gpio; | ||
143 | |||
144 | ret = gpio_direction_output(GPIO_E750_SPK_AMP_OFF, 1); | ||
145 | if (ret) | ||
146 | goto free_spk_amp_gpio; | ||
147 | 140 | ||
148 | e750_snd_device = platform_device_alloc("soc-audio", -1); | 141 | ret = snd_soc_register_card(card); |
149 | if (!e750_snd_device) { | 142 | if (ret) { |
150 | ret = -ENOMEM; | 143 | dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", |
151 | goto free_spk_amp_gpio; | 144 | ret); |
145 | gpio_free_array(e750_audio_gpios, ARRAY_SIZE(e750_audio_gpios)); | ||
152 | } | 146 | } |
153 | |||
154 | platform_set_drvdata(e750_snd_device, &e750); | ||
155 | ret = platform_device_add(e750_snd_device); | ||
156 | |||
157 | if (!ret) | ||
158 | return 0; | ||
159 | |||
160 | /* Fail gracefully */ | ||
161 | platform_device_put(e750_snd_device); | ||
162 | free_spk_amp_gpio: | ||
163 | gpio_free(GPIO_E750_SPK_AMP_OFF); | ||
164 | free_hp_amp_gpio: | ||
165 | gpio_free(GPIO_E750_HP_AMP_OFF); | ||
166 | |||
167 | return ret; | 147 | return ret; |
168 | } | 148 | } |
169 | 149 | ||
170 | static void __exit e750_exit(void) | 150 | static int __devexit e750_remove(struct platform_device *pdev) |
171 | { | 151 | { |
172 | platform_device_unregister(e750_snd_device); | 152 | struct snd_soc_card *card = platform_get_drvdata(pdev); |
173 | gpio_free(GPIO_E750_SPK_AMP_OFF); | 153 | |
174 | gpio_free(GPIO_E750_HP_AMP_OFF); | 154 | gpio_free_array(e750_audio_gpios, ARRAY_SIZE(e750_audio_gpios)); |
155 | snd_soc_unregister_card(card); | ||
156 | return 0; | ||
175 | } | 157 | } |
176 | 158 | ||
177 | module_init(e750_init); | 159 | static struct platform_driver e750_driver = { |
178 | module_exit(e750_exit); | 160 | .driver = { |
161 | .name = "e750-audio", | ||
162 | .owner = THIS_MODULE, | ||
163 | }, | ||
164 | .probe = e750_probe, | ||
165 | .remove = __devexit_p(e750_remove), | ||
166 | }; | ||
167 | |||
168 | module_platform_driver(e750_driver); | ||
179 | 169 | ||
180 | /* Module information */ | 170 | /* Module information */ |
181 | MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); | 171 | MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); |
182 | MODULE_DESCRIPTION("ALSA SoC driver for e750"); | 172 | MODULE_DESCRIPTION("ALSA SoC driver for e750"); |
183 | MODULE_LICENSE("GPL v2"); | 173 | MODULE_LICENSE("GPL v2"); |
174 | MODULE_ALIAS("platform:e750-audio"); | ||
diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c index 6a8f38b6c379..ea9707ec6f28 100644 --- a/sound/soc/pxa/e800_wm9712.c +++ b/sound/soc/pxa/e800_wm9712.c | |||
@@ -106,66 +106,59 @@ static struct snd_soc_dai_link e800_dai[] = { | |||
106 | 106 | ||
107 | static struct snd_soc_card e800 = { | 107 | static struct snd_soc_card e800 = { |
108 | .name = "Toshiba e800", | 108 | .name = "Toshiba e800", |
109 | .owner = THIS_MODULE, | ||
109 | .dai_link = e800_dai, | 110 | .dai_link = e800_dai, |
110 | .num_links = ARRAY_SIZE(e800_dai), | 111 | .num_links = ARRAY_SIZE(e800_dai), |
111 | }; | 112 | }; |
112 | 113 | ||
113 | static struct platform_device *e800_snd_device; | 114 | static struct gpio e800_audio_gpios[] = { |
115 | { GPIO_E800_SPK_AMP_ON, GPIOF_OUT_INIT_HIGH, "Headphone amp" }, | ||
116 | { GPIO_E800_HP_AMP_OFF, GPIOF_OUT_INIT_HIGH, "Speaker amp" }, | ||
117 | }; | ||
114 | 118 | ||
115 | static int __init e800_init(void) | 119 | static int __devinit e800_probe(struct platform_device *pdev) |
116 | { | 120 | { |
121 | struct snd_soc_card *card = &e800; | ||
117 | int ret; | 122 | int ret; |
118 | 123 | ||
119 | if (!machine_is_e800()) | 124 | ret = gpio_request_array(e800_audio_gpios, |
120 | return -ENODEV; | 125 | ARRAY_SIZE(e800_audio_gpios)); |
121 | |||
122 | ret = gpio_request(GPIO_E800_HP_AMP_OFF, "Headphone amp"); | ||
123 | if (ret) | 126 | if (ret) |
124 | return ret; | 127 | return ret; |
125 | 128 | ||
126 | ret = gpio_request(GPIO_E800_SPK_AMP_ON, "Speaker amp"); | 129 | card->dev = &pdev->dev; |
127 | if (ret) | ||
128 | goto free_hp_amp_gpio; | ||
129 | |||
130 | ret = gpio_direction_output(GPIO_E800_HP_AMP_OFF, 1); | ||
131 | if (ret) | ||
132 | goto free_spk_amp_gpio; | ||
133 | |||
134 | ret = gpio_direction_output(GPIO_E800_SPK_AMP_ON, 1); | ||
135 | if (ret) | ||
136 | goto free_spk_amp_gpio; | ||
137 | |||
138 | e800_snd_device = platform_device_alloc("soc-audio", -1); | ||
139 | if (!e800_snd_device) | ||
140 | return -ENOMEM; | ||
141 | |||
142 | platform_set_drvdata(e800_snd_device, &e800); | ||
143 | ret = platform_device_add(e800_snd_device); | ||
144 | |||
145 | if (!ret) | ||
146 | return 0; | ||
147 | |||
148 | /* Fail gracefully */ | ||
149 | platform_device_put(e800_snd_device); | ||
150 | free_spk_amp_gpio: | ||
151 | gpio_free(GPIO_E800_SPK_AMP_ON); | ||
152 | free_hp_amp_gpio: | ||
153 | gpio_free(GPIO_E800_HP_AMP_OFF); | ||
154 | 130 | ||
131 | ret = snd_soc_register_card(card); | ||
132 | if (ret) { | ||
133 | dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", | ||
134 | ret); | ||
135 | gpio_free_array(e800_audio_gpios, ARRAY_SIZE(e800_audio_gpios)); | ||
136 | } | ||
155 | return ret; | 137 | return ret; |
156 | } | 138 | } |
157 | 139 | ||
158 | static void __exit e800_exit(void) | 140 | static int __devexit e800_remove(struct platform_device *pdev) |
159 | { | 141 | { |
160 | platform_device_unregister(e800_snd_device); | 142 | struct snd_soc_card *card = platform_get_drvdata(pdev); |
161 | gpio_free(GPIO_E800_SPK_AMP_ON); | 143 | |
162 | gpio_free(GPIO_E800_HP_AMP_OFF); | 144 | gpio_free_array(e800_audio_gpios, ARRAY_SIZE(e800_audio_gpios)); |
145 | snd_soc_unregister_card(card); | ||
146 | return 0; | ||
163 | } | 147 | } |
164 | 148 | ||
165 | module_init(e800_init); | 149 | static struct platform_driver e800_driver = { |
166 | module_exit(e800_exit); | 150 | .driver = { |
151 | .name = "e800-audio", | ||
152 | .owner = THIS_MODULE, | ||
153 | }, | ||
154 | .probe = e800_probe, | ||
155 | .remove = __devexit_p(e800_remove), | ||
156 | }; | ||
157 | |||
158 | module_platform_driver(e800_driver); | ||
167 | 159 | ||
168 | /* Module information */ | 160 | /* Module information */ |
169 | MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); | 161 | MODULE_AUTHOR("Ian Molton <spyro@f2s.com>"); |
170 | MODULE_DESCRIPTION("ALSA SoC driver for e800"); | 162 | MODULE_DESCRIPTION("ALSA SoC driver for e800"); |
171 | MODULE_LICENSE("GPL v2"); | 163 | MODULE_LICENSE("GPL v2"); |
164 | MODULE_ALIAS("platform:e800-audio"); | ||
diff --git a/sound/soc/pxa/em-x270.c b/sound/soc/pxa/em-x270.c index b13a4252812d..64743a05aeae 100644 --- a/sound/soc/pxa/em-x270.c +++ b/sound/soc/pxa/em-x270.c | |||
@@ -54,6 +54,7 @@ static struct snd_soc_dai_link em_x270_dai[] = { | |||
54 | 54 | ||
55 | static struct snd_soc_card em_x270 = { | 55 | static struct snd_soc_card em_x270 = { |
56 | .name = "EM-X270", | 56 | .name = "EM-X270", |
57 | .owner = THIS_MODULE, | ||
57 | .dai_link = em_x270_dai, | 58 | .dai_link = em_x270_dai, |
58 | .num_links = ARRAY_SIZE(em_x270_dai), | 59 | .num_links = ARRAY_SIZE(em_x270_dai), |
59 | }; | 60 | }; |
diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c index c664e33fb6d7..2a342c92d829 100644 --- a/sound/soc/pxa/hx4700.c +++ b/sound/soc/pxa/hx4700.c | |||
@@ -65,20 +65,6 @@ static int hx4700_hw_params(struct snd_pcm_substream *substream, | |||
65 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; | 65 | struct snd_soc_dai *cpu_dai = rtd->cpu_dai; |
66 | int ret = 0; | 66 | int ret = 0; |
67 | 67 | ||
68 | /* set codec DAI configuration */ | ||
69 | ret = snd_soc_dai_set_fmt(codec_dai, | ||
70 | SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF | | ||
71 | SND_SOC_DAIFMT_CBS_CFS); | ||
72 | if (ret < 0) | ||
73 | return ret; | ||
74 | |||
75 | /* set cpu DAI configuration */ | ||
76 | ret = snd_soc_dai_set_fmt(cpu_dai, | ||
77 | SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF | | ||
78 | SND_SOC_DAIFMT_CBS_CFS); | ||
79 | if (ret < 0) | ||
80 | return ret; | ||
81 | |||
82 | /* set the I2S system clock as output */ | 68 | /* set the I2S system clock as output */ |
83 | ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0, | 69 | ret = snd_soc_dai_set_sysclk(cpu_dai, PXA2XX_I2S_SYSCLK, 0, |
84 | SND_SOC_CLOCK_OUT); | 70 | SND_SOC_CLOCK_OUT); |
@@ -175,12 +161,15 @@ static struct snd_soc_dai_link hx4700_dai = { | |||
175 | .platform_name = "pxa-pcm-audio", | 161 | .platform_name = "pxa-pcm-audio", |
176 | .codec_name = "ak4641.0-0012", | 162 | .codec_name = "ak4641.0-0012", |
177 | .init = hx4700_ak4641_init, | 163 | .init = hx4700_ak4641_init, |
164 | .dai_fmt = SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF | | ||
165 | SND_SOC_DAIFMT_CBS_CFS, | ||
178 | .ops = &hx4700_ops, | 166 | .ops = &hx4700_ops, |
179 | }; | 167 | }; |
180 | 168 | ||
181 | /* hx4700 audio machine driver */ | 169 | /* hx4700 audio machine driver */ |
182 | static struct snd_soc_card snd_soc_card_hx4700 = { | 170 | static struct snd_soc_card snd_soc_card_hx4700 = { |
183 | .name = "iPAQ hx4700", | 171 | .name = "iPAQ hx4700", |
172 | .owner = THIS_MODULE, | ||
184 | .dai_link = &hx4700_dai, | 173 | .dai_link = &hx4700_dai, |
185 | .num_links = 1, | 174 | .num_links = 1, |
186 | .dapm_widgets = hx4700_dapm_widgets, | 175 | .dapm_widgets = hx4700_dapm_widgets, |
@@ -237,18 +226,7 @@ static struct platform_driver hx4700_audio_driver = { | |||
237 | .remove = __devexit_p(hx4700_audio_remove), | 226 | .remove = __devexit_p(hx4700_audio_remove), |
238 | }; | 227 | }; |
239 | 228 | ||
240 | static int __init hx4700_modinit(void) | 229 | module_platform_driver(hx4700_audio_driver); |
241 | { | ||
242 | return platform_driver_register(&hx4700_audio_driver); | ||
243 | } | ||
244 | module_init(hx4700_modinit); | ||
245 | |||
246 | static void __exit hx4700_modexit(void) | ||
247 | { | ||
248 | platform_driver_unregister(&hx4700_audio_driver); | ||
249 | } | ||
250 | |||
251 | module_exit(hx4700_modexit); | ||
252 | 230 | ||
253 | MODULE_AUTHOR("Philipp Zabel"); | 231 | MODULE_AUTHOR("Philipp Zabel"); |
254 | MODULE_DESCRIPTION("ALSA SoC iPAQ hx4700"); | 232 | MODULE_DESCRIPTION("ALSA SoC iPAQ hx4700"); |
diff --git a/sound/soc/pxa/imote2.c b/sound/soc/pxa/imote2.c index 154fc6f23438..b93dafd32b80 100644 --- a/sound/soc/pxa/imote2.c +++ b/sound/soc/pxa/imote2.c | |||
@@ -30,20 +30,6 @@ static int imote2_asoc_hw_params(struct snd_pcm_substream *substream, | |||
30 | break; | 30 | break; |
31 | } | 31 | } |
32 | 32 | ||
33 | /* set codec DAI configuration */ | ||
34 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | ||
35 | | SND_SOC_DAIFMT_NB_NF | ||
36 | | SND_SOC_DAIFMT_CBS_CFS); | ||
37 | if (ret < 0) | ||
38 | return ret; | ||
39 | |||
40 | /* CPU should be clock master */ | ||
41 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | ||
42 | | SND_SOC_DAIFMT_NB_NF | ||
43 | | SND_SOC_DAIFMT_CBS_CFS); | ||
44 | if (ret < 0) | ||
45 | return ret; | ||
46 | |||
47 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, clk, | 33 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, clk, |
48 | SND_SOC_CLOCK_IN); | 34 | SND_SOC_CLOCK_IN); |
49 | if (ret < 0) | 35 | if (ret < 0) |
@@ -67,42 +53,52 @@ static struct snd_soc_dai_link imote2_dai = { | |||
67 | .codec_dai_name = "wm8940-hifi", | 53 | .codec_dai_name = "wm8940-hifi", |
68 | .platform_name = "pxa-pcm-audio", | 54 | .platform_name = "pxa-pcm-audio", |
69 | .codec_name = "wm8940-codec.0-0034", | 55 | .codec_name = "wm8940-codec.0-0034", |
56 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
57 | SND_SOC_DAIFMT_CBS_CFS, | ||
70 | .ops = &imote2_asoc_ops, | 58 | .ops = &imote2_asoc_ops, |
71 | }; | 59 | }; |
72 | 60 | ||
73 | static struct snd_soc_card snd_soc_imote2 = { | 61 | static struct snd_soc_card imote2 = { |
74 | .name = "Imote2", | 62 | .name = "Imote2", |
63 | .owner = THIS_MODULE, | ||
75 | .dai_link = &imote2_dai, | 64 | .dai_link = &imote2_dai, |
76 | .num_links = 1, | 65 | .num_links = 1, |
77 | }; | 66 | }; |
78 | 67 | ||
79 | static struct platform_device *imote2_snd_device; | 68 | static int __devinit imote2_probe(struct platform_device *pdev) |
80 | |||
81 | static int __init imote2_asoc_init(void) | ||
82 | { | 69 | { |
70 | struct snd_soc_card *card = &imote2; | ||
83 | int ret; | 71 | int ret; |
84 | 72 | ||
85 | if (!machine_is_intelmote2()) | 73 | card->dev = &pdev->dev; |
86 | return -ENODEV; | ||
87 | imote2_snd_device = platform_device_alloc("soc-audio", -1); | ||
88 | if (!imote2_snd_device) | ||
89 | return -ENOMEM; | ||
90 | 74 | ||
91 | platform_set_drvdata(imote2_snd_device, &snd_soc_imote2); | 75 | ret = snd_soc_register_card(card); |
92 | ret = platform_device_add(imote2_snd_device); | ||
93 | if (ret) | 76 | if (ret) |
94 | platform_device_put(imote2_snd_device); | 77 | dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", |
95 | 78 | ret); | |
96 | return ret; | 79 | return ret; |
97 | } | 80 | } |
98 | module_init(imote2_asoc_init); | ||
99 | 81 | ||
100 | static void __exit imote2_asoc_exit(void) | 82 | static int __devexit imote2_remove(struct platform_device *pdev) |
101 | { | 83 | { |
102 | platform_device_unregister(imote2_snd_device); | 84 | struct snd_soc_card *card = platform_get_drvdata(pdev); |
85 | |||
86 | snd_soc_unregister_card(card); | ||
87 | return 0; | ||
103 | } | 88 | } |
104 | module_exit(imote2_asoc_exit); | 89 | |
90 | static struct platform_driver imote2_driver = { | ||
91 | .driver = { | ||
92 | .name = "imote2-audio", | ||
93 | .owner = THIS_MODULE, | ||
94 | }, | ||
95 | .probe = imote2_probe, | ||
96 | .remove = __devexit_p(imote2_remove), | ||
97 | }; | ||
98 | |||
99 | module_platform_driver(imote2_driver); | ||
105 | 100 | ||
106 | MODULE_AUTHOR("Jonathan Cameron"); | 101 | MODULE_AUTHOR("Jonathan Cameron"); |
107 | MODULE_DESCRIPTION("ALSA SoC Imote 2"); | 102 | MODULE_DESCRIPTION("ALSA SoC Imote 2"); |
108 | MODULE_LICENSE("GPL"); | 103 | MODULE_LICENSE("GPL"); |
104 | MODULE_ALIAS("platform:imote2-audio"); | ||
diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c index e79f516c400e..3f7a8ecb9720 100644 --- a/sound/soc/pxa/magician.c +++ b/sound/soc/pxa/magician.c | |||
@@ -452,6 +452,7 @@ static struct snd_soc_dai_link magician_dai[] = { | |||
452 | /* magician audio machine driver */ | 452 | /* magician audio machine driver */ |
453 | static struct snd_soc_card snd_soc_card_magician = { | 453 | static struct snd_soc_card snd_soc_card_magician = { |
454 | .name = "Magician", | 454 | .name = "Magician", |
455 | .owner = THIS_MODULE, | ||
455 | .dai_link = magician_dai, | 456 | .dai_link = magician_dai, |
456 | .num_links = ARRAY_SIZE(magician_dai), | 457 | .num_links = ARRAY_SIZE(magician_dai), |
457 | 458 | ||
diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c index 0b8d1ee738a4..9c585af59b5f 100644 --- a/sound/soc/pxa/mioa701_wm9713.c +++ b/sound/soc/pxa/mioa701_wm9713.c | |||
@@ -181,6 +181,7 @@ static struct snd_soc_dai_link mioa701_dai[] = { | |||
181 | 181 | ||
182 | static struct snd_soc_card mioa701 = { | 182 | static struct snd_soc_card mioa701 = { |
183 | .name = "MioA701", | 183 | .name = "MioA701", |
184 | .owner = THIS_MODULE, | ||
184 | .dai_link = mioa701_dai, | 185 | .dai_link = mioa701_dai, |
185 | .num_links = ARRAY_SIZE(mioa701_dai), | 186 | .num_links = ARRAY_SIZE(mioa701_dai), |
186 | }; | 187 | }; |
@@ -227,18 +228,7 @@ static struct platform_driver mioa701_wm9713_driver = { | |||
227 | }, | 228 | }, |
228 | }; | 229 | }; |
229 | 230 | ||
230 | static int __init mioa701_asoc_init(void) | 231 | module_platform_driver(mioa701_wm9713_driver); |
231 | { | ||
232 | return platform_driver_register(&mioa701_wm9713_driver); | ||
233 | } | ||
234 | |||
235 | static void __exit mioa701_asoc_exit(void) | ||
236 | { | ||
237 | platform_driver_unregister(&mioa701_wm9713_driver); | ||
238 | } | ||
239 | |||
240 | module_init(mioa701_asoc_init); | ||
241 | module_exit(mioa701_asoc_exit); | ||
242 | 232 | ||
243 | /* Module information */ | 233 | /* Module information */ |
244 | MODULE_AUTHOR("Robert Jarzmik (rjarzmik@free.fr)"); | 234 | MODULE_AUTHOR("Robert Jarzmik (rjarzmik@free.fr)"); |
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c index 7edc1fb71fae..db24bc685bd3 100644 --- a/sound/soc/pxa/palm27x.c +++ b/sound/soc/pxa/palm27x.c | |||
@@ -146,6 +146,7 @@ static struct snd_soc_dai_link palm27x_dai[] = { | |||
146 | 146 | ||
147 | static struct snd_soc_card palm27x_asoc = { | 147 | static struct snd_soc_card palm27x_asoc = { |
148 | .name = "Palm/PXA27x", | 148 | .name = "Palm/PXA27x", |
149 | .owner = THIS_MODULE, | ||
149 | .dai_link = palm27x_dai, | 150 | .dai_link = palm27x_dai, |
150 | .num_links = ARRAY_SIZE(palm27x_dai), | 151 | .num_links = ARRAY_SIZE(palm27x_dai), |
151 | }; | 152 | }; |
@@ -201,18 +202,7 @@ static struct platform_driver palm27x_wm9712_driver = { | |||
201 | }, | 202 | }, |
202 | }; | 203 | }; |
203 | 204 | ||
204 | static int __init palm27x_asoc_init(void) | 205 | module_platform_driver(palm27x_wm9712_driver); |
205 | { | ||
206 | return platform_driver_register(&palm27x_wm9712_driver); | ||
207 | } | ||
208 | |||
209 | static void __exit palm27x_asoc_exit(void) | ||
210 | { | ||
211 | platform_driver_unregister(&palm27x_wm9712_driver); | ||
212 | } | ||
213 | |||
214 | module_init(palm27x_asoc_init); | ||
215 | module_exit(palm27x_asoc_exit); | ||
216 | 206 | ||
217 | /* Module information */ | 207 | /* Module information */ |
218 | MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>"); | 208 | MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>"); |
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c index 4c29bc1f9cfe..fd0ed10c6fe7 100644 --- a/sound/soc/pxa/poodle.c +++ b/sound/soc/pxa/poodle.c | |||
@@ -121,18 +121,6 @@ static int poodle_hw_params(struct snd_pcm_substream *substream, | |||
121 | break; | 121 | break; |
122 | } | 122 | } |
123 | 123 | ||
124 | /* set codec DAI configuration */ | ||
125 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | ||
126 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
127 | if (ret < 0) | ||
128 | return ret; | ||
129 | |||
130 | /* set cpu DAI configuration */ | ||
131 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | ||
132 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
133 | if (ret < 0) | ||
134 | return ret; | ||
135 | |||
136 | /* set the codec system clock for DAC and ADC */ | 124 | /* set the codec system clock for DAC and ADC */ |
137 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL, clk, | 125 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL, clk, |
138 | SND_SOC_CLOCK_IN); | 126 | SND_SOC_CLOCK_IN); |
@@ -214,7 +202,7 @@ SND_SOC_DAPM_SPK("Ext Spk", poodle_amp_event), | |||
214 | }; | 202 | }; |
215 | 203 | ||
216 | /* Corgi machine connections to the codec pins */ | 204 | /* Corgi machine connections to the codec pins */ |
217 | static const struct snd_soc_dapm_route audio_map[] = { | 205 | static const struct snd_soc_dapm_route poodle_audio_map[] = { |
218 | 206 | ||
219 | /* headphone connected to LHPOUT1, RHPOUT1 */ | 207 | /* headphone connected to LHPOUT1, RHPOUT1 */ |
220 | {"Headphone Jack", NULL, "LHPOUT"}, | 208 | {"Headphone Jack", NULL, "LHPOUT"}, |
@@ -246,25 +234,11 @@ static int poodle_wm8731_init(struct snd_soc_pcm_runtime *rtd) | |||
246 | { | 234 | { |
247 | struct snd_soc_codec *codec = rtd->codec; | 235 | struct snd_soc_codec *codec = rtd->codec; |
248 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 236 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
249 | int err; | ||
250 | 237 | ||
251 | snd_soc_dapm_nc_pin(dapm, "LLINEIN"); | 238 | snd_soc_dapm_nc_pin(dapm, "LLINEIN"); |
252 | snd_soc_dapm_nc_pin(dapm, "RLINEIN"); | 239 | snd_soc_dapm_nc_pin(dapm, "RLINEIN"); |
253 | snd_soc_dapm_enable_pin(dapm, "MICIN"); | 240 | snd_soc_dapm_enable_pin(dapm, "MICIN"); |
254 | 241 | ||
255 | /* Add poodle specific controls */ | ||
256 | err = snd_soc_add_controls(codec, wm8731_poodle_controls, | ||
257 | ARRAY_SIZE(wm8731_poodle_controls)); | ||
258 | if (err < 0) | ||
259 | return err; | ||
260 | |||
261 | /* Add poodle specific widgets */ | ||
262 | snd_soc_dapm_new_controls(dapm, wm8731_dapm_widgets, | ||
263 | ARRAY_SIZE(wm8731_dapm_widgets)); | ||
264 | |||
265 | /* Set up poodle specific audio path audio_map */ | ||
266 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
267 | |||
268 | return 0; | 242 | return 0; |
269 | } | 243 | } |
270 | 244 | ||
@@ -277,26 +251,31 @@ static struct snd_soc_dai_link poodle_dai = { | |||
277 | .platform_name = "pxa-pcm-audio", | 251 | .platform_name = "pxa-pcm-audio", |
278 | .codec_name = "wm8731.0-001b", | 252 | .codec_name = "wm8731.0-001b", |
279 | .init = poodle_wm8731_init, | 253 | .init = poodle_wm8731_init, |
254 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
255 | SND_SOC_DAIFMT_CBS_CFS, | ||
280 | .ops = &poodle_ops, | 256 | .ops = &poodle_ops, |
281 | }; | 257 | }; |
282 | 258 | ||
283 | /* poodle audio machine driver */ | 259 | /* poodle audio machine driver */ |
284 | static struct snd_soc_card snd_soc_poodle = { | 260 | static struct snd_soc_card poodle = { |
285 | .name = "Poodle", | 261 | .name = "Poodle", |
286 | .dai_link = &poodle_dai, | 262 | .dai_link = &poodle_dai, |
287 | .num_links = 1, | 263 | .num_links = 1, |
288 | .owner = THIS_MODULE, | 264 | .owner = THIS_MODULE, |
289 | }; | ||
290 | 265 | ||
291 | static struct platform_device *poodle_snd_device; | 266 | .controls = wm8731_poodle_controls, |
267 | .num_controls = ARRAY_SIZE(wm8731_poodle_controls), | ||
268 | .dapm_widgets = wm8731_dapm_widgets, | ||
269 | .num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets), | ||
270 | .dapm_routes = poodle_audio_map, | ||
271 | .num_dapm_routes = ARRAY_SIZE(poodle_audio_map), | ||
272 | }; | ||
292 | 273 | ||
293 | static int __init poodle_init(void) | 274 | static int __devinit poodle_probe(struct platform_device *pdev) |
294 | { | 275 | { |
276 | struct snd_soc_card *card = &poodle; | ||
295 | int ret; | 277 | int ret; |
296 | 278 | ||
297 | if (!machine_is_poodle()) | ||
298 | return -ENODEV; | ||
299 | |||
300 | locomo_gpio_set_dir(&poodle_locomo_device.dev, | 279 | locomo_gpio_set_dir(&poodle_locomo_device.dev, |
301 | POODLE_LOCOMO_GPIO_AMP_ON, 0); | 280 | POODLE_LOCOMO_GPIO_AMP_ON, 0); |
302 | /* should we mute HP at startup - burning power ?*/ | 281 | /* should we mute HP at startup - burning power ?*/ |
@@ -305,28 +284,36 @@ static int __init poodle_init(void) | |||
305 | locomo_gpio_set_dir(&poodle_locomo_device.dev, | 284 | locomo_gpio_set_dir(&poodle_locomo_device.dev, |
306 | POODLE_LOCOMO_GPIO_MUTE_R, 0); | 285 | POODLE_LOCOMO_GPIO_MUTE_R, 0); |
307 | 286 | ||
308 | poodle_snd_device = platform_device_alloc("soc-audio", -1); | 287 | card->dev = &pdev->dev; |
309 | if (!poodle_snd_device) | ||
310 | return -ENOMEM; | ||
311 | |||
312 | platform_set_drvdata(poodle_snd_device, &snd_soc_poodle); | ||
313 | ret = platform_device_add(poodle_snd_device); | ||
314 | 288 | ||
289 | ret = snd_soc_register_card(card); | ||
315 | if (ret) | 290 | if (ret) |
316 | platform_device_put(poodle_snd_device); | 291 | dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", |
317 | 292 | ret); | |
318 | return ret; | 293 | return ret; |
319 | } | 294 | } |
320 | 295 | ||
321 | static void __exit poodle_exit(void) | 296 | static int __devexit poodle_remove(struct platform_device *pdev) |
322 | { | 297 | { |
323 | platform_device_unregister(poodle_snd_device); | 298 | struct snd_soc_card *card = platform_get_drvdata(pdev); |
299 | |||
300 | snd_soc_unregister_card(card); | ||
301 | return 0; | ||
324 | } | 302 | } |
325 | 303 | ||
326 | module_init(poodle_init); | 304 | static struct platform_driver poodle_driver = { |
327 | module_exit(poodle_exit); | 305 | .driver = { |
306 | .name = "poodle-audio", | ||
307 | .owner = THIS_MODULE, | ||
308 | }, | ||
309 | .probe = poodle_probe, | ||
310 | .remove = __devexit_p(poodle_remove), | ||
311 | }; | ||
312 | |||
313 | module_platform_driver(poodle_driver); | ||
328 | 314 | ||
329 | /* Module information */ | 315 | /* Module information */ |
330 | MODULE_AUTHOR("Richard Purdie"); | 316 | MODULE_AUTHOR("Richard Purdie"); |
331 | MODULE_DESCRIPTION("ALSA SoC Poodle"); | 317 | MODULE_DESCRIPTION("ALSA SoC Poodle"); |
332 | MODULE_LICENSE("GPL"); | 318 | MODULE_LICENSE("GPL"); |
319 | MODULE_ALIAS("platform:poodle-audio"); | ||
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index 8ad93ee2e92b..a57cfbc038e3 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c | |||
@@ -771,7 +771,7 @@ static int pxa_ssp_remove(struct snd_soc_dai *dai) | |||
771 | SNDRV_PCM_FMTBIT_S24_LE | \ | 771 | SNDRV_PCM_FMTBIT_S24_LE | \ |
772 | SNDRV_PCM_FMTBIT_S32_LE) | 772 | SNDRV_PCM_FMTBIT_S32_LE) |
773 | 773 | ||
774 | static struct snd_soc_dai_ops pxa_ssp_dai_ops = { | 774 | static const struct snd_soc_dai_ops pxa_ssp_dai_ops = { |
775 | .startup = pxa_ssp_startup, | 775 | .startup = pxa_ssp_startup, |
776 | .shutdown = pxa_ssp_shutdown, | 776 | .shutdown = pxa_ssp_shutdown, |
777 | .trigger = pxa_ssp_trigger, | 777 | .trigger = pxa_ssp_trigger, |
@@ -825,17 +825,7 @@ static struct platform_driver asoc_ssp_driver = { | |||
825 | .remove = __devexit_p(asoc_ssp_remove), | 825 | .remove = __devexit_p(asoc_ssp_remove), |
826 | }; | 826 | }; |
827 | 827 | ||
828 | static int __init pxa_ssp_init(void) | 828 | module_platform_driver(asoc_ssp_driver); |
829 | { | ||
830 | return platform_driver_register(&asoc_ssp_driver); | ||
831 | } | ||
832 | module_init(pxa_ssp_init); | ||
833 | |||
834 | static void __exit pxa_ssp_exit(void) | ||
835 | { | ||
836 | platform_driver_unregister(&asoc_ssp_driver); | ||
837 | } | ||
838 | module_exit(pxa_ssp_exit); | ||
839 | 829 | ||
840 | /* Module information */ | 830 | /* Module information */ |
841 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); | 831 | MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>"); |
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index ac51c6d25c42..837ff341fd6d 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c | |||
@@ -163,15 +163,15 @@ static int pxa2xx_ac97_hw_mic_params(struct snd_pcm_substream *substream, | |||
163 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ | 163 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ |
164 | SNDRV_PCM_RATE_48000) | 164 | SNDRV_PCM_RATE_48000) |
165 | 165 | ||
166 | static struct snd_soc_dai_ops pxa_ac97_hifi_dai_ops = { | 166 | static const struct snd_soc_dai_ops pxa_ac97_hifi_dai_ops = { |
167 | .hw_params = pxa2xx_ac97_hw_params, | 167 | .hw_params = pxa2xx_ac97_hw_params, |
168 | }; | 168 | }; |
169 | 169 | ||
170 | static struct snd_soc_dai_ops pxa_ac97_aux_dai_ops = { | 170 | static const struct snd_soc_dai_ops pxa_ac97_aux_dai_ops = { |
171 | .hw_params = pxa2xx_ac97_hw_aux_params, | 171 | .hw_params = pxa2xx_ac97_hw_aux_params, |
172 | }; | 172 | }; |
173 | 173 | ||
174 | static struct snd_soc_dai_ops pxa_ac97_mic_dai_ops = { | 174 | static const struct snd_soc_dai_ops pxa_ac97_mic_dai_ops = { |
175 | .hw_params = pxa2xx_ac97_hw_mic_params, | 175 | .hw_params = pxa2xx_ac97_hw_mic_params, |
176 | }; | 176 | }; |
177 | 177 | ||
@@ -263,17 +263,7 @@ static struct platform_driver pxa2xx_ac97_driver = { | |||
263 | }, | 263 | }, |
264 | }; | 264 | }; |
265 | 265 | ||
266 | static int __init pxa_ac97_init(void) | 266 | module_platform_driver(pxa2xx_ac97_driver); |
267 | { | ||
268 | return platform_driver_register(&pxa2xx_ac97_driver); | ||
269 | } | ||
270 | module_init(pxa_ac97_init); | ||
271 | |||
272 | static void __exit pxa_ac97_exit(void) | ||
273 | { | ||
274 | platform_driver_unregister(&pxa2xx_ac97_driver); | ||
275 | } | ||
276 | module_exit(pxa_ac97_exit); | ||
277 | 267 | ||
278 | MODULE_AUTHOR("Nicolas Pitre"); | 268 | MODULE_AUTHOR("Nicolas Pitre"); |
279 | MODULE_DESCRIPTION("AC97 driver for the Intel PXA2xx chip"); | 269 | MODULE_DESCRIPTION("AC97 driver for the Intel PXA2xx chip"); |
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index 11be5952a506..609abd51e55f 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c | |||
@@ -331,7 +331,7 @@ static int pxa2xx_i2s_remove(struct snd_soc_dai *dai) | |||
331 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ | 331 | SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 | \ |
332 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000) | 332 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000) |
333 | 333 | ||
334 | static struct snd_soc_dai_ops pxa_i2s_dai_ops = { | 334 | static const struct snd_soc_dai_ops pxa_i2s_dai_ops = { |
335 | .startup = pxa2xx_i2s_startup, | 335 | .startup = pxa2xx_i2s_startup, |
336 | .shutdown = pxa2xx_i2s_shutdown, | 336 | .shutdown = pxa2xx_i2s_shutdown, |
337 | .trigger = pxa2xx_i2s_trigger, | 337 | .trigger = pxa2xx_i2s_trigger, |
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c index 600676f709a9..fdd6bedef9bd 100644 --- a/sound/soc/pxa/pxa2xx-pcm.c +++ b/sound/soc/pxa/pxa2xx-pcm.c | |||
@@ -141,17 +141,7 @@ static struct platform_driver pxa_pcm_driver = { | |||
141 | .remove = __devexit_p(pxa2xx_soc_platform_remove), | 141 | .remove = __devexit_p(pxa2xx_soc_platform_remove), |
142 | }; | 142 | }; |
143 | 143 | ||
144 | static int __init snd_pxa_pcm_init(void) | 144 | module_platform_driver(pxa_pcm_driver); |
145 | { | ||
146 | return platform_driver_register(&pxa_pcm_driver); | ||
147 | } | ||
148 | module_init(snd_pxa_pcm_init); | ||
149 | |||
150 | static void __exit snd_pxa_pcm_exit(void) | ||
151 | { | ||
152 | platform_driver_unregister(&pxa_pcm_driver); | ||
153 | } | ||
154 | module_exit(snd_pxa_pcm_exit); | ||
155 | 145 | ||
156 | MODULE_AUTHOR("Nicolas Pitre"); | 146 | MODULE_AUTHOR("Nicolas Pitre"); |
157 | MODULE_DESCRIPTION("Intel PXA2xx PCM DMA module"); | 147 | MODULE_DESCRIPTION("Intel PXA2xx PCM DMA module"); |
diff --git a/sound/soc/pxa/raumfeld.c b/sound/soc/pxa/raumfeld.c index b899a3bc8f42..ba1545188ec6 100644 --- a/sound/soc/pxa/raumfeld.c +++ b/sound/soc/pxa/raumfeld.c | |||
@@ -260,6 +260,7 @@ static struct snd_soc_dai_link snd_soc_raumfeld_speaker_dai[] = | |||
260 | 260 | ||
261 | static struct snd_soc_card snd_soc_raumfeld_connector = { | 261 | static struct snd_soc_card snd_soc_raumfeld_connector = { |
262 | .name = "Raumfeld Connector", | 262 | .name = "Raumfeld Connector", |
263 | .owner = THIS_MODULE, | ||
263 | .dai_link = snd_soc_raumfeld_connector_dai, | 264 | .dai_link = snd_soc_raumfeld_connector_dai, |
264 | .num_links = ARRAY_SIZE(snd_soc_raumfeld_connector_dai), | 265 | .num_links = ARRAY_SIZE(snd_soc_raumfeld_connector_dai), |
265 | .suspend_post = raumfeld_analog_suspend, | 266 | .suspend_post = raumfeld_analog_suspend, |
@@ -268,6 +269,7 @@ static struct snd_soc_card snd_soc_raumfeld_connector = { | |||
268 | 269 | ||
269 | static struct snd_soc_card snd_soc_raumfeld_speaker = { | 270 | static struct snd_soc_card snd_soc_raumfeld_speaker = { |
270 | .name = "Raumfeld Speaker", | 271 | .name = "Raumfeld Speaker", |
272 | .owner = THIS_MODULE, | ||
271 | .dai_link = snd_soc_raumfeld_speaker_dai, | 273 | .dai_link = snd_soc_raumfeld_speaker_dai, |
272 | .num_links = ARRAY_SIZE(snd_soc_raumfeld_speaker_dai), | 274 | .num_links = ARRAY_SIZE(snd_soc_raumfeld_speaker_dai), |
273 | .suspend_post = raumfeld_analog_suspend, | 275 | .suspend_post = raumfeld_analog_suspend, |
diff --git a/sound/soc/pxa/saarb.c b/sound/soc/pxa/saarb.c index d9467a2c6de0..c34146b776b4 100644 --- a/sound/soc/pxa/saarb.c +++ b/sound/soc/pxa/saarb.c | |||
@@ -51,7 +51,7 @@ static const struct snd_soc_dapm_widget saarb_dapm_widgets[] = { | |||
51 | }; | 51 | }; |
52 | 52 | ||
53 | /* saarb machine audio map */ | 53 | /* saarb machine audio map */ |
54 | static const struct snd_soc_dapm_route audio_map[] = { | 54 | static const struct snd_soc_dapm_route saarb_audio_map[] = { |
55 | {"Headset Stereophone", NULL, "HS1"}, | 55 | {"Headset Stereophone", NULL, "HS1"}, |
56 | {"Headset Stereophone", NULL, "HS2"}, | 56 | {"Headset Stereophone", NULL, "HS2"}, |
57 | 57 | ||
@@ -92,15 +92,6 @@ static int saarb_i2s_hw_params(struct snd_pcm_substream *substream, | |||
92 | if (ret < 0) | 92 | if (ret < 0) |
93 | return ret; | 93 | return ret; |
94 | 94 | ||
95 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | ||
96 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); | ||
97 | if (ret < 0) | ||
98 | return ret; | ||
99 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | ||
100 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); | ||
101 | if (ret < 0) | ||
102 | return ret; | ||
103 | |||
104 | ret = snd_soc_dai_set_tdm_slot(cpu_dai, 3, 3, 2, width); | 95 | ret = snd_soc_dai_set_tdm_slot(cpu_dai, 3, 3, 2, width); |
105 | 96 | ||
106 | return ret; | 97 | return ret; |
@@ -119,25 +110,28 @@ static struct snd_soc_dai_link saarb_dai[] = { | |||
119 | .platform_name = "pxa-pcm-audio", | 110 | .platform_name = "pxa-pcm-audio", |
120 | .codec_name = "88pm860x-codec", | 111 | .codec_name = "88pm860x-codec", |
121 | .init = saarb_pm860x_init, | 112 | .init = saarb_pm860x_init, |
113 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
114 | SND_SOC_DAIFMT_CBM_CFM, | ||
122 | .ops = &saarb_i2s_ops, | 115 | .ops = &saarb_i2s_ops, |
123 | }, | 116 | }, |
124 | }; | 117 | }; |
125 | 118 | ||
126 | static struct snd_soc_card snd_soc_card_saarb = { | 119 | static struct snd_soc_card snd_soc_card_saarb = { |
127 | .name = "Saarb", | 120 | .name = "Saarb", |
121 | .owner = THIS_MODULE, | ||
128 | .dai_link = saarb_dai, | 122 | .dai_link = saarb_dai, |
129 | .num_links = ARRAY_SIZE(saarb_dai), | 123 | .num_links = ARRAY_SIZE(saarb_dai), |
124 | |||
125 | .dapm_widgets = saarb_dapm_widgets, | ||
126 | .num_dapm_widgets = ARRAY_SIZE(saarb_dapm_widgets), | ||
127 | .dapm_routes = saarb_audio_map, | ||
128 | .num_dapm_routes = ARRAY_SIZE(saarb_audio_map), | ||
130 | }; | 129 | }; |
131 | 130 | ||
132 | static int saarb_pm860x_init(struct snd_soc_pcm_runtime *rtd) | 131 | static int saarb_pm860x_init(struct snd_soc_pcm_runtime *rtd) |
133 | { | 132 | { |
134 | struct snd_soc_codec *codec = rtd->codec; | 133 | struct snd_soc_codec *codec = rtd->codec; |
135 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 134 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
136 | int ret; | ||
137 | |||
138 | snd_soc_dapm_new_controls(dapm, saarb_dapm_widgets, | ||
139 | ARRAY_SIZE(saarb_dapm_widgets)); | ||
140 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
141 | 135 | ||
142 | /* connected pins */ | 136 | /* connected pins */ |
143 | snd_soc_dapm_enable_pin(dapm, "Ext Speaker"); | 137 | snd_soc_dapm_enable_pin(dapm, "Ext Speaker"); |
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index c2d6ff9b1588..90c5245c4742 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c | |||
@@ -143,18 +143,6 @@ static int spitz_hw_params(struct snd_pcm_substream *substream, | |||
143 | break; | 143 | break; |
144 | } | 144 | } |
145 | 145 | ||
146 | /* set codec DAI configuration */ | ||
147 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | ||
148 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
149 | if (ret < 0) | ||
150 | return ret; | ||
151 | |||
152 | /* set cpu DAI configuration */ | ||
153 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | ||
154 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
155 | if (ret < 0) | ||
156 | return ret; | ||
157 | |||
158 | /* set the codec system clock for DAC and ADC */ | 146 | /* set the codec system clock for DAC and ADC */ |
159 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, | 147 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, |
160 | SND_SOC_CLOCK_IN); | 148 | SND_SOC_CLOCK_IN); |
@@ -234,7 +222,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = { | |||
234 | }; | 222 | }; |
235 | 223 | ||
236 | /* Spitz machine audio_map */ | 224 | /* Spitz machine audio_map */ |
237 | static const struct snd_soc_dapm_route audio_map[] = { | 225 | static const struct snd_soc_dapm_route spitz_audio_map[] = { |
238 | 226 | ||
239 | /* headphone connected to LOUT1, ROUT1 */ | 227 | /* headphone connected to LOUT1, ROUT1 */ |
240 | {"Headphone Jack", NULL, "LOUT1"}, | 228 | {"Headphone Jack", NULL, "LOUT1"}, |
@@ -277,7 +265,6 @@ static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd) | |||
277 | { | 265 | { |
278 | struct snd_soc_codec *codec = rtd->codec; | 266 | struct snd_soc_codec *codec = rtd->codec; |
279 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 267 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
280 | int err; | ||
281 | 268 | ||
282 | /* NC codec pins */ | 269 | /* NC codec pins */ |
283 | snd_soc_dapm_nc_pin(dapm, "RINPUT1"); | 270 | snd_soc_dapm_nc_pin(dapm, "RINPUT1"); |
@@ -288,19 +275,6 @@ static int spitz_wm8750_init(struct snd_soc_pcm_runtime *rtd) | |||
288 | snd_soc_dapm_nc_pin(dapm, "OUT3"); | 275 | snd_soc_dapm_nc_pin(dapm, "OUT3"); |
289 | snd_soc_dapm_nc_pin(dapm, "MONO1"); | 276 | snd_soc_dapm_nc_pin(dapm, "MONO1"); |
290 | 277 | ||
291 | /* Add spitz specific controls */ | ||
292 | err = snd_soc_add_controls(codec, wm8750_spitz_controls, | ||
293 | ARRAY_SIZE(wm8750_spitz_controls)); | ||
294 | if (err < 0) | ||
295 | return err; | ||
296 | |||
297 | /* Add spitz specific widgets */ | ||
298 | snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets, | ||
299 | ARRAY_SIZE(wm8750_dapm_widgets)); | ||
300 | |||
301 | /* Set up spitz specific audio paths */ | ||
302 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
303 | |||
304 | return 0; | 278 | return 0; |
305 | } | 279 | } |
306 | 280 | ||
@@ -313,14 +287,24 @@ static struct snd_soc_dai_link spitz_dai = { | |||
313 | .platform_name = "pxa-pcm-audio", | 287 | .platform_name = "pxa-pcm-audio", |
314 | .codec_name = "wm8750.0-001b", | 288 | .codec_name = "wm8750.0-001b", |
315 | .init = spitz_wm8750_init, | 289 | .init = spitz_wm8750_init, |
290 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
291 | SND_SOC_DAIFMT_CBS_CFS, | ||
316 | .ops = &spitz_ops, | 292 | .ops = &spitz_ops, |
317 | }; | 293 | }; |
318 | 294 | ||
319 | /* spitz audio machine driver */ | 295 | /* spitz audio machine driver */ |
320 | static struct snd_soc_card snd_soc_spitz = { | 296 | static struct snd_soc_card snd_soc_spitz = { |
321 | .name = "Spitz", | 297 | .name = "Spitz", |
298 | .owner = THIS_MODULE, | ||
322 | .dai_link = &spitz_dai, | 299 | .dai_link = &spitz_dai, |
323 | .num_links = 1, | 300 | .num_links = 1, |
301 | |||
302 | .controls = wm8750_spitz_controls, | ||
303 | .num_controls = ARRAY_SIZE(wm8750_spitz_controls), | ||
304 | .dapm_widgets = wm8750_dapm_widgets, | ||
305 | .num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets), | ||
306 | .dapm_routes = spitz_audio_map, | ||
307 | .num_dapm_routes = ARRAY_SIZE(spitz_audio_map), | ||
324 | }; | 308 | }; |
325 | 309 | ||
326 | static struct platform_device *spitz_snd_device; | 310 | static struct platform_device *spitz_snd_device; |
diff --git a/sound/soc/pxa/tavorevb3.c b/sound/soc/pxa/tavorevb3.c index eeec892e0e04..8b5ab8f72726 100644 --- a/sound/soc/pxa/tavorevb3.c +++ b/sound/soc/pxa/tavorevb3.c | |||
@@ -51,7 +51,7 @@ static const struct snd_soc_dapm_widget evb3_dapm_widgets[] = { | |||
51 | }; | 51 | }; |
52 | 52 | ||
53 | /* tavorevb3 machine audio map */ | 53 | /* tavorevb3 machine audio map */ |
54 | static const struct snd_soc_dapm_route audio_map[] = { | 54 | static const struct snd_soc_dapm_route evb3_audio_map[] = { |
55 | {"Headset Stereophone", NULL, "HS1"}, | 55 | {"Headset Stereophone", NULL, "HS1"}, |
56 | {"Headset Stereophone", NULL, "HS2"}, | 56 | {"Headset Stereophone", NULL, "HS2"}, |
57 | 57 | ||
@@ -92,16 +92,6 @@ static int evb3_i2s_hw_params(struct snd_pcm_substream *substream, | |||
92 | if (ret < 0) | 92 | if (ret < 0) |
93 | return ret; | 93 | return ret; |
94 | 94 | ||
95 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | ||
96 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); | ||
97 | if (ret < 0) | ||
98 | return ret; | ||
99 | |||
100 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | ||
101 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM); | ||
102 | if (ret < 0) | ||
103 | return ret; | ||
104 | |||
105 | ret = snd_soc_dai_set_tdm_slot(cpu_dai, 3, 3, 2, width); | 95 | ret = snd_soc_dai_set_tdm_slot(cpu_dai, 3, 3, 2, width); |
106 | return ret; | 96 | return ret; |
107 | } | 97 | } |
@@ -119,25 +109,28 @@ static struct snd_soc_dai_link evb3_dai[] = { | |||
119 | .platform_name = "pxa-pcm-audio", | 109 | .platform_name = "pxa-pcm-audio", |
120 | .codec_name = "88pm860x-codec", | 110 | .codec_name = "88pm860x-codec", |
121 | .init = evb3_pm860x_init, | 111 | .init = evb3_pm860x_init, |
112 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
113 | SND_SOC_DAIFMT_CBM_CFM, | ||
122 | .ops = &evb3_i2s_ops, | 114 | .ops = &evb3_i2s_ops, |
123 | }, | 115 | }, |
124 | }; | 116 | }; |
125 | 117 | ||
126 | static struct snd_soc_card snd_soc_card_evb3 = { | 118 | static struct snd_soc_card snd_soc_card_evb3 = { |
127 | .name = "Tavor EVB3", | 119 | .name = "Tavor EVB3", |
120 | .owner = THIS_MODULE, | ||
128 | .dai_link = evb3_dai, | 121 | .dai_link = evb3_dai, |
129 | .num_links = ARRAY_SIZE(evb3_dai), | 122 | .num_links = ARRAY_SIZE(evb3_dai), |
123 | |||
124 | .dapm_widgets = evb3_dapm_widgets, | ||
125 | .num_dapm_widgets = ARRAY_SIZE(evb3_dapm_widgets), | ||
126 | .dapm_routes = evb3_audio_map, | ||
127 | .num_dapm_routes = ARRAY_SIZE(evb3_audio_map), | ||
130 | }; | 128 | }; |
131 | 129 | ||
132 | static int evb3_pm860x_init(struct snd_soc_pcm_runtime *rtd) | 130 | static int evb3_pm860x_init(struct snd_soc_pcm_runtime *rtd) |
133 | { | 131 | { |
134 | struct snd_soc_codec *codec = rtd->codec; | 132 | struct snd_soc_codec *codec = rtd->codec; |
135 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 133 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
136 | int ret; | ||
137 | |||
138 | snd_soc_dapm_new_controls(dapm, evb3_dapm_widgets, | ||
139 | ARRAY_SIZE(evb3_dapm_widgets)); | ||
140 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
141 | 134 | ||
142 | /* connected pins */ | 135 | /* connected pins */ |
143 | snd_soc_dapm_enable_pin(dapm, "Ext Speaker"); | 136 | snd_soc_dapm_enable_pin(dapm, "Ext Speaker"); |
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c index 620fc69ae632..564ef08a89f2 100644 --- a/sound/soc/pxa/tosa.c +++ b/sound/soc/pxa/tosa.c | |||
@@ -34,8 +34,6 @@ | |||
34 | #include "../codecs/wm9712.h" | 34 | #include "../codecs/wm9712.h" |
35 | #include "pxa2xx-ac97.h" | 35 | #include "pxa2xx-ac97.h" |
36 | 36 | ||
37 | static struct snd_soc_card tosa; | ||
38 | |||
39 | #define TOSA_HP 0 | 37 | #define TOSA_HP 0 |
40 | #define TOSA_MIC_INT 1 | 38 | #define TOSA_MIC_INT 1 |
41 | #define TOSA_HEADSET 2 | 39 | #define TOSA_HEADSET 2 |
@@ -236,70 +234,56 @@ static struct snd_soc_dai_link tosa_dai[] = { | |||
236 | }, | 234 | }, |
237 | }; | 235 | }; |
238 | 236 | ||
239 | static int tosa_probe(struct snd_soc_card *card) | ||
240 | { | ||
241 | int ret; | ||
242 | |||
243 | ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack"); | ||
244 | if (ret) | ||
245 | return ret; | ||
246 | ret = gpio_direction_output(TOSA_GPIO_L_MUTE, 0); | ||
247 | if (ret) | ||
248 | gpio_free(TOSA_GPIO_L_MUTE); | ||
249 | |||
250 | return ret; | ||
251 | } | ||
252 | |||
253 | static int tosa_remove(struct snd_soc_card *card) | ||
254 | { | ||
255 | gpio_free(TOSA_GPIO_L_MUTE); | ||
256 | return 0; | ||
257 | } | ||
258 | |||
259 | static struct snd_soc_card tosa = { | 237 | static struct snd_soc_card tosa = { |
260 | .name = "Tosa", | 238 | .name = "Tosa", |
239 | .owner = THIS_MODULE, | ||
261 | .dai_link = tosa_dai, | 240 | .dai_link = tosa_dai, |
262 | .num_links = ARRAY_SIZE(tosa_dai), | 241 | .num_links = ARRAY_SIZE(tosa_dai), |
263 | .probe = tosa_probe, | ||
264 | .remove = tosa_remove, | ||
265 | }; | 242 | }; |
266 | 243 | ||
267 | static struct platform_device *tosa_snd_device; | 244 | static int __devinit tosa_probe(struct platform_device *pdev) |
268 | |||
269 | static int __init tosa_init(void) | ||
270 | { | 245 | { |
246 | struct snd_soc_card *card = ⤩ | ||
271 | int ret; | 247 | int ret; |
272 | 248 | ||
273 | if (!machine_is_tosa()) | 249 | ret = gpio_request_one(TOSA_GPIO_L_MUTE, GPIOF_OUT_INIT_LOW, |
274 | return -ENODEV; | 250 | "Headphone Jack"); |
275 | 251 | if (ret) | |
276 | tosa_snd_device = platform_device_alloc("soc-audio", -1); | 252 | return ret; |
277 | if (!tosa_snd_device) { | ||
278 | ret = -ENOMEM; | ||
279 | goto err_alloc; | ||
280 | } | ||
281 | |||
282 | platform_set_drvdata(tosa_snd_device, &tosa); | ||
283 | ret = platform_device_add(tosa_snd_device); | ||
284 | |||
285 | if (!ret) | ||
286 | return 0; | ||
287 | 253 | ||
288 | platform_device_put(tosa_snd_device); | 254 | card->dev = &pdev->dev; |
289 | 255 | ||
290 | err_alloc: | 256 | ret = snd_soc_register_card(card); |
257 | if (ret) { | ||
258 | dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", | ||
259 | ret); | ||
260 | gpio_free(TOSA_GPIO_L_MUTE); | ||
261 | } | ||
291 | return ret; | 262 | return ret; |
292 | } | 263 | } |
293 | 264 | ||
294 | static void __exit tosa_exit(void) | 265 | static int __devexit tosa_remove(struct platform_device *pdev) |
295 | { | 266 | { |
296 | platform_device_unregister(tosa_snd_device); | 267 | struct snd_soc_card *card = platform_get_drvdata(pdev); |
268 | |||
269 | gpio_free(TOSA_GPIO_L_MUTE); | ||
270 | snd_soc_unregister_card(card); | ||
271 | return 0; | ||
297 | } | 272 | } |
298 | 273 | ||
299 | module_init(tosa_init); | 274 | static struct platform_driver tosa_driver = { |
300 | module_exit(tosa_exit); | 275 | .driver = { |
276 | .name = "tosa-audio", | ||
277 | .owner = THIS_MODULE, | ||
278 | }, | ||
279 | .probe = tosa_probe, | ||
280 | .remove = __devexit_p(tosa_remove), | ||
281 | }; | ||
282 | |||
283 | module_platform_driver(tosa_driver); | ||
301 | 284 | ||
302 | /* Module information */ | 285 | /* Module information */ |
303 | MODULE_AUTHOR("Richard Purdie"); | 286 | MODULE_AUTHOR("Richard Purdie"); |
304 | MODULE_DESCRIPTION("ALSA SoC Tosa"); | 287 | MODULE_DESCRIPTION("ALSA SoC Tosa"); |
305 | MODULE_LICENSE("GPL"); | 288 | MODULE_LICENSE("GPL"); |
289 | MODULE_ALIAS("platform:tosa-audio"); | ||
diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index b311ffe04b71..76ccb172d0a7 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c | |||
@@ -56,18 +56,6 @@ static int z2_hw_params(struct snd_pcm_substream *substream, | |||
56 | break; | 56 | break; |
57 | } | 57 | } |
58 | 58 | ||
59 | /* set codec DAI configuration */ | ||
60 | ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | | ||
61 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
62 | if (ret < 0) | ||
63 | return ret; | ||
64 | |||
65 | /* set cpu DAI configuration */ | ||
66 | ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | | ||
67 | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS); | ||
68 | if (ret < 0) | ||
69 | return ret; | ||
70 | |||
71 | /* set the codec system clock for DAC and ADC */ | 59 | /* set the codec system clock for DAC and ADC */ |
72 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, | 60 | ret = snd_soc_dai_set_sysclk(codec_dai, WM8750_SYSCLK, clk, |
73 | SND_SOC_CLOCK_IN); | 61 | SND_SOC_CLOCK_IN); |
@@ -124,7 +112,7 @@ static const struct snd_soc_dapm_widget wm8750_dapm_widgets[] = { | |||
124 | }; | 112 | }; |
125 | 113 | ||
126 | /* Z2 machine audio_map */ | 114 | /* Z2 machine audio_map */ |
127 | static const struct snd_soc_dapm_route audio_map[] = { | 115 | static const struct snd_soc_dapm_route z2_audio_map[] = { |
128 | 116 | ||
129 | /* headphone connected to LOUT1, ROUT1 */ | 117 | /* headphone connected to LOUT1, ROUT1 */ |
130 | {"Headphone Jack", NULL, "LOUT1"}, | 118 | {"Headphone Jack", NULL, "LOUT1"}, |
@@ -154,13 +142,6 @@ static int z2_wm8750_init(struct snd_soc_pcm_runtime *rtd) | |||
154 | snd_soc_dapm_disable_pin(dapm, "OUT3"); | 142 | snd_soc_dapm_disable_pin(dapm, "OUT3"); |
155 | snd_soc_dapm_disable_pin(dapm, "MONO1"); | 143 | snd_soc_dapm_disable_pin(dapm, "MONO1"); |
156 | 144 | ||
157 | /* Add z2 specific widgets */ | ||
158 | snd_soc_dapm_new_controls(dapm, wm8750_dapm_widgets, | ||
159 | ARRAY_SIZE(wm8750_dapm_widgets)); | ||
160 | |||
161 | /* Set up z2 specific audio paths */ | ||
162 | snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); | ||
163 | |||
164 | /* Jack detection API stuff */ | 145 | /* Jack detection API stuff */ |
165 | ret = snd_soc_jack_new(codec, "Headset Jack", SND_JACK_HEADSET, | 146 | ret = snd_soc_jack_new(codec, "Headset Jack", SND_JACK_HEADSET, |
166 | &hs_jack); | 147 | &hs_jack); |
@@ -196,14 +177,22 @@ static struct snd_soc_dai_link z2_dai = { | |||
196 | .platform_name = "pxa-pcm-audio", | 177 | .platform_name = "pxa-pcm-audio", |
197 | .codec_name = "wm8750.0-001b", | 178 | .codec_name = "wm8750.0-001b", |
198 | .init = z2_wm8750_init, | 179 | .init = z2_wm8750_init, |
180 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | | ||
181 | SND_SOC_DAIFMT_CBS_CFS, | ||
199 | .ops = &z2_ops, | 182 | .ops = &z2_ops, |
200 | }; | 183 | }; |
201 | 184 | ||
202 | /* z2 audio machine driver */ | 185 | /* z2 audio machine driver */ |
203 | static struct snd_soc_card snd_soc_z2 = { | 186 | static struct snd_soc_card snd_soc_z2 = { |
204 | .name = "Z2", | 187 | .name = "Z2", |
188 | .owner = THIS_MODULE, | ||
205 | .dai_link = &z2_dai, | 189 | .dai_link = &z2_dai, |
206 | .num_links = 1, | 190 | .num_links = 1, |
191 | |||
192 | .dapm_widgets = wm8750_dapm_widgets, | ||
193 | .num_dapm_widgets = ARRAY_SIZE(wm8750_dapm_widgets), | ||
194 | .dapm_routes = z2_audio_map, | ||
195 | .num_dapm_routes = ARRAY_SIZE(z2_audio_map), | ||
207 | }; | 196 | }; |
208 | 197 | ||
209 | static struct platform_device *z2_snd_device; | 198 | static struct platform_device *z2_snd_device; |
diff --git a/sound/soc/pxa/zylonite.c b/sound/soc/pxa/zylonite.c index 580aae38e502..ceb656695b0f 100644 --- a/sound/soc/pxa/zylonite.c +++ b/sound/soc/pxa/zylonite.c | |||
@@ -249,6 +249,7 @@ static int zylonite_resume_pre(struct snd_soc_card *card) | |||
249 | 249 | ||
250 | static struct snd_soc_card zylonite = { | 250 | static struct snd_soc_card zylonite = { |
251 | .name = "Zylonite", | 251 | .name = "Zylonite", |
252 | .owner = THIS_MODULE, | ||
252 | .probe = &zylonite_probe, | 253 | .probe = &zylonite_probe, |
253 | .remove = &zylonite_remove, | 254 | .remove = &zylonite_remove, |
254 | .suspend_post = &zylonite_suspend_post, | 255 | .suspend_post = &zylonite_suspend_post, |