]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
power: supply: qcom_pmi8998_charger: fix wakeirq
authorCasey Connolly <casey.connolly@linaro.org>
Thu, 19 Jun 2025 14:55:11 +0000 (16:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 14:38:59 +0000 (16:38 +0200)
[ Upstream commit 6c5393771c50fac30f08dfb6d2f65f4f2cfeb8c7 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/power/supply/qcom_pmi8998_charger.c

index c2f8f2e24398316ac5c491eaaabe4c455e875c47..cd3cb473c70dd1c289cc4094e74746e3c6dc16ee 100644 (file)
@@ -1016,7 +1016,9 @@ static int smb2_probe(struct platform_device *pdev)
        if (rc < 0)
                return rc;
 
-       rc = dev_pm_set_wake_irq(chip->dev, chip->cable_irq);
+       devm_device_init_wakeup(chip->dev);
+
+       rc = devm_pm_set_wake_irq(chip->dev, chip->cable_irq);
        if (rc < 0)
                return dev_err_probe(chip->dev, rc, "Couldn't set wake irq\n");