diff options
author | Vinod G <vinodg@nvidia.com> | 2011-12-02 16:32:50 -0800 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2011-12-08 17:55:48 +0530 |
commit | 444d92c3bc71d2d2dd090ac2c1d4d2c0c8517691 (patch) | |
tree | d5085033e329c02f487915eeea1142b0b559087b /sound/soc/tegra/tegra_aic326x.c | |
parent | 171d61d7e574f83f7f59affb4d3b8edecd5dd587 (diff) |
kernel: sound: soc: Fix TI codec reg access issue.
Using snd_soc_write is causing some issue with TI codec.
So register read and write are handled locally inside the codec calls.
Added checking to continue card register based on codec availability, this
help to use either TI codec or wm8753 codec being present in the board.
bug 816608
Change-Id: Ie5edd1c70609991c28216bbc3a0ffcafd0f815ab
Reviewed-on: http://git-master/r/68044
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Tested-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: Scott Peterson <speterson@nvidia.com>
Diffstat (limited to 'sound/soc/tegra/tegra_aic326x.c')
-rw-r--r-- | sound/soc/tegra/tegra_aic326x.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/sound/soc/tegra/tegra_aic326x.c b/sound/soc/tegra/tegra_aic326x.c index 635756379f23..77cc53ad9090 100644 --- a/sound/soc/tegra/tegra_aic326x.c +++ b/sound/soc/tegra/tegra_aic326x.c @@ -588,11 +588,11 @@ static int tegra_aic326x_bt_voice_call_hw_params( static void tegra_aic326x_bt_voice_call_shutdown( struct snd_pcm_substream *substream) { +#ifndef CONFIG_ARCH_TEGRA_2x_SOC struct snd_soc_pcm_runtime *rtd = substream->private_data; struct tegra_aic326x *machine = snd_soc_card_get_drvdata(rtd->codec->card); -#ifndef CONFIG_ARCH_TEGRA_2x_SOC machine->codec_info[BT_SCO].rate = 0; machine->codec_info[BT_SCO].channels = 0; #endif @@ -915,7 +915,7 @@ static struct snd_soc_dai_link tegra_aic326x_dai[] = { .codec_dai_name = "dit-hifi", .ops = &tegra_aic326x_bt_ops, }, - /*[DAI_LINK_VOICE_CALL] = { + [DAI_LINK_VOICE_CALL] = { .name = "VOICE CALL", .stream_name = "VOICE CALL PCM", .codec_name = "aic3262-codec.4-0018", @@ -923,7 +923,7 @@ static struct snd_soc_dai_link tegra_aic326x_dai[] = { .cpu_dai_name = "dit-hifi", .codec_dai_name = "aic3262-asi2", .ops = &tegra_aic326x_voice_call_ops, - },*/ + }, /* TODO - enabling this cause binding issue- figure out */ /*[DAI_LINK_BT_VOICE_CALL] = { .name = "BT VOICE CALL", @@ -971,16 +971,6 @@ static __devinit int tegra_aic326x_driver_probe(struct platform_device *pdev) platform_set_drvdata(pdev, card); snd_soc_card_set_drvdata(card, machine); -#ifdef CONFIG_SWITCH - /* Add h2w switch class support */ - ret = switch_dev_register(&aic326x_wired_switch_dev); - if (ret < 0) { - dev_err(&pdev->dev, "not able to register switch device %d\n", - ret); - goto err_fini_utils; - } -#endif - #ifndef CONFIG_ARCH_TEGRA_2x_SOC for (i = 0; i < NUM_I2S_DEVICES ; i++) machine->codec_info[i].i2s_id = pdata->audio_port_id[i]; @@ -999,15 +989,28 @@ static __devinit int tegra_aic326x_driver_probe(struct platform_device *pdev) if (ret) { dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); - goto err_switch_unregister; + goto err_fini_utils; } - return 0; + if (!card->instantiated) { + dev_err(&pdev->dev, "No TI AIC3262 codec\n"); + goto err_unregister_card; + } -err_switch_unregister: #ifdef CONFIG_SWITCH - switch_dev_unregister(&aic326x_wired_switch_dev); + /* Add h2w switch class support */ + ret = switch_dev_register(&aic326x_wired_switch_dev); + if (ret < 0) { + dev_err(&pdev->dev, "not able to register switch device %d\n", + ret); + goto err_unregister_card; + } #endif + + return 0; + +err_unregister_card: + snd_soc_unregister_card(card); err_fini_utils: tegra_asoc_utils_fini(&machine->util_data); err_free_machine: |