ASoC: Tegra wm8903 machine: Remove regulator error message
Preetham Chandru [Mon, 26 Mar 2012 15:08:55 +0000 (20:08 +0530)]
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 <pchandru@nvidia.com>
Change-Id: Ide1ce141b5d45d56e834dc82a7cf5a7adc6c3e80
Reviewed-on: http://git-master/r/91548
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

sound/soc/tegra/tegra_wm8903.c

index 24f69e4..5ccf732 100644 (file)
@@ -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()) {