Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1245103pxk; Fri, 18 Sep 2020 07:35:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbc09DG81YND7aMyNbGxIIrzZOJus/wsqyYO1NGjD7a7EFOzTyi4N4qyuCjJ+zQP+hSL4v X-Received: by 2002:a17:906:cf9b:: with SMTP id um27mr36460424ejb.66.1600439740508; Fri, 18 Sep 2020 07:35:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600439740; cv=none; d=google.com; s=arc-20160816; b=Z9h0oQ1hTSH3hDJdXwXPpLU1ErVhvmnqFrkSLpepSJUIUTjNp/u+k3RBP2vx8WzXet udiQo8tFUzjSeiyJzZueFnSWLGe9NaXpwgyUAX/UbT9eZ+At3t/sXOR9RENv8OflmfFl C6kT6ruKSPLWuo5L+LJ3KV/uYnQUDQMs5ggUudIUHhcUCiCPlnKZT96U2Cvk42cA6sjG paogF9l315vz+XVKAKu5bKUdS1guNaAXBaKvOGgT15frDsu2qyiA2/2ULNjZCneUaJ5S VAJSTAEkihayfvqtlidzsl2+NUaRoL7li2Nxlf3Ywn5cKhywIgNc/DaC8HtUnPkxu6UV CCVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sKMONdieCxgxCroaWyWNO0AqXSg8A8t7H/Pr77coN9c=; b=ChsznuJdOHiN8k4r/NKt7x326OrMuK1faeAU/II9tIXgP8Fl5jkN1HT+i4JEH18oBv R+c8zydY/26Jbi4ebwkHPoNCETfcFMIPQ34pTnyNxaR2BGJbDPFsRUfmczYtI7fqc7Dn ybe+Ml71Ls+cFZX70qMJmyD/YCmvqIZ4jEYWKoggAfU4gDQuyfPpoKpmUyeYAaM1JZqR WKsKn1LZXofAMHptRXWpKHK6rjI+aVX0LOIP6fCtqYfE5VcVtEi/zZRb9iL/0aWyzSMV flAw5tuciFhxL2kRIN72QaXvVhGXYPY9fVr+fG8nvkj0LT3NR9Reu0ygqJAhPy10vDVd 8CNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RiziH461; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si2337003ejy.634.2020.09.18.07.35.16; Fri, 18 Sep 2020 07:35:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RiziH461; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726746AbgIROeD (ORCPT + 99 others); Fri, 18 Sep 2020 10:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726126AbgIROeD (ORCPT ); Fri, 18 Sep 2020 10:34:03 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D013AC0613CE; Fri, 18 Sep 2020 07:34:02 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id a8so6450004ilk.1; Fri, 18 Sep 2020 07:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=sKMONdieCxgxCroaWyWNO0AqXSg8A8t7H/Pr77coN9c=; b=RiziH461xgq1/ogIkGyo/fb1MNBKdYf+l0MPBLrBKnwFoPrvSSgFs4rhma6yuofTWn N92UQgMYQCxQz8JJ6SrfXX4ixkksbun724CUmGq4DK3MSGdEDAQ78moUi7WNCPo6woH9 OH5IrCRQ5BacTxD+BXXCWmjI5FWCRRpnnf3SK93w3p+h4J2nE1bu8ST8UWaifdWYbElP wQZUe5PMgee5GALdq8u+y/msfizcIZ84u3DWvR9xEIpZGL1LKOZRCIKR4Zo6GAACs4KQ KOyRF+xB2Y0LeQKZKiTucaSRd9yj23IoqMCbGF9VP7ZYIxL7ZSLGWAzZdgCEoHA7wBw+ /3KA== 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:mime-version :content-transfer-encoding; bh=sKMONdieCxgxCroaWyWNO0AqXSg8A8t7H/Pr77coN9c=; b=OLZFplgFyiUc7RV62NN3pntJDr6ajJvJ0r44zb0pJ4X0UeA8Ymz7WDZMSsQW735eOl Z2dnESCElEV270z81x2z1Un8AMwHF7h1GKsfq0VctIM+ANyGd9/7N2hOeaEXv2Llk3KS CRxOfIHrA9FslCuuh7cTO5B5Bwk3HgGRAqvWgUJF4K2O3C7CBUcmXAKY53Q8/LPqPjur Q/CWoMywSN5BpPo+OvZiDf8KPzEmcP/p/tPr4v3qBUceQGVW8xO93kU4HEDhzBcPQvb7 Maj9pp9dhkHPCRDd+6bP3H0ygB4WUzgj/jyj5DktW38KgvhRPyPskggV6Ls2sIF6/7iz tbAw== X-Gm-Message-State: AOAM530XGyU8HLieogdgZK92o3XZ6/TjKmDGjmsD+t24djdd/3o+D0Lb w1JIv6s+3/qSImMeJqMjy3Lme7rRkKE= X-Received: by 2002:a92:6b0b:: with SMTP id g11mr26085925ilc.62.1600439641735; Fri, 18 Sep 2020 07:34:01 -0700 (PDT) Received: from aford-OptiPlex-7050.logicpd.com ([174.46.170.158]) by smtp.gmail.com with ESMTPSA id s2sm1744657ili.49.2020.09.18.07.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2020 07:34:01 -0700 (PDT) From: Adam Ford To: linux-input@vger.kernel.org Cc: aford@beaconembedded.com, Adam Ford , Dmitry Torokhov , linux-kernel@vger.kernel.org Subject: [PATCH] Input: ili210x: Enable suspend/resume functions Date: Fri, 18 Sep 2020 09:33:52 -0500 Message-Id: <20200918143352.93135-1-aford173@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some people may wish to wake their system from sleep, so this patch enables a suspend and resume function which enables and disables IRQ wake functions. Signed-off-by: Adam Ford diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c index 199cf3daec10..9b1a61447054 100644 --- a/drivers/input/touchscreen/ili210x.c +++ b/drivers/input/touchscreen/ili210x.c @@ -474,6 +474,28 @@ static int ili210x_i2c_probe(struct i2c_client *client, return 0; } +static int __maybe_unused ili210x_i2c_suspend(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + + if (device_may_wakeup(&client->dev)) + enable_irq_wake(client->irq); + + return 0; +} + +static int __maybe_unused ili210x_i2c_resume(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + + if (device_may_wakeup(&client->dev)) + disable_irq_wake(client->irq); + + return 0; +} + +static SIMPLE_DEV_PM_OPS(ili210x_i2c_pm, ili210x_i2c_suspend, ili210x_i2c_resume); + static const struct i2c_device_id ili210x_i2c_id[] = { { "ili210x", (long)&ili210x_chip }, { "ili2117", (long)&ili211x_chip }, @@ -495,6 +517,7 @@ MODULE_DEVICE_TABLE(of, ili210x_dt_ids); static struct i2c_driver ili210x_ts_driver = { .driver = { .name = "ili210x_i2c", + .pm = &ili210x_i2c_pm, .of_match_table = ili210x_dt_ids, }, .id_table = ili210x_i2c_id, -- 2.25.1