Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: supply: qcom_pmi8998_charger: fix wakeirq

Unloading and reloading the driver (e.g. when built as a module)
currently leads to errors trying to enable wake IRQ since it's already
enabled.

Use devm to manage this for us so it correctly gets disabled when
removing the driver.

Additionally, call device_init_wakeup() so that charger attach/remove
will trigger a wakeup by default.

Fixes: 8648aeb5d7b7 ("power: supply: add Qualcomm PMI8998 SMB2 Charger driver")
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250619-smb2-smb5-support-v1-3-ac5dec51b6e1@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Casey Connolly and committed by
Sebastian Reichel
6c539377 2937f5d2

+3 -1
+3 -1
drivers/power/supply/qcom_pmi8998_charger.c
··· 1016 1016 if (rc < 0) 1017 1017 return rc; 1018 1018 1019 - rc = dev_pm_set_wake_irq(chip->dev, chip->cable_irq); 1019 + devm_device_init_wakeup(chip->dev); 1020 + 1021 + rc = devm_pm_set_wake_irq(chip->dev, chip->cable_irq); 1020 1022 if (rc < 0) 1021 1023 return dev_err_probe(chip->dev, rc, "Couldn't set wake irq\n"); 1022 1024