thermal: qcom: spmi-temp-alarm: Disable INT in shutdown cb

On SKUs with MSM + Co-proc there can be possiblity that
because of Interrupts enabled from MSM side (SPMI) the exit
of LPM might not work because PBS gets locked because of
which the sequence to exit LPM might not get triggered.

Add support for shutdown callback and disable INT in shutdown
cb to ensure that INT are disabled before entering LPM.

Change-Id: I0688d5d2d9c8fde843c5dba1aff7b21187c53db3
Signed-off-by: Umang Chheda <quic_uchheda@quicinc.com>
This commit is contained in:
Umang Chheda 2021-11-12 17:26:16 +05:30 committed by Rakesh Kota
parent 6a524bc30b
commit cd5a6997dd

View File

@ -10,6 +10,7 @@
#include <linux/err.h>
#include <linux/iio/consumer.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
@ -889,6 +890,14 @@ static int qpnp_tm_restore(struct device *dev)
return ret;
}
static void qpnp_tm_shutdown(struct platform_device *pdev)
{
struct qpnp_tm_chip *chip = platform_get_drvdata(pdev);
if (chip->irq > 0)
devm_free_irq(chip->dev, chip->irq, chip);
}
static int qpnp_tm_freeze(struct device *dev)
{
struct qpnp_tm_chip *chip = dev_get_drvdata(dev);
@ -939,6 +948,7 @@ static struct platform_driver qpnp_tm_driver = {
.pm = &qpnp_tm_pm_ops,
},
.probe = qpnp_tm_probe,
.shutdown = qpnp_tm_shutdown,
};
module_platform_driver(qpnp_tm_driver);