diff options
Diffstat (limited to 'sound/soc/fsl/mpc8610_hpcd.c')
-rw-r--r-- | sound/soc/fsl/mpc8610_hpcd.c | 58 |
1 files changed, 24 insertions, 34 deletions
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c index 59d7e49bd661..4bdc9d8fc90e 100644 --- a/sound/soc/fsl/mpc8610_hpcd.c +++ b/sound/soc/fsl/mpc8610_hpcd.c | |||
@@ -103,55 +103,45 @@ static int mpc8610_hpcd_startup(struct snd_pcm_substream *substream) | |||
103 | int ret = 0; | 103 | int ret = 0; |
104 | 104 | ||
105 | /* Tell the CPU driver what the serial protocol is. */ | 105 | /* Tell the CPU driver what the serial protocol is. */ |
106 | if (cpu_dai->dai_ops.set_fmt) { | 106 | ret = snd_soc_dai_set_fmt(cpu_dai, machine_data->dai_format); |
107 | ret = cpu_dai->dai_ops.set_fmt(cpu_dai, | 107 | if (ret < 0) { |
108 | machine_data->dai_format); | 108 | dev_err(substream->pcm->card->dev, |
109 | if (ret < 0) { | 109 | "could not set CPU driver audio format\n"); |
110 | dev_err(substream->pcm->card->dev, | 110 | return ret; |
111 | "could not set CPU driver audio format\n"); | ||
112 | return ret; | ||
113 | } | ||
114 | } | 111 | } |
115 | 112 | ||
116 | /* Tell the codec driver what the serial protocol is. */ | 113 | /* Tell the codec driver what the serial protocol is. */ |
117 | if (codec_dai->dai_ops.set_fmt) { | 114 | ret = snd_soc_dai_set_fmt(codec_dai, machine_data->dai_format); |
118 | ret = codec_dai->dai_ops.set_fmt(codec_dai, | 115 | if (ret < 0) { |
119 | machine_data->dai_format); | 116 | dev_err(substream->pcm->card->dev, |
120 | if (ret < 0) { | 117 | "could not set codec driver audio format\n"); |
121 | dev_err(substream->pcm->card->dev, | 118 | return ret; |
122 | "could not set codec driver audio format\n"); | ||
123 | return ret; | ||
124 | } | ||
125 | } | 119 | } |
126 | 120 | ||
127 | /* | 121 | /* |
128 | * Tell the CPU driver what the clock frequency is, and whether it's a | 122 | * Tell the CPU driver what the clock frequency is, and whether it's a |
129 | * slave or master. | 123 | * slave or master. |
130 | */ | 124 | */ |
131 | if (cpu_dai->dai_ops.set_sysclk) { | 125 | ret = snd_soc_dai_set_sysclk(cpu_dai, 0, |
132 | ret = cpu_dai->dai_ops.set_sysclk(cpu_dai, 0, | 126 | machine_data->clk_frequency, |
133 | machine_data->clk_frequency, | 127 | machine_data->cpu_clk_direction); |
134 | machine_data->cpu_clk_direction); | 128 | if (ret < 0) { |
135 | if (ret < 0) { | 129 | dev_err(substream->pcm->card->dev, |
136 | dev_err(substream->pcm->card->dev, | 130 | "could not set CPU driver clock parameters\n"); |
137 | "could not set CPU driver clock parameters\n"); | 131 | return ret; |
138 | return ret; | ||
139 | } | ||
140 | } | 132 | } |
141 | 133 | ||
142 | /* | 134 | /* |
143 | * Tell the codec driver what the MCLK frequency is, and whether it's | 135 | * Tell the codec driver what the MCLK frequency is, and whether it's |
144 | * a slave or master. | 136 | * a slave or master. |
145 | */ | 137 | */ |
146 | if (codec_dai->dai_ops.set_sysclk) { | 138 | ret = snd_soc_dai_set_sysclk(codec_dai, 0, |
147 | ret = codec_dai->dai_ops.set_sysclk(codec_dai, 0, | 139 | machine_data->clk_frequency, |
148 | machine_data->clk_frequency, | 140 | machine_data->codec_clk_direction); |
149 | machine_data->codec_clk_direction); | 141 | if (ret < 0) { |
150 | if (ret < 0) { | 142 | dev_err(substream->pcm->card->dev, |
151 | dev_err(substream->pcm->card->dev, | 143 | "could not set codec driver clock params\n"); |
152 | "could not set codec driver clock params\n"); | 144 | return ret; |
153 | return ret; | ||
154 | } | ||
155 | } | 145 | } |
156 | 146 | ||
157 | return 0; | 147 | return 0; |