]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
soc: tegra: rt5639: fix sysedp state notifications
authorTimo Alho <talho@nvidia.com>
Wed, 30 Oct 2013 20:35:04 +0000 (22:35 +0200)
committerMitch Luban <mluban@nvidia.com>
Fri, 15 Nov 2013 21:53:55 +0000 (13:53 -0800)
System EDP state notifications (for revised framework) were introduced
to wrong if/else branch. This patch fixes the issue.

Bug 1398620

Change-Id: Iacf2929b2c73232c02e8df96e7a666cba091718c
Signed-off-by: Timo Alho <talho@nvidia.com>
Reviewed-on: http://git-master/r/331719
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
sound/soc/tegra/tegra_rt5639.c

index 9974f4f667771570a889f987c6aee9b900d67ad2..149491f009509f3341cbc7568d1c777c58fc2c4d 100644 (file)
@@ -562,10 +562,13 @@ static int tegra_rt5639_event_int_spk(struct snd_soc_dapm_widget *w,
 
        if (machine->spk_edp_client == NULL) {
                if (machine->spk_reg) {
-                       if (SND_SOC_DAPM_EVENT_ON(event))
+                       if (SND_SOC_DAPM_EVENT_ON(event)) {
+                               sysedp_set_state(machine->sysedpc, 1);
                                err = regulator_enable(machine->spk_reg);
-                       else
+                       } else {
                                regulator_disable(machine->spk_reg);
+                               sysedp_set_state(machine->sysedpc, 0);
+                       }
                }
                goto err_null_spk_edp_client;
        }
@@ -574,7 +577,6 @@ static int tegra_rt5639_event_int_spk(struct snd_soc_dapm_widget *w,
                ret = edp_update_client_request(machine->spk_edp_client,
                                                TEGRA_SPK_EDP_NEG_1,
                                                &approved);
-               sysedp_set_state(machine->sysedpc, 1);
                err = regulator_enable(machine->spk_reg);
                if (ret || approved != TEGRA_SPK_EDP_NEG_1) {
                        if (approved == TEGRA_SPK_EDP_ZERO)
@@ -588,7 +590,6 @@ static int tegra_rt5639_event_int_spk(struct snd_soc_dapm_widget *w,
                /* turn off codec volume,-46.5 dB, E1 state */
                tegra_speaker_edp_set_volume(codec, 0x27, 0x27);
                regulator_disable(machine->spk_reg);
-               sysedp_set_state(machine->sysedpc, 0);
                ret = edp_update_client_request(machine->spk_edp_client,
                                                TEGRA_SPK_EDP_1,
                                                NULL);