From patchwork Sun Feb 10 10:13:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolai Kondrashov X-Patchwork-Id: 10804671 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9CEFD1515 for ; Sun, 10 Feb 2019 10:14:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F15229F45 for ; Sun, 10 Feb 2019 10:14:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 832F529F4A; Sun, 10 Feb 2019 10:14:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 340E229F45 for ; Sun, 10 Feb 2019 10:14:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726032AbfBJKOw (ORCPT ); Sun, 10 Feb 2019 05:14:52 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:42534 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfBJKOw (ORCPT ); Sun, 10 Feb 2019 05:14:52 -0500 Received: by mail-lj1-f194.google.com with SMTP id l15-v6so6415519lja.9 for ; Sun, 10 Feb 2019 02:14:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a+kuhlBS86h7JEOuYVa3VyqA3/+1D3JagKaOwfiO3ao=; b=LA7P5L6MV0lreDTqKVs45hWbjhkTeTRY6lg6sVSMcmASTReYKXna1YdUDkfN4+G0Xk cRMRG9G5Aoy4ob38e5d8ADLDR7Gjof273P9I8DoxNlqQsQGtwjAv19FsaD4ud/PfTTMJ Lp/gMS3p+QjQ2nO6y9aQ6zFiemVpZ6zEm7rYKTYk/VXV19BwS6vLc5uqi+kERHIwy4Au FLgM3gyNn7wTdWnWEWDd/Ef891FCmZIvL/NmzJuKkBhibvDfbjqAH1o5XYnj5p9crpki DtybeF/mmG9NBsJ0/HYbDre1Sv3IwcN8q8NYqC9w/rqf87zp9IS5hkKPM/DWEharhsrj Me1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a+kuhlBS86h7JEOuYVa3VyqA3/+1D3JagKaOwfiO3ao=; b=BsO0qq02IMcOnuAyXmPCLWRGsrTbQzfIw7C/JBntzgjmkUtAIxG1qstYPD5MHxSYpP 05n9eHiKXW+iuTeEi/jsDvHHeZCck2Ra6ZnC+Jn0ye24pEYrNmU0f3wkl4VuskmxTBWJ bgKCsd5moVR2co1Our3oo81YDHVihTEY0ILiMJgllI4hcc0JKw/2TNEh8wJFyyvDAPtf CsFfu9kjeGv/DWoj9ybSjSSQKRaV9oKr3neRGdQlM/eJ50wyCF33wCWMnYTeiZaF1sHf nunXTwXml5a6zbJyna8IVerN9MnzF4G3qJMy5PyollTuXx+6UN6dvWsf4bQ/0cIVYUN7 w1HA== X-Gm-Message-State: AHQUAuZAYOBxoqJaVCrNEjUJFM9/TSq8uCBD1XOOFKvdm04CoLK+SEuT iGnLbgZ55wj6Z6p93qZAaGg= X-Google-Smtp-Source: AHgI3IaCJ3iwT06AOQW9GomV7xdKtZ4Qf8hJatJB8Q4+pzeiXKH3MZdvUa1pa3Lkl+IUD4QOWVI4Hg== X-Received: by 2002:a2e:9849:: with SMTP id e9-v6mr9735648ljj.9.1549793690489; Sun, 10 Feb 2019 02:14:50 -0800 (PST) Received: from bard.ponomarevs.fi (88-112-122-53.elisa-laajakaista.fi. [88.112.122.53]) by smtp.gmail.com with ESMTPSA id l21-v6sm1472010ljj.48.2019.02.10.02.14.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 02:14:49 -0800 (PST) From: Nikolai Kondrashov To: Benjamin Tissoires Cc: Jiri Kosina , linux-input@vger.kernel.org, Nikolai Kondrashov Subject: [PATCH v2 06/23] HID: uclogic: Re-initialize tablets on resume Date: Sun, 10 Feb 2019 12:13:52 +0200 Message-Id: <20190210101409.3511-7-spbnick@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190210101409.3511-1-spbnick@gmail.com> References: <20181227171625.11164-1-spbnick@gmail.com> <20190210101409.3511-1-spbnick@gmail.com> MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/hid/hid-uclogic-core.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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 @@ static int uclogic_probe(struct hid_device *hdev, 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(¶ms, hdev); + if (rc != 0) + hid_err(hdev, "failed to re-initialize the device\n"); + else + uclogic_params_cleanup(¶ms); + + 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);