diff --git a/drivers/leds/leds-qpnp-haptics.c b/drivers/leds/leds-qpnp-haptics.c index 87aa4495bbda..0a7edc713a2c 100644 --- a/drivers/leds/leds-qpnp-haptics.c +++ b/drivers/leds/leds-qpnp-haptics.c @@ -2519,6 +2519,16 @@ static int qpnp_haptics_remove(struct platform_device *pdev) return 0; } +static void qpnp_haptics_shutdown(struct platform_device *pdev) +{ + struct hap_chip *chip = dev_get_drvdata(&pdev->dev); + + cancel_work_sync(&chip->haptics_work); + + /* disable haptics */ + qpnp_haptics_mod_enable(chip, false); +} + static const struct dev_pm_ops qpnp_haptics_pm_ops = { .suspend = qpnp_haptics_suspend, }; @@ -2536,6 +2546,7 @@ static struct platform_driver qpnp_haptics_driver = { }, .probe = qpnp_haptics_probe, .remove = qpnp_haptics_remove, + .shutdown = qpnp_haptics_shutdown, }; module_platform_driver(qpnp_haptics_driver);