aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci/davinci-evm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/davinci/davinci-evm.c')
-rw-r--r--sound/soc/davinci/davinci-evm.c40
1 files changed, 17 insertions, 23 deletions
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index fcd165240333..5e2c306399ed 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -33,24 +33,24 @@ static int evm_hw_params(struct snd_pcm_substream *substream,
33 struct snd_pcm_hw_params *params) 33 struct snd_pcm_hw_params *params)
34{ 34{
35 struct snd_soc_pcm_runtime *rtd = substream->private_data; 35 struct snd_soc_pcm_runtime *rtd = substream->private_data;
36 struct snd_soc_codec_dai *codec_dai = rtd->dai->codec_dai; 36 struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
37 struct snd_soc_cpu_dai *cpu_dai = rtd->dai->cpu_dai; 37 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
38 int ret = 0; 38 int ret = 0;
39 39
40 /* set codec DAI configuration */ 40 /* set codec DAI configuration */
41 ret = codec_dai->dai_ops.set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | 41 ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S |
42 SND_SOC_DAIFMT_CBM_CFM); 42 SND_SOC_DAIFMT_CBM_CFM);
43 if (ret < 0) 43 if (ret < 0)
44 return ret; 44 return ret;
45 45
46 /* set cpu DAI configuration */ 46 /* set cpu DAI configuration */
47 ret = cpu_dai->dai_ops.set_fmt(cpu_dai, SND_SOC_DAIFMT_CBM_CFM | 47 ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_CBM_CFM |
48 SND_SOC_DAIFMT_IB_NF); 48 SND_SOC_DAIFMT_IB_NF);
49 if (ret < 0) 49 if (ret < 0)
50 return ret; 50 return ret;
51 51
52 /* set the codec system clock */ 52 /* set the codec system clock */
53 ret = codec_dai->dai_ops.set_sysclk(codec_dai, 0, EVM_CODEC_CLOCK, 53 ret = snd_soc_dai_set_sysclk(codec_dai, 0, EVM_CODEC_CLOCK,
54 SND_SOC_CLOCK_OUT); 54 SND_SOC_CLOCK_OUT);
55 if (ret < 0) 55 if (ret < 0)
56 return ret; 56 return ret;
@@ -71,7 +71,7 @@ static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = {
71}; 71};
72 72
73/* davinci-evm machine audio_mapnections to the codec pins */ 73/* davinci-evm machine audio_mapnections to the codec pins */
74static const char *audio_map[][3] = { 74static const struct snd_soc_dapm_route audio_map[] = {
75 /* Headphone connected to HPLOUT, HPROUT */ 75 /* Headphone connected to HPLOUT, HPROUT */
76 {"Headphone Jack", NULL, "HPLOUT"}, 76 {"Headphone Jack", NULL, "HPLOUT"},
77 {"Headphone Jack", NULL, "HPROUT"}, 77 {"Headphone Jack", NULL, "HPROUT"},
@@ -90,36 +90,30 @@ static const char *audio_map[][3] = {
90 {"LINE2L", NULL, "Line In"}, 90 {"LINE2L", NULL, "Line In"},
91 {"LINE1R", NULL, "Line In"}, 91 {"LINE1R", NULL, "Line In"},
92 {"LINE2R", NULL, "Line In"}, 92 {"LINE2R", NULL, "Line In"},
93
94 {NULL, NULL, NULL},
95}; 93};
96 94
97/* Logic for a aic3x as connected on a davinci-evm */ 95/* Logic for a aic3x as connected on a davinci-evm */
98static int evm_aic3x_init(struct snd_soc_codec *codec) 96static int evm_aic3x_init(struct snd_soc_codec *codec)
99{ 97{
100 int i;
101
102 /* Add davinci-evm specific widgets */ 98 /* Add davinci-evm specific widgets */
103 for (i = 0; i < ARRAY_SIZE(aic3x_dapm_widgets); i++) 99 snd_soc_dapm_new_controls(codec, aic3x_dapm_widgets,
104 snd_soc_dapm_new_control(codec, &aic3x_dapm_widgets[i]); 100 ARRAY_SIZE(aic3x_dapm_widgets));
105 101
106 /* Set up davinci-evm specific audio path audio_map */ 102 /* Set up davinci-evm specific audio path audio_map */
107 for (i = 0; audio_map[i][0] != NULL; i++) 103 snd_soc_dapm_add_routes(codec, audio_map, ARRAY_SIZE(audio_map));
108 snd_soc_dapm_connect_input(codec, audio_map[i][0],
109 audio_map[i][1], audio_map[i][2]);
110 104
111 /* not connected */ 105 /* not connected */
112 snd_soc_dapm_set_endpoint(codec, "MONO_LOUT", 0); 106 snd_soc_dapm_disable_pin(codec, "MONO_LOUT");
113 snd_soc_dapm_set_endpoint(codec, "HPLCOM", 0); 107 snd_soc_dapm_disable_pin(codec, "HPLCOM");
114 snd_soc_dapm_set_endpoint(codec, "HPRCOM", 0); 108 snd_soc_dapm_disable_pin(codec, "HPRCOM");
115 109
116 /* always connected */ 110 /* always connected */
117 snd_soc_dapm_set_endpoint(codec, "Headphone Jack", 1); 111 snd_soc_dapm_enable_pin(codec, "Headphone Jack");
118 snd_soc_dapm_set_endpoint(codec, "Line Out", 1); 112 snd_soc_dapm_enable_pin(codec, "Line Out");
119 snd_soc_dapm_set_endpoint(codec, "Mic Jack", 1); 113 snd_soc_dapm_enable_pin(codec, "Mic Jack");
120 snd_soc_dapm_set_endpoint(codec, "Line In", 1); 114 snd_soc_dapm_enable_pin(codec, "Line In");
121 115
122 snd_soc_dapm_sync_endpoints(codec); 116 snd_soc_dapm_sync(codec);
123 117
124 return 0; 118 return 0;
125} 119}