Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1473598pxb; Wed, 4 Nov 2020 09:50:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJy0fAxWVa1o0LDAKMT//3m16gGErxNgQvs3ioI6bk/1xSSCER6/NpO/28D7MiQc0Ipv+HBM X-Received: by 2002:a17:906:31cb:: with SMTP id f11mr25802344ejf.142.1604512226736; Wed, 04 Nov 2020 09:50:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604512226; cv=none; d=google.com; s=arc-20160816; b=wKeCYBzUhSNsSJFMHjc4LFYloIs4VaQsccGYgUn1nhXe6rnecj8+u3oC058W0jEvuM X7NODSWuvvkubanGzx6C1p4F0DZ38WfoH7l3S2QAz6qs3288mjBfu4xsAZD9b3EgP9ME l2xb13R0nMolxBNY8Wr/EQH4MvZjQP49T5nrD31yoAKI4BMp/9wLlJdmtxBAVsPrVE+D 7rBUYAWr68nyUFPRMUYW/0GxEQNgjIe3UCzGpH7g9o9S7npjKK0qnUxpe0M+tziq0K2I BysE1DpP+FI4/+q7Rkqfa0QXe7BjvY2UsIunqCbZFQcOXEBSSy8UNSysV8SGd1/7Ppqx J9Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=q2mfeuyukwDpEVK3US1O9VpyvYNLH3syNY4R2lZUiaY=; b=JnppbYox2GNL2Vnn2yoC1Q25bu6AOLvo2nzZbXfVgiFYoI7Lgb7cgaedh+HwGhI+Xg PoOgD+EcIGgyOdhgWuhr9HlNXlXrrG9VBkvB3xa4lgvpbOyLzlCoEBKPgyCDn+0q9271 fwayovF0waazW/Yq6ZuClZGezHuVkY6lzCzs60Jengn/413G+PKHA1WWc28FHuCsRVWT zz6/00xLVXFSnaXxoT1xL5cXeGHUQkS87gl3H5uwZXBUCKa+M8Onaorap6ZX5flL0bl9 YvS4e2xBr1hVbnYwrFqelh3jJnpxhHNDlmI0NrKWefo89b1m5NH2n8zDTajPyBoBMVRO L7zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=n8xjNZn7; 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 bs21si1721905ejb.566.2020.11.04.09.50.03; Wed, 04 Nov 2020 09:50:26 -0800 (PST) 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=n8xjNZn7; 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 S1730749AbgKDQXD (ORCPT + 99 others); Wed, 4 Nov 2020 11:23:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729676AbgKDQXD (ORCPT ); Wed, 4 Nov 2020 11:23:03 -0500 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCF3FC0613D3; Wed, 4 Nov 2020 08:23:02 -0800 (PST) Received: by mail-pg1-x542.google.com with SMTP id 62so9718084pgg.12; Wed, 04 Nov 2020 08:23:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=q2mfeuyukwDpEVK3US1O9VpyvYNLH3syNY4R2lZUiaY=; b=n8xjNZn7dT4jZr6ILNGCShucZI4BYYjZ7ixGnkM746zNyjQDv895NiZRZSLNr11cK8 i9b4CMcjgdxBAP4dCk4r3kfRiQzRfdVNrMyWIIDSDXbWoe94+j+3pZwkzgKO+E1kfGsm ZeswMpr6YaOziLfxbs9351PQOSn233vzIu5oF+GoaCM3KNU6xgGak32MaNfvo6HM0hsz A9lSVFG/+2wODFbyIXPQ+mwZ+oGQn7047jOVfWVZlSVTrMlevMqEgjUK9KNdC/91bHBF bE8fmxqKLyzy8BrkwRkpRCLa78uO0DyXQ3m4IaYdgokGSa6/nqXwdArMF5loC4K2FjCI CL3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=q2mfeuyukwDpEVK3US1O9VpyvYNLH3syNY4R2lZUiaY=; b=e0obxAVBIEok18YPaR/C4MMVMh4/sPYZpI5jOshZD+Ae71cq0F0nqEbCzo9QiEUWwf vu06kl9RiC6HRZgh+GEWpcrNdfUGHjdrM7CFOdKd4P3ogryPs0u4u2Kg3cZx1tzjxFsF NT3nETCKujO2/AGj6l3/9lleUnWVAbSrGhP3Tfi/sRjR+Lzn3wKsfR5+cCBE7Vg6Pmpz HnaZYoI5Ef0KHSF/Lro9rhFltLGSpEQpdidfVs/xGYIRaXyr8cx5vukyVCMK3BaFzVL+ OhoQugijlwpnhwk4LTQ0LsjEGnsbtX1mEDEOJL+94fkeud3wlxl9nK+RhXMWSzmVvKsa 8f+g== X-Gm-Message-State: AOAM532yy2XrDT43AfRlETEVcwoBS4koFOekjGEjromMiDxdj5nT/su8 kEW2lS/Ed8tKicFAnpDBR2v6d5SYFDU= X-Received: by 2002:a17:90a:a4c6:: with SMTP id l6mr5009451pjw.91.1604506982162; Wed, 04 Nov 2020 08:23:02 -0800 (PST) Received: from dtor-ws ([2620:15c:202:201:a6ae:11ff:fe11:fcc3]) by smtp.gmail.com with ESMTPSA id v126sm3031552pfb.137.2020.11.04.08.22.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 08:22:59 -0800 (PST) Date: Wed, 4 Nov 2020 08:22:57 -0800 From: Dmitry Torokhov To: Adam Ford Cc: linux-input@vger.kernel.org, Adam Ford-BE , Linux Kernel Mailing List Subject: Re: [PATCH] Input: ili210x: Enable suspend/resume functions Message-ID: <20201104162257.GB1003057@dtor-ws> References: <20200918143352.93135-1-aford173@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Adam, On Wed, Nov 04, 2020 at 10:15:47AM -0600, Adam Ford wrote: > On Fri, Sep 18, 2020 at 9:34 AM Adam Ford wrote: > > > > 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 > > Gentle ping. Any feedback on this? Ah, sorry. This should not be needed as for I2C devices that are configured as wakeup sources I2C core takes care of declaring interrupt line as wake IRQ and should configure it accordingly during the system state transitions. See drivers/i2c/i2c-core-base.c - calls to dev_pm_set_[dedicated_]wake_irq() in i2c_device_probe(). > > > > > 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 > > Thanks. -- Dmitry