aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/magician.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/pxa/magician.c')
-rw-r--r--sound/soc/pxa/magician.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/sound/soc/pxa/magician.c b/sound/soc/pxa/magician.c
index 4c8d99a8d386..608bc3dd835f 100644
--- a/sound/soc/pxa/magician.c
+++ b/sound/soc/pxa/magician.c
@@ -32,7 +32,6 @@
32#include <mach/magician.h> 32#include <mach/magician.h>
33#include <asm/mach-types.h> 33#include <asm/mach-types.h>
34#include "../codecs/uda1380.h" 34#include "../codecs/uda1380.h"
35#include "pxa2xx-pcm.h"
36#include "pxa2xx-i2s.h" 35#include "pxa2xx-i2s.h"
37#include "pxa-ssp.h" 36#include "pxa-ssp.h"
38 37
@@ -71,7 +70,7 @@ static void magician_ext_control(struct snd_soc_codec *codec)
71static int magician_startup(struct snd_pcm_substream *substream) 70static int magician_startup(struct snd_pcm_substream *substream)
72{ 71{
73 struct snd_soc_pcm_runtime *rtd = substream->private_data; 72 struct snd_soc_pcm_runtime *rtd = substream->private_data;
74 struct snd_soc_codec *codec = rtd->socdev->card->codec; 73 struct snd_soc_codec *codec = rtd->codec;
75 74
76 /* check the jack status at stream startup */ 75 /* check the jack status at stream startup */
77 magician_ext_control(codec); 76 magician_ext_control(codec);
@@ -86,8 +85,8 @@ static int magician_playback_hw_params(struct snd_pcm_substream *substream,
86 struct snd_pcm_hw_params *params) 85 struct snd_pcm_hw_params *params)
87{ 86{
88 struct snd_soc_pcm_runtime *rtd = substream->private_data; 87 struct snd_soc_pcm_runtime *rtd = substream->private_data;
89 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 88 struct snd_soc_dai *codec_dai = rtd->codec_dai;
90 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 89 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
91 unsigned int acps, acds, width, rate; 90 unsigned int acps, acds, width, rate;
92 unsigned int div4 = PXA_SSP_CLK_SCDB_4; 91 unsigned int div4 = PXA_SSP_CLK_SCDB_4;
93 int ret = 0; 92 int ret = 0;
@@ -227,8 +226,8 @@ static int magician_capture_hw_params(struct snd_pcm_substream *substream,
227 struct snd_pcm_hw_params *params) 226 struct snd_pcm_hw_params *params)
228{ 227{
229 struct snd_soc_pcm_runtime *rtd = substream->private_data; 228 struct snd_soc_pcm_runtime *rtd = substream->private_data;
230 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; 229 struct snd_soc_dai *codec_dai = rtd->codec_dai;
231 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 230 struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
232 int ret = 0; 231 int ret = 0;
233 232
234 /* set codec DAI configuration */ 233 /* set codec DAI configuration */
@@ -393,8 +392,9 @@ static const struct snd_kcontrol_new uda1380_magician_controls[] = {
393/* 392/*
394 * Logic for a uda1380 as connected on a HTC Magician 393 * Logic for a uda1380 as connected on a HTC Magician
395 */ 394 */
396static int magician_uda1380_init(struct snd_soc_codec *codec) 395static int magician_uda1380_init(struct snd_soc_pcm_runtime *rtd)
397{ 396{
397 struct snd_soc_codec *codec = rtd->codec;
398 int err; 398 int err;
399 399
400 /* NC codec pins */ 400 /* NC codec pins */
@@ -427,16 +427,20 @@ static struct snd_soc_dai_link magician_dai[] = {
427{ 427{
428 .name = "uda1380", 428 .name = "uda1380",
429 .stream_name = "UDA1380 Playback", 429 .stream_name = "UDA1380 Playback",
430 .cpu_dai = &pxa_ssp_dai[PXA_DAI_SSP1], 430 .cpu_dai_name = "pxa-ssp-dai.0",
431 .codec_dai = &uda1380_dai[UDA1380_DAI_PLAYBACK], 431 .codec_dai_name = "uda1380-hifi-playback",
432 .platform_name = "pxa-pcm-audio",
433 .codec_name = "uda1380-codec.0-0018",
432 .init = magician_uda1380_init, 434 .init = magician_uda1380_init,
433 .ops = &magician_playback_ops, 435 .ops = &magician_playback_ops,
434}, 436},
435{ 437{
436 .name = "uda1380", 438 .name = "uda1380",
437 .stream_name = "UDA1380 Capture", 439 .stream_name = "UDA1380 Capture",
438 .cpu_dai = &pxa_i2s_dai, 440 .cpu_dai_name = "pxa-i2s",
439 .codec_dai = &uda1380_dai[UDA1380_DAI_CAPTURE], 441 .codec_dai_name = "uda1380-hifi-capture",
442 .platform_name = "pxa-pcm-audio",
443 .codec_name = "uda1380-codec.0-0018",
440 .ops = &magician_capture_ops, 444 .ops = &magician_capture_ops,
441} 445}
442}; 446};
@@ -446,13 +450,7 @@ static struct snd_soc_card snd_soc_card_magician = {
446 .name = "Magician", 450 .name = "Magician",
447 .dai_link = magician_dai, 451 .dai_link = magician_dai,
448 .num_links = ARRAY_SIZE(magician_dai), 452 .num_links = ARRAY_SIZE(magician_dai),
449 .platform = &pxa2xx_soc_platform,
450};
451 453
452/* magician audio subsystem */
453static struct snd_soc_device magician_snd_devdata = {
454 .card = &snd_soc_card_magician,
455 .codec_dev = &soc_codec_dev_uda1380,
456}; 454};
457 455
458static struct platform_device *magician_snd_device; 456static struct platform_device *magician_snd_device;
@@ -514,8 +512,7 @@ static int __init magician_init(void)
514 goto err_pdev; 512 goto err_pdev;
515 } 513 }
516 514
517 platform_set_drvdata(magician_snd_device, &magician_snd_devdata); 515 platform_set_drvdata(magician_snd_device, &snd_soc_card_magician);
518 magician_snd_devdata.dev = &magician_snd_device->dev;
519 ret = platform_device_add(magician_snd_device); 516 ret = platform_device_add(magician_snd_device);
520 if (ret) { 517 if (ret) {
521 platform_device_put(magician_snd_device); 518 platform_device_put(magician_snd_device);