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

Commit aa4cb467 authored by Xiaozhe Shi's avatar Xiaozhe Shi Committed by Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: always change aicl done irq wake status



Currently if the smb135x parallel charger driver has not registered the
usb-parallel power supply, the aicl done irq wake status will not be
changed in the smbcharger driver. This is incorrect since the smbcharger
driver may probe before the parallel charger driver and skip enabling
the aicl_done irq as wakeable.

Fix this by checking if parallel charging is configured instead of
relying on the parallel charger power supply being registered.

Change-Id: Ife01276f4e8dbd6271242cbee3f34719b6960edd
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent 1ce74997
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ struct smbchg_chip {
	int				usbid_change_irq;
	int				chg_inhibit_irq;
	int				chg_error_irq;
	bool				enable_aicl_wake;

	/* psy */
	struct power_supply		*usb_psy;
@@ -2542,9 +2543,11 @@ static void handle_usb_removal(struct smbchg_chip *chip)
		power_supply_set_present(chip->usb_psy, chip->usb_present);
		schedule_work(&chip->usb_set_online_work);
	}
	if (parallel_psy) {
	if (parallel_psy)
		power_supply_set_present(parallel_psy, false);
	if (chip->parallel.avail && chip->enable_aicl_wake) {
		disable_irq_wake(chip->aicl_done_irq);
		chip->enable_aicl_wake = false;
	}
}

@@ -2573,9 +2576,11 @@ static void handle_usb_insertion(struct smbchg_chip *chip)
		power_supply_set_present(chip->usb_psy, chip->usb_present);
		schedule_work(&chip->usb_set_online_work);
	}
	if (parallel_psy) {
	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);
		chip->enable_aicl_wake = true;
	}
}