aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tlv320aic26.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/tlv320aic26.c')
-rw-r--r--sound/soc/codecs/tlv320aic26.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c
index 29f2f1a017fd..3387d9e736ea 100644
--- a/sound/soc/codecs/tlv320aic26.c
+++ b/sound/soc/codecs/tlv320aic26.c
@@ -130,7 +130,7 @@ static int aic26_hw_params(struct snd_pcm_substream *substream,
130{ 130{
131 struct snd_soc_pcm_runtime *rtd = substream->private_data; 131 struct snd_soc_pcm_runtime *rtd = substream->private_data;
132 struct snd_soc_device *socdev = rtd->socdev; 132 struct snd_soc_device *socdev = rtd->socdev;
133 struct snd_soc_codec *codec = socdev->codec; 133 struct snd_soc_codec *codec = socdev->card->codec;
134 struct aic26 *aic26 = codec->private_data; 134 struct aic26 *aic26 = codec->private_data;
135 int fsref, divisor, wlen, pval, jval, dval, qval; 135 int fsref, divisor, wlen, pval, jval, dval, qval;
136 u16 reg; 136 u16 reg;
@@ -270,6 +270,13 @@ static int aic26_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
270#define AIC26_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |\ 270#define AIC26_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |\
271 SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE) 271 SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE)
272 272
273static struct snd_soc_dai_ops aic26_dai_ops = {
274 .hw_params = aic26_hw_params,
275 .digital_mute = aic26_mute,
276 .set_sysclk = aic26_set_sysclk,
277 .set_fmt = aic26_set_fmt,
278};
279
273struct snd_soc_dai aic26_dai = { 280struct snd_soc_dai aic26_dai = {
274 .name = "tlv320aic26", 281 .name = "tlv320aic26",
275 .playback = { 282 .playback = {
@@ -286,12 +293,7 @@ struct snd_soc_dai aic26_dai = {
286 .rates = AIC26_RATES, 293 .rates = AIC26_RATES,
287 .formats = AIC26_FORMATS, 294 .formats = AIC26_FORMATS,
288 }, 295 },
289 .ops = { 296 .ops = &aic26_dai_ops,
290 .hw_params = aic26_hw_params,
291 .digital_mute = aic26_mute,
292 .set_sysclk = aic26_set_sysclk,
293 .set_fmt = aic26_set_fmt,
294 },
295}; 297};
296EXPORT_SYMBOL_GPL(aic26_dai); 298EXPORT_SYMBOL_GPL(aic26_dai);
297 299
@@ -322,9 +324,8 @@ static int aic26_probe(struct platform_device *pdev)
322{ 324{
323 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 325 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
324 struct snd_soc_codec *codec; 326 struct snd_soc_codec *codec;
325 struct snd_kcontrol *kcontrol;
326 struct aic26 *aic26; 327 struct aic26 *aic26;
327 int i, ret, err; 328 int ret, err;
328 329
329 dev_info(&pdev->dev, "Probing AIC26 SoC CODEC driver\n"); 330 dev_info(&pdev->dev, "Probing AIC26 SoC CODEC driver\n");
330 dev_dbg(&pdev->dev, "socdev=%p\n", socdev); 331 dev_dbg(&pdev->dev, "socdev=%p\n", socdev);
@@ -338,7 +339,7 @@ static int aic26_probe(struct platform_device *pdev)
338 return -ENODEV; 339 return -ENODEV;
339 } 340 }
340 codec = &aic26->codec; 341 codec = &aic26->codec;
341 socdev->codec = codec; 342 socdev->card->codec = codec;
342 343
343 dev_dbg(&pdev->dev, "Registering PCMs, dev=%p, socdev->dev=%p\n", 344 dev_dbg(&pdev->dev, "Registering PCMs, dev=%p, socdev->dev=%p\n",
344 &pdev->dev, socdev->dev); 345 &pdev->dev, socdev->dev);
@@ -351,11 +352,9 @@ static int aic26_probe(struct platform_device *pdev)
351 352
352 /* register controls */ 353 /* register controls */
353 dev_dbg(&pdev->dev, "Registering controls\n"); 354 dev_dbg(&pdev->dev, "Registering controls\n");
354 for (i = 0; i < ARRAY_SIZE(aic26_snd_controls); i++) { 355 err = snd_soc_add_controls(codec, aic26_snd_controls,
355 kcontrol = snd_soc_cnew(&aic26_snd_controls[i], codec, NULL); 356 ARRAY_SIZE(aic26_snd_controls));
356 err = snd_ctl_add(codec->card, kcontrol); 357 WARN_ON(err < 0);
357 WARN_ON(err < 0);
358 }
359 358
360 /* CODEC is setup, we can register the card now */ 359 /* CODEC is setup, we can register the card now */
361 dev_dbg(&pdev->dev, "Registering card\n"); 360 dev_dbg(&pdev->dev, "Registering card\n");