summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/mfd/pf1550.c3
-rw-r--r--drivers/power/supply/pf1550_charger.c10
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/mfd/pf1550.c b/drivers/mfd/pf1550.c
index 06d0befd0643..44c92f466a99 100644
--- a/drivers/mfd/pf1550.c
+++ b/drivers/mfd/pf1550.c
@@ -107,11 +107,8 @@ static const struct regmap_irq pf1550_charger_irqs[] = {
static const struct regmap_irq_chip pf1550_charger_irq_chip = {
.name = "pf1550-charger",
.status_base = PF1550_CHARG_REG_CHG_INT,
- .ack_base = PF1550_CHARG_REG_CHG_INT,
.mask_base = PF1550_CHARG_REG_CHG_INT_MASK,
.mask_invert = false,
- .use_ack = 1,
- .init_ack_masked = 1,
.num_regs = 1,
.irqs = pf1550_charger_irqs,
.num_irqs = ARRAY_SIZE(pf1550_charger_irqs),
diff --git a/drivers/power/supply/pf1550_charger.c b/drivers/power/supply/pf1550_charger.c
index fc7c5b9a54ad..d14ef2b29ffd 100644
--- a/drivers/power/supply/pf1550_charger.c
+++ b/drivers/power/supply/pf1550_charger.c
@@ -321,6 +321,7 @@ static void pf1550_charger_irq_work(struct work_struct *work)
struct pf1550_charger,
irq_work);
int i, irq_type = -1;
+ unsigned int status;
if (!chg->charger)
return;
@@ -351,6 +352,11 @@ static void pf1550_charger_irq_work(struct work_struct *work)
dev_err(chg->dev, "unknown interrupt occurred.\n");
}
+ if (regmap_read(chg->pf1550->regmap, PF1550_CHARG_REG_CHG_INT, &status))
+ dev_err(chg->dev, "Read CHG_INT error.\n");
+ if (regmap_write(chg->pf1550->regmap, PF1550_CHARG_REG_CHG_INT, status))
+ dev_err(chg->dev, "clear CHG_INT error.\n");
+
mutex_unlock(&chg->mutex);
}
@@ -492,9 +498,9 @@ static int pf1550_reg_init(struct pf1550_charger *chg)
int ret;
unsigned int data;
- /* Unmask charger interrupt */
+ /* Unmask charger interrupt, mask DPMI and reserved bit */
ret = regmap_write(chg->pf1550->regmap, PF1550_CHARG_REG_CHG_INT_MASK,
- 0x11);
+ 0x51);
if (ret) {
dev_err(chg->dev, "Error unmask charger interrupt: %d\n", ret);
return ret;