Commit 32696af1 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

ASoC: Convert corgi to table based DAPM and control init

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 74f4dd56
...@@ -227,7 +227,7 @@ SND_SOC_DAPM_HP("Headset Jack", NULL), ...@@ -227,7 +227,7 @@ SND_SOC_DAPM_HP("Headset Jack", NULL),
}; };
/* Corgi machine audio map (connections to the codec pins) */ /* Corgi machine audio map (connections to the codec pins) */
static const struct snd_soc_dapm_route audio_map[] = { static const struct snd_soc_dapm_route corgi_audio_map[] = {
/* headset Jack - in = micin, out = LHPOUT*/ /* headset Jack - in = micin, out = LHPOUT*/
{"Headset Jack", NULL, "LHPOUT"}, {"Headset Jack", NULL, "LHPOUT"},
...@@ -269,24 +269,10 @@ static int corgi_wm8731_init(struct snd_soc_pcm_runtime *rtd) ...@@ -269,24 +269,10 @@ static int corgi_wm8731_init(struct snd_soc_pcm_runtime *rtd)
{ {
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_dapm_context *dapm = &codec->dapm; struct snd_soc_dapm_context *dapm = &codec->dapm;
int err;
snd_soc_dapm_nc_pin(dapm, "LLINEIN"); snd_soc_dapm_nc_pin(dapm, "LLINEIN");
snd_soc_dapm_nc_pin(dapm, "RLINEIN"); snd_soc_dapm_nc_pin(dapm, "RLINEIN");
/* Add corgi specific controls */
err = snd_soc_add_controls(codec, wm8731_corgi_controls,
ARRAY_SIZE(wm8731_corgi_controls));
if (err < 0)
return err;
/* Add corgi specific widgets */
snd_soc_dapm_new_controls(dapm, wm8731_dapm_widgets,
ARRAY_SIZE(wm8731_dapm_widgets));
/* Set up corgi specific audio path audio_map */
snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
return 0; return 0;
} }
...@@ -310,6 +296,13 @@ static struct snd_soc_card snd_soc_corgi = { ...@@ -310,6 +296,13 @@ static struct snd_soc_card snd_soc_corgi = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.dai_link = &corgi_dai, .dai_link = &corgi_dai,
.num_links = 1, .num_links = 1,
.controls = wm8731_corgi_controls,
.num_controls = ARRAY_SIZE(wm8731_corgi_controls),
.dapm_widgets = wm8731_dapm_widgets,
.num_dapm_widgets = ARRAY_SIZE(wm8731_dapm_widgets),
.dapm_routes = corgi_audio_map,
.num_dapm_routes = ARRAY_SIZE(corgi_audio_map),
}; };
static struct platform_device *corgi_snd_device; static struct platform_device *corgi_snd_device;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment