提交 4c7f85a3 编写于 作者: D Dmitry Osipenko 提交者: Guenter Roeck

hwmon: (lm90) Disable interrupt on suspend

I2C accesses are prohibited and will error out after suspending of the
I2C controller, hence we need to ensure that interrupt won't fire on
suspend when it's too late. Disable interrupt across suspend/resume.
Signed-off-by: NDmitry Osipenko <digetx@gmail.com>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 2abdc357
...@@ -1973,11 +1973,36 @@ static void lm90_alert(struct i2c_client *client, enum i2c_alert_protocol type, ...@@ -1973,11 +1973,36 @@ static void lm90_alert(struct i2c_client *client, enum i2c_alert_protocol type,
} }
} }
static int __maybe_unused lm90_suspend(struct device *dev)
{
struct lm90_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->client;
if (client->irq)
disable_irq(client->irq);
return 0;
}
static int __maybe_unused lm90_resume(struct device *dev)
{
struct lm90_data *data = dev_get_drvdata(dev);
struct i2c_client *client = data->client;
if (client->irq)
enable_irq(client->irq);
return 0;
}
static SIMPLE_DEV_PM_OPS(lm90_pm_ops, lm90_suspend, lm90_resume);
static struct i2c_driver lm90_driver = { static struct i2c_driver lm90_driver = {
.class = I2C_CLASS_HWMON, .class = I2C_CLASS_HWMON,
.driver = { .driver = {
.name = "lm90", .name = "lm90",
.of_match_table = of_match_ptr(lm90_of_match), .of_match_table = of_match_ptr(lm90_of_match),
.pm = &lm90_pm_ops,
}, },
.probe_new = lm90_probe, .probe_new = lm90_probe,
.alert = lm90_alert, .alert = lm90_alert,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册