diff options
Diffstat (limited to 'sound/soc/codecs/tlv320aic26.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic26.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c index bed8a9e63ddc..29f2f1a017fd 100644 --- a/sound/soc/codecs/tlv320aic26.c +++ b/sound/soc/codecs/tlv320aic26.c | |||
@@ -125,7 +125,8 @@ static int aic26_reg_write(struct snd_soc_codec *codec, unsigned int reg, | |||
125 | * Digital Audio Interface Operations | 125 | * Digital Audio Interface Operations |
126 | */ | 126 | */ |
127 | static int aic26_hw_params(struct snd_pcm_substream *substream, | 127 | static int aic26_hw_params(struct snd_pcm_substream *substream, |
128 | struct snd_pcm_hw_params *params) | 128 | struct snd_pcm_hw_params *params, |
129 | struct snd_soc_dai *dai) | ||
129 | { | 130 | { |
130 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 131 | struct snd_soc_pcm_runtime *rtd = substream->private_data; |
131 | struct snd_soc_device *socdev = rtd->socdev; | 132 | struct snd_soc_device *socdev = rtd->socdev; |
@@ -287,8 +288,6 @@ struct snd_soc_dai aic26_dai = { | |||
287 | }, | 288 | }, |
288 | .ops = { | 289 | .ops = { |
289 | .hw_params = aic26_hw_params, | 290 | .hw_params = aic26_hw_params, |
290 | }, | ||
291 | .dai_ops = { | ||
292 | .digital_mute = aic26_mute, | 291 | .digital_mute = aic26_mute, |
293 | .set_sysclk = aic26_set_sysclk, | 292 | .set_sysclk = aic26_set_sysclk, |
294 | .set_fmt = aic26_set_fmt, | 293 | .set_fmt = aic26_set_fmt, |
@@ -360,7 +359,7 @@ static int aic26_probe(struct platform_device *pdev) | |||
360 | 359 | ||
361 | /* CODEC is setup, we can register the card now */ | 360 | /* CODEC is setup, we can register the card now */ |
362 | dev_dbg(&pdev->dev, "Registering card\n"); | 361 | dev_dbg(&pdev->dev, "Registering card\n"); |
363 | ret = snd_soc_register_card(socdev); | 362 | ret = snd_soc_init_card(socdev); |
364 | if (ret < 0) { | 363 | if (ret < 0) { |
365 | dev_err(&pdev->dev, "aic26: failed to register card\n"); | 364 | dev_err(&pdev->dev, "aic26: failed to register card\n"); |
366 | goto card_err; | 365 | goto card_err; |
@@ -427,7 +426,7 @@ static DEVICE_ATTR(keyclick, 0644, aic26_keyclick_show, aic26_keyclick_set); | |||
427 | static int aic26_spi_probe(struct spi_device *spi) | 426 | static int aic26_spi_probe(struct spi_device *spi) |
428 | { | 427 | { |
429 | struct aic26 *aic26; | 428 | struct aic26 *aic26; |
430 | int rc, i, reg; | 429 | int ret, i, reg; |
431 | 430 | ||
432 | dev_dbg(&spi->dev, "probing tlv320aic26 spi device\n"); | 431 | dev_dbg(&spi->dev, "probing tlv320aic26 spi device\n"); |
433 | 432 | ||
@@ -457,6 +456,14 @@ static int aic26_spi_probe(struct spi_device *spi) | |||
457 | aic26->codec.reg_cache_size = AIC26_NUM_REGS; | 456 | aic26->codec.reg_cache_size = AIC26_NUM_REGS; |
458 | aic26->codec.reg_cache = aic26->reg_cache; | 457 | aic26->codec.reg_cache = aic26->reg_cache; |
459 | 458 | ||
459 | aic26_dai.dev = &spi->dev; | ||
460 | ret = snd_soc_register_dai(&aic26_dai); | ||
461 | if (ret != 0) { | ||
462 | dev_err(&spi->dev, "Failed to register DAI: %d\n", ret); | ||
463 | kfree(aic26); | ||
464 | return ret; | ||
465 | } | ||
466 | |||
460 | /* Reset the codec to power on defaults */ | 467 | /* Reset the codec to power on defaults */ |
461 | aic26_reg_write(&aic26->codec, AIC26_REG_RESET, 0xBB00); | 468 | aic26_reg_write(&aic26->codec, AIC26_REG_RESET, 0xBB00); |
462 | 469 | ||
@@ -475,8 +482,8 @@ static int aic26_spi_probe(struct spi_device *spi) | |||
475 | 482 | ||
476 | /* Register the sysfs files for debugging */ | 483 | /* Register the sysfs files for debugging */ |
477 | /* Create SysFS files */ | 484 | /* Create SysFS files */ |
478 | rc = device_create_file(&spi->dev, &dev_attr_keyclick); | 485 | ret = device_create_file(&spi->dev, &dev_attr_keyclick); |
479 | if (rc) | 486 | if (ret) |
480 | dev_info(&spi->dev, "error creating sysfs files\n"); | 487 | dev_info(&spi->dev, "error creating sysfs files\n"); |
481 | 488 | ||
482 | #if defined(CONFIG_SND_SOC_OF_SIMPLE) | 489 | #if defined(CONFIG_SND_SOC_OF_SIMPLE) |
@@ -493,6 +500,7 @@ static int aic26_spi_remove(struct spi_device *spi) | |||
493 | { | 500 | { |
494 | struct aic26 *aic26 = dev_get_drvdata(&spi->dev); | 501 | struct aic26 *aic26 = dev_get_drvdata(&spi->dev); |
495 | 502 | ||
503 | snd_soc_unregister_dai(&aic26_dai); | ||
496 | kfree(aic26); | 504 | kfree(aic26); |
497 | 505 | ||
498 | return 0; | 506 | return 0; |