From a55e86c26f4096aa7897455bf9e3146ab52f7036 Mon Sep 17 00:00:00 2001 From: Preetham Chandru Date: Mon, 26 Mar 2012 20:38:55 +0530 Subject: ASoC: Tegra wm8903 machine: Remove regulator error message Few boards which uses wm8903 has independent regulators for spk and mic while others do not have it. For the boards which do not have independent regulators we should avoid getting their regulators otherwise we would get the following error messages: "tegra-snd-wm8903 tegra-snd-wm8903.0: No speaker regulator found" "tegra-snd-wm8903 tegra-snd-wm8903.0: No digital mic regulator found" Bug 956562 Signed-off-by: Preetham Chandru Change-Id: Ide1ce141b5d45d56e834dc82a7cf5a7adc6c3e80 Reviewed-on: http://git-master/r/91548 Reviewed-by: Rohan Somvanshi Tested-by: Rohan Somvanshi --- sound/soc/tegra/tegra_wm8903.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'sound') diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c index 24f69e40f7d2..5ccf73223d6d 100644 --- a/sound/soc/tegra/tegra_wm8903.c +++ b/sound/soc/tegra/tegra_wm8903.c @@ -803,16 +803,21 @@ static __devinit int tegra_wm8903_driver_probe(struct platform_device *pdev) if (ret) goto err_free_machine; - machine->spk_reg = regulator_get(&pdev->dev, "vdd_spk_amp"); - if (IS_ERR(machine->spk_reg)) { - dev_info(&pdev->dev, "No speaker regulator found\n"); - machine->spk_reg = 0; + if (machine_is_cardhu() || machine_is_ventana()) { + machine->spk_reg = regulator_get(&pdev->dev, "vdd_spk_amp"); + if (IS_ERR(machine->spk_reg)) { + dev_info(&pdev->dev, "No speaker regulator found\n"); + machine->spk_reg = 0; + } } - machine->dmic_reg = regulator_get(&pdev->dev, "vdd_dmic"); - if (IS_ERR(machine->dmic_reg)) { - dev_info(&pdev->dev, "No digital mic regulator found\n"); - machine->dmic_reg = 0; + if (machine_is_ventana()) { + machine->dmic_reg = regulator_get(&pdev->dev, "vdd_dmic"); + if (IS_ERR(machine->dmic_reg)) { + dev_info(&pdev->dev, "No digital mic" + " regulator found\n"); + machine->dmic_reg = 0; + } } if (machine_is_cardhu()) { -- cgit v1.2.3