summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/powerdetect.c
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2011-12-13 19:13:49 +0900
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 00:58:37 -0700
commitd228d45687f1da63488543d505b0e69aebe7e8ba (patch)
tree44d6faf9c2ae0ee34eae51b7cf211dd501896ab8 /arch/arm/mach-tegra/powerdetect.c
parent53c7d1fa279f2f20b1b44e3a1ce0527e0904c256 (diff)
tegra: fix processing of regulator notifier event
Regulator notifier event chain may be called with several events OR'd together, e.g. in drivers/regulator/core.c: _notifier_call_chain(rdev, REGULATOR_EVENT_FORCE_DISABLE | REGULATOR_EVENT_DISABLE, Bug 913417 Change-Id: Ifba9860c1ee59c2fe2a4ee3c901e983912e07139 Signed-off-by: Alexandre Courbot <acourbot@nvidia.com> Reviewed-on: http://git-master/r/69725 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: Rb83003f89e371b359616e000f3cef249554bb999
Diffstat (limited to 'arch/arm/mach-tegra/powerdetect.c')
-rw-r--r--arch/arm/mach-tegra/powerdetect.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/arch/arm/mach-tegra/powerdetect.c b/arch/arm/mach-tegra/powerdetect.c
index 518ab51d40ea..a726da140886 100644
--- a/arch/arm/mach-tegra/powerdetect.c
+++ b/arch/arm/mach-tegra/powerdetect.c
@@ -237,31 +237,28 @@ static int pwrdet_notify_cb(
spin_lock_irqsave(&pwr_lock, flags);
- switch (event) {
- case REGULATOR_EVENT_PRE_ENABLE:
+ if (event & REGULATOR_EVENT_PRE_ENABLE) {
pwrio_disabled_mask &= ~cell->pwrio_mask;
if (!pwrio_always_on)
pwr_io_enable(cell->pwrio_mask);
- /* fall thru */
- case REGULATOR_EVENT_OUT_PRECHANGE:
+ }
+ if (event & (REGULATOR_EVENT_PRE_ENABLE |
+ REGULATOR_EVENT_OUT_PRECHANGE)) {
if (!pwrdet_always_on && cell->pwrdet_mask)
pwr_detect_reset(cell->pwrdet_mask);
- break;
-
- case REGULATOR_EVENT_POST_ENABLE:
- case REGULATOR_EVENT_OUT_POSTCHANGE:
+ }
+ if (event & (REGULATOR_EVENT_POST_ENABLE |
+ REGULATOR_EVENT_OUT_POSTCHANGE)) {
if (!pwrdet_always_on && cell->pwrdet_mask) {
pwr_detect_start(cell->pwrdet_mask);
pwr_detect_latch();
}
- break;
-
- case REGULATOR_EVENT_DISABLE:
- case REGULATOR_EVENT_FORCE_DISABLE:
+ }
+ if (event & (REGULATOR_EVENT_DISABLE |
+ REGULATOR_EVENT_FORCE_DISABLE)) {
pwrio_disabled_mask |= cell->pwrio_mask;
if (!pwrio_always_on)
pwr_io_disable(cell->pwrio_mask);
- break;
}
pr_debug("tegra: %s: event %lu, pwrdet 0x%x, pwrio 0x%x\n",