Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de1e000d authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: fix unbalanced wake disable for aicl interrupt



There is a bug in the driver where the aicl interrupt was requested to
be wake enabled even before it was requested. This causes the wake
status flag to be out of sync with the actual interrupt wake status.

Fix this by ensuring that the wake operations on the interrupt happen
after requesting it.

Change-Id: Iecba46d61dcde7111ef42effd370d4c7ca04a688
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 2a4b1904
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -3404,7 +3404,8 @@ static void handle_usb_removal(struct smbchg_chip *chip)
	}
	if (parallel_psy)
		power_supply_set_present(parallel_psy, false);
	if (chip->parallel.avail && chip->enable_aicl_wake) {
	if (chip->parallel.avail && chip->aicl_done_irq
			&& chip->enable_aicl_wake) {
		disable_irq_wake(chip->aicl_done_irq);
		chip->enable_aicl_wake = false;
		smbchg_aicl_deglitch_wa_check(chip);
@@ -3439,8 +3440,10 @@ static void handle_usb_insertion(struct smbchg_chip *chip)
	}
	if (parallel_psy)
		power_supply_set_present(parallel_psy, true);
	if (chip->parallel.avail && !chip->enable_aicl_wake) {
		enable_irq_wake(chip->aicl_done_irq);

	if (chip->parallel.avail && chip->aicl_done_irq
			&& !chip->enable_aicl_wake) {
		rc = enable_irq_wake(chip->aicl_done_irq);
		chip->enable_aicl_wake = true;
	}
}
@@ -4394,6 +4397,10 @@ static int smbchg_request_irqs(struct smbchg_chip *chip)
			enable_irq_wake(chip->otg_fail_irq);
			enable_irq_wake(chip->otg_oc_irq);
			enable_irq_wake(chip->usbid_change_irq);
			if (chip->parallel.avail && chip->usb_present) {
				rc = enable_irq_wake(chip->aicl_done_irq);
				chip->enable_aicl_wake = true;
			}
			break;
		case SMBCHG_DC_CHGPTH_SUBTYPE:
			REQUEST_IRQ(chip, spmi_resource, chip->dcin_uv_irq,