summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Bouyack <mbouyack@google.com>2021-06-28 09:53:02 -0700
committerAndrew Evans <andrewevans@google.com>2022-03-09 15:04:45 -0800
commit1975f2209f933d8c70b9c600203ed21ff9ab31f8 (patch)
tree43ceeb165c5e004171b9957fc2c74bcb9e71d75e
parentec466ab77931f3c9092a0f41aaf81d239495b8ec (diff)
downloadrotary-encoders-1975f2209f933d8c70b9c600203ed21ff9ab31f8.tar.gz
Disable PM ops on RSB
pat9126_suspend calls flush_scheduled_work which is suspected to cause deadlocks. Since we want to wake on RSB events anyway we can safely disable power management operations. Signed-off-by: Matthew Bouyack <mbouyack@google.com> Bug: 189872758 Change-Id: Ia82c383185ce7135808f632d7a6309c8388908bc
-rw-r--r--ots_pat9126/pat9126.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ots_pat9126/pat9126.c b/ots_pat9126/pat9126.c
index 0c20b2f..d967063 100644
--- a/ots_pat9126/pat9126.c
+++ b/ots_pat9126/pat9126.c
@@ -25,6 +25,10 @@
#include <linux/rtc.h>
#include <linux/string.h>
+// TODO(b/192250990): Do not re-enable PM ops before removing the call to
+// 'flush_scheduled_work' from pat9126_suspend.
+//#define PAT9126_PM_OPS
+
struct pixart_pat9126_data {
struct i2c_client *client;
struct input_dev *input;
@@ -62,9 +66,11 @@ struct rw_reg_info {
struct rw_reg_info pat9126_reg_info;
+#if defined(PAT9126_PM_OPS)
/* Declaration of suspend and resume functions */
static int pat9126_suspend(struct device *dev);
static int pat9126_resume(struct device *dev);
+#endif
static int pat9126_write(struct i2c_client *client, u8 addr, u8 data)
{
@@ -765,6 +771,7 @@ static int pat9126_i2c_remove(struct i2c_client *client)
return 0;
}
+#if defined(PAT9126_PM_OPS)
static int pat9126_suspend(struct device *dev)
{
struct pixart_pat9126_data *data =
@@ -805,6 +812,7 @@ static int pat9126_resume(struct device *dev)
return 0;
}
+#endif
static const struct i2c_device_id pat9126_device_id[] = {
{PAT9126_DEV_NAME, 0},
@@ -812,10 +820,12 @@ static const struct i2c_device_id pat9126_device_id[] = {
};
MODULE_DEVICE_TABLE(i2c, pat9126_device_id);
+#if defined(PAT9126_PM_OPS)
static const struct dev_pm_ops pat9126_pm_ops = {
.suspend = pat9126_suspend,
.resume = pat9126_resume
};
+#endif
static const struct of_device_id pixart_pat9126_match_table[] = {
{ .compatible = "pixart,pat9126",},
@@ -826,7 +836,9 @@ static struct i2c_driver pat9126_i2c_driver = {
.driver = {
.name = PAT9126_DEV_NAME,
.owner = THIS_MODULE,
+#if defined(PAT9126_PM_OPS)
.pm = &pat9126_pm_ops,
+#endif
.of_match_table = pixart_pat9126_match_table,
},
.probe = pat9126_i2c_probe,