summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorNikolai Kondrashov <spbnick@gmail.com>2019-02-10 12:13:52 +0200
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-02-21 12:00:53 +0100
commit251b427566e2cf6ec87dd479e2d3062fdbd41732 (patch)
tree84a7e8ee19a409e168a6cced2f33eeb92ef73f6c /drivers/hid
parent9614219e9310ef19e66719bf37f9f68919bac08e (diff)
HID: uclogic: Re-initialize tablets on resume
Re-initialize UC-Logic tablets on resume. UC-Logic tablet initialization and parameter retrieval cannot be separated for the large part, so simply discard the retrieved parameters after initialization. Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-uclogic-core.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c
index 72a3a43766cc..8f8e445d77aa 100644
--- a/drivers/hid/hid-uclogic-core.c
+++ b/drivers/hid/hid-uclogic-core.c
@@ -178,6 +178,23 @@ failure:
return rc;
}
+#ifdef CONFIG_PM
+static int uclogic_resume(struct hid_device *hdev)
+{
+ int rc;
+ struct uclogic_params params;
+
+ /* Re-initialize the device, but discard parameters */
+ rc = uclogic_params_init(&params, hdev);
+ if (rc != 0)
+ hid_err(hdev, "failed to re-initialize the device\n");
+ else
+ uclogic_params_cleanup(&params);
+
+ return rc;
+}
+#endif
+
static int uclogic_raw_event(struct hid_device *hdev,
struct hid_report *report,
u8 *data, int size)
@@ -261,6 +278,10 @@ static struct hid_driver uclogic_driver = {
.raw_event = uclogic_raw_event,
.input_mapping = uclogic_input_mapping,
.input_configured = uclogic_input_configured,
+#ifdef CONFIG_PM
+ .resume = uclogic_resume,
+ .reset_resume = uclogic_resume,
+#endif
};
module_hid_driver(uclogic_driver);