summaryrefslogtreecommitdiff
path: root/sound/soc/tegra/tegra_wm8753.c
diff options
context:
space:
mode:
authorVinod G <vinodg@nvidia.com>2011-12-02 16:32:50 -0800
committerVarun Wadekar <vwadekar@nvidia.com>2011-12-08 17:55:48 +0530
commit444d92c3bc71d2d2dd090ac2c1d4d2c0c8517691 (patch)
treed5085033e329c02f487915eeea1142b0b559087b /sound/soc/tegra/tegra_wm8753.c
parent171d61d7e574f83f7f59affb4d3b8edecd5dd587 (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_wm8753.c')
-rw-r--r--sound/soc/tegra/tegra_wm8753.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/tegra/tegra_wm8753.c b/sound/soc/tegra/tegra_wm8753.c
index bc9e3104b605..2405a0fe1320 100644
--- a/sound/soc/tegra/tegra_wm8753.c
+++ b/sound/soc/tegra/tegra_wm8753.c
@@ -81,7 +81,6 @@ static int tegra_wm8753_hw_params(struct snd_pcm_substream *substream,
struct tegra_wm8753 *machine = snd_soc_card_get_drvdata(card);
int srate, mclk, i2s_daifmt;
int err;
-
srate = params_rate(params);
switch (srate) {
case 8000:
@@ -571,6 +570,7 @@ static __devinit int tegra_wm8753_driver_probe(struct platform_device *pdev)
struct tegra_wm8753_platform_data *pdata;
int ret;
+
pdata = pdev->dev.platform_data;
if (!pdata) {
dev_err(&pdev->dev, "No platform data supplied\n");
@@ -600,11 +600,16 @@ static __devinit int tegra_wm8753_driver_probe(struct platform_device *pdev)
goto err_fini_utils;
}
+ if (!card->instantiated) {
+ dev_err(&pdev->dev, "No WM8753 codec\n");
+ goto err_unregister_card;
+ }
+
#ifdef CONFIG_SWITCH
/* Add h2w swith class support */
ret = switch_dev_register(&wired_switch_dev);
if (ret < 0) {
- dev_err(&pdev->dev, "not able to register switch device\n",
+ dev_err(&pdev->dev, "not able to register switch device %d\n",
ret);
goto err_unregister_card;
}