summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/ipaq-micro-ts.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/ipaq-micro-ts.c')
-rw-r--r--drivers/input/touchscreen/ipaq-micro-ts.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/input/touchscreen/ipaq-micro-ts.c b/drivers/input/touchscreen/ipaq-micro-ts.c
index 33c134820ef9..94720c41c9be 100644
--- a/drivers/input/touchscreen/ipaq-micro-ts.c
+++ b/drivers/input/touchscreen/ipaq-micro-ts.c
@@ -1,13 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
*
* h3600 atmel micro companion support, touchscreen subdevice
* Author : Alessandro Gardich <gremlin@gremlin.it>
* Author : Dmitry Artamonow <mad_soft@inbox.ru>
* Author : Linus Walleij <linus.walleij@linaro.org>
- *
*/
#include <asm/byteorder.h>
@@ -122,7 +119,7 @@ static int micro_ts_probe(struct platform_device *pdev)
return 0;
}
-static int __maybe_unused micro_ts_suspend(struct device *dev)
+static int micro_ts_suspend(struct device *dev)
{
struct touchscreen_data *ts = dev_get_drvdata(dev);
@@ -131,14 +128,14 @@ static int __maybe_unused micro_ts_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused micro_ts_resume(struct device *dev)
+static int micro_ts_resume(struct device *dev)
{
struct touchscreen_data *ts = dev_get_drvdata(dev);
struct input_dev *input = ts->input;
mutex_lock(&input->mutex);
- if (input->users)
+ if (input_device_enabled(input))
micro_ts_toggle_receive(ts, true);
mutex_unlock(&input->mutex);
@@ -146,14 +143,13 @@ static int __maybe_unused micro_ts_resume(struct device *dev)
return 0;
}
-static const struct dev_pm_ops micro_ts_dev_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(micro_ts_suspend, micro_ts_resume)
-};
+static DEFINE_SIMPLE_DEV_PM_OPS(micro_ts_dev_pm_ops,
+ micro_ts_suspend, micro_ts_resume);
static struct platform_driver micro_ts_device_driver = {
.driver = {
.name = "ipaq-micro-ts",
- .pm = &micro_ts_dev_pm_ops,
+ .pm = pm_sleep_ptr(&micro_ts_dev_pm_ops),
},
.probe = micro_ts_probe,
};