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.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sound/soc/codecs/tlv320aic26.c b/sound/soc/codecs/tlv320aic26.c
index e33fb7e00d1e..29f2f1a017fd 100644
--- a/sound/soc/codecs/tlv320aic26.c
+++ b/sound/soc/codecs/tlv320aic26.c
@@ -426,7 +426,7 @@ static DEVICE_ATTR(keyclick, 0644, aic26_keyclick_show, aic26_keyclick_set);
426static int aic26_spi_probe(struct spi_device *spi) 426static int aic26_spi_probe(struct spi_device *spi)
427{ 427{
428 struct aic26 *aic26; 428 struct aic26 *aic26;
429 int rc, i, reg; 429 int ret, i, reg;
430 430
431 dev_dbg(&spi->dev, "probing tlv320aic26 spi device\n"); 431 dev_dbg(&spi->dev, "probing tlv320aic26 spi device\n");
432 432
@@ -456,6 +456,14 @@ static int aic26_spi_probe(struct spi_device *spi)
456 aic26->codec.reg_cache_size = AIC26_NUM_REGS; 456 aic26->codec.reg_cache_size = AIC26_NUM_REGS;
457 aic26->codec.reg_cache = aic26->reg_cache; 457 aic26->codec.reg_cache = aic26->reg_cache;
458 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
459 /* Reset the codec to power on defaults */ 467 /* Reset the codec to power on defaults */
460 aic26_reg_write(&aic26->codec, AIC26_REG_RESET, 0xBB00); 468 aic26_reg_write(&aic26->codec, AIC26_REG_RESET, 0xBB00);
461 469
@@ -474,8 +482,8 @@ static int aic26_spi_probe(struct spi_device *spi)
474 482
475 /* Register the sysfs files for debugging */ 483 /* Register the sysfs files for debugging */
476 /* Create SysFS files */ 484 /* Create SysFS files */
477 rc = device_create_file(&spi->dev, &dev_attr_keyclick); 485 ret = device_create_file(&spi->dev, &dev_attr_keyclick);
478 if (rc) 486 if (ret)
479 dev_info(&spi->dev, "error creating sysfs files\n"); 487 dev_info(&spi->dev, "error creating sysfs files\n");
480 488
481#if defined(CONFIG_SND_SOC_OF_SIMPLE) 489#if defined(CONFIG_SND_SOC_OF_SIMPLE)
@@ -492,6 +500,7 @@ static int aic26_spi_remove(struct spi_device *spi)
492{ 500{
493 struct aic26 *aic26 = dev_get_drvdata(&spi->dev); 501 struct aic26 *aic26 = dev_get_drvdata(&spi->dev);
494 502
503 snd_soc_unregister_dai(&aic26_dai);
495 kfree(aic26); 504 kfree(aic26);
496 505
497 return 0; 506 return 0;