diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-08-12 14:40:28 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-08-12 14:40:28 +0100 |
commit | cf7af01aa77ec1b17687f5328ce0a598709efd59 (patch) | |
tree | 4cc46339721366c7498dacf5ebac01906be273e7 /sound/soc/sh/migor.c | |
parent | 6f341d14811550d863ba804ce6ec7757a7145081 (diff) | |
parent | 5dcba5d6741d4533e0ef696507f93f2a4c738efb (diff) | |
download | op-kernel-dev-cf7af01aa77ec1b17687f5328ce0a598709efd59.zip op-kernel-dev-cf7af01aa77ec1b17687f5328ce0a598709efd59.tar.gz |
Merge branch 'topic/multi-component' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into for-2.6.37
Diffstat (limited to 'sound/soc/sh/migor.c')
-rw-r--r-- | sound/soc/sh/migor.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/sound/soc/sh/migor.c b/sound/soc/sh/migor.c index b823a5c..866d78f 100644 --- a/sound/soc/sh/migor.c +++ b/sound/soc/sh/migor.c @@ -50,7 +50,7 @@ static int migor_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; + struct snd_soc_dai *codec_dai = rtd->codec_dai; int ret; unsigned int rate = params_rate(params); @@ -68,7 +68,7 @@ static int migor_hw_params(struct snd_pcm_substream *substream, if (ret < 0) return ret; - ret = snd_soc_dai_set_fmt(rtd->dai->cpu_dai, SND_SOC_DAIFMT_NB_IF | + ret = snd_soc_dai_set_fmt(rtd->cpu_dai, SND_SOC_DAIFMT_NB_IF | SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS); if (ret < 0) return ret; @@ -81,7 +81,7 @@ static int migor_hw_params(struct snd_pcm_substream *substream, clk_set_rate(&siumckb_clk, codec_freq); dev_dbg(codec_dai->dev, "%s: configure %luHz\n", __func__, codec_freq); - ret = snd_soc_dai_set_sysclk(rtd->dai->cpu_dai, SIU_CLKB_EXT, + ret = snd_soc_dai_set_sysclk(rtd->cpu_dai, SIU_CLKB_EXT, codec_freq / 2, SND_SOC_CLOCK_IN); if (!ret) @@ -93,7 +93,7 @@ static int migor_hw_params(struct snd_pcm_substream *substream, static int migor_hw_free(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_dai *codec_dai = rtd->dai->codec_dai; + struct snd_soc_dai *codec_dai = rtd->codec_dai; if (use_count) { use_count--; @@ -136,8 +136,10 @@ static const struct snd_soc_dapm_route audio_map[] = { { "Mic Bias", NULL, "External Microphone" }, }; -static int migor_dai_init(struct snd_soc_codec *codec) +static int migor_dai_init(struct snd_soc_pcm_runtime *rtd) { + struct snd_soc_codec *codec = rtd->codec; + snd_soc_dapm_new_controls(codec, migor_dapm_widgets, ARRAY_SIZE(migor_dapm_widgets)); @@ -150,8 +152,10 @@ static int migor_dai_init(struct snd_soc_codec *codec) static struct snd_soc_dai_link migor_dai = { .name = "wm8978", .stream_name = "WM8978", - .cpu_dai = &siu_i2s_dai, - .codec_dai = &wm8978_dai, + .cpu_dai_name = "siu-i2s-dai", + .codec_dai_name = "wm8978-hifi", + .platform_name = "siu-pcm-audio", + .codec_name = "wm8978-codec.0-001a", .ops = &migor_dai_ops, .init = migor_dai_init, }; @@ -159,17 +163,10 @@ static struct snd_soc_dai_link migor_dai = { /* migor audio machine driver */ static struct snd_soc_card snd_soc_migor = { .name = "Migo-R", - .platform = &siu_platform, .dai_link = &migor_dai, .num_links = 1, }; -/* migor audio subsystem */ -static struct snd_soc_device migor_snd_devdata = { - .card = &snd_soc_migor, - .codec_dev = &soc_codec_dev_wm8978, -}; - static struct platform_device *migor_snd_device; static int __init migor_init(void) @@ -187,9 +184,7 @@ static int __init migor_init(void) goto epdevalloc; } - platform_set_drvdata(migor_snd_device, &migor_snd_devdata); - - migor_snd_devdata.dev = &migor_snd_device->dev; + platform_set_drvdata(migor_snd_device, &snd_soc_migor); ret = platform_device_add(migor_snd_device); if (ret) |