Merge "power: qpnp-charger: Disable IRQ wake-up when disabling the IRQ"
diff --git a/drivers/power/qpnp-charger.c b/drivers/power/qpnp-charger.c
index 10c24ee..3029744 100644
--- a/drivers/power/qpnp-charger.c
+++ b/drivers/power/qpnp-charger.c
@@ -229,6 +229,7 @@
int irq;
unsigned long disabled;
unsigned long wake_enable;
+ bool is_wake;
};
struct qpnp_chg_regulator {
@@ -618,6 +619,10 @@
pr_debug("number = %d\n", irq->irq);
enable_irq(irq->irq);
}
+ if ((irq->is_wake) && (!__test_and_set_bit(0, &irq->wake_enable))) {
+ pr_debug("enable wake, number = %d\n", irq->irq);
+ enable_irq_wake(irq->irq);
+ }
}
static void
@@ -627,6 +632,10 @@
pr_debug("number = %d\n", irq->irq);
disable_irq_nosync(irq->irq);
}
+ if ((irq->is_wake) && (__test_and_clear_bit(0, &irq->wake_enable))) {
+ pr_debug("disable wake, number = %d\n", irq->irq);
+ disable_irq_wake(irq->irq);
+ }
}
static void
@@ -636,6 +645,7 @@
pr_debug("number = %d\n", irq->irq);
enable_irq_wake(irq->irq);
}
+ irq->is_wake = true;
}
static void
@@ -645,6 +655,7 @@
pr_debug("number = %d\n", irq->irq);
disable_irq_wake(irq->irq);
}
+ irq->is_wake = false;
}
#define USB_OTG_EN_BIT BIT(0)
@@ -4495,10 +4506,10 @@
qpnp_chg_irq_wake_enable(&chip->chg_trklchg);
qpnp_chg_irq_wake_enable(&chip->chg_failed);
- qpnp_chg_disable_irq(&chip->chg_vbatdet_lo);
qpnp_chg_irq_wake_enable(&chip->chg_vbatdet_lo);
-
+ qpnp_chg_disable_irq(&chip->chg_vbatdet_lo);
break;
+
case SMBB_BAT_IF_SUBTYPE:
case SMBBP_BAT_IF_SUBTYPE:
case SMBCL_BAT_IF_SUBTYPE: