From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF310C2BBCA for ; Fri, 21 Jun 2024 14:31:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To :Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TxWzOS2rlgnTib80uuvc9FbJTTdOcXThAdpc8WlZls8=; b=uwKjm7ZeeQmamfOkpY3c5iSBXY DHVAXKJ+TZXXAFJSVZUQHI7dTSELtd18WvqVT6bUBsLTaH3qjl67uOTcm8+KBA74OX7ZPwft6swjF s7LktRCzaP8AgL75dzWaWLKnLmgaD7Js54LOu+SaiUt5yDzyQLEFtZVNpdoqdXU4875e2V94UC8js ICKpj2daBVWUP2FpgV9+gs3Qr5yyTnGkajNraPtyX1e2NeMviVGiL/cu6hnGZKyXw4J+6PTqi7Hf8 o0VpN1Ap9+54+v5OEioi0tp6IdHarkwr+f0g3m6zBYnoiNsvq3DdVnTjz91VhGdwE3p6ff+M9owVt IoyytcLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKfIg-00000009W7Z-3lmU; Fri, 21 Jun 2024 14:31:38 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKfIc-00000009W5w-2lLv for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 14:31:36 +0000 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-364ff42999eso1545852f8f.3 for ; Fri, 21 Jun 2024 07:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718980292; x=1719585092; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TxWzOS2rlgnTib80uuvc9FbJTTdOcXThAdpc8WlZls8=; b=gbhQG4vI7PXAyExEzZwD8G+wkxYs15iWE+tX7VAEU8XRPbDhGbN6ZzA2K5ES1QsXnc 9YHiW3yf+U6sfvtQKgTKa1E/Ad9HEWcQgbg342RuR5lZ2uvjTheds60NHls19zkQhxQ/ 14Ha+z8O6+xcgs26U/r2/9CweVio74Q9P0pwGm4kfzDwanUuWCtqS5kq2UZJKex06Byx cd0YMMXvq6IYcaf/yZnFp+lbv5CRlALKun2yOQoOoqQ7i+iv5c/KjQ4P607KcBmP63yh KC8jD+3SmMXAKR/ysB+LSj1wSwwmOZf8xyDfLE6JmObDigVWbjczgKxVBz58bjaayV8M hpKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718980292; x=1719585092; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TxWzOS2rlgnTib80uuvc9FbJTTdOcXThAdpc8WlZls8=; b=aeI7z5/QmFH0X5mdvPGe+j0r7hdZiBAJwk38eFUepDhGrVPDi58uaccEL5ntCDuBDu /vxVAexvUXbG+OV14GABWPP15M/ykpCVIhXob7D23Bu/b9pmohRSdVlHu3Oksp/4lviH vpe7xUJORiNFi50Jd/HOi8INK0uq7N5tuIwfAzA67bXqKnv8VItTy6+2jIXcFfVZo2yw d8kTUl1F+KyuEwW6XtDUyVQGy+bEAthJYV7+j+LMF26jLVq3HpNzlF1Qm8pX4stYyqZc 11r88jwrGxa0/f/fERWgEgpRGy5FdjghCiFlfb6HnPkqGVVwkc3KgSWa0cuCUOJKGeDs pD5w== X-Forwarded-Encrypted: i=1; AJvYcCUuEzt3kfizLVhDpGmBhUN5cl1qzOfLnXVXC0ttMfBbvag7Uq0/Os9PeRqx4jGA+8MBsYtlKaHgmWbF1R+dOgdswEf8z8lYLl3K6m059FPT2jNy1RA= X-Gm-Message-State: AOJu0YxTTU21WzyukBNS1G184oZSlWqSXwANmZNckFEW1gKll4/8VF3c AliLTjGaaumnuAW2/Hvadn/8PTRWLedEKzeUhEUQOqO2NaByESBD X-Google-Smtp-Source: AGHT+IGb2Il+nEdX/84tcJeogeC2bwTGt+Ya62nxkHpXjgWZeTlpmlbCuGXS9elNN+BSnuxUuQ5Nkw== X-Received: by 2002:adf:f791:0:b0:360:79ae:dd26 with SMTP id ffacd0b85a97d-363170ed429mr7981784f8f.7.1718980292272; Fri, 21 Jun 2024 07:31:32 -0700 (PDT) Received: from eichest-laptop ([2a02:168:af72:0:b162:502a:9bd1:4c8b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-424817b4ad8sm30062715e9.21.2024.06.21.07.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 07:31:31 -0700 (PDT) Date: Fri, 21 Jun 2024 16:31:29 +0200 From: Stefan Eichenberger To: Dmitry Torokhov Subject: Re: [PATCH v4 4/4] Input: atmel_mxt_ts - add support for poweroff-sleep Message-ID: References: <20240417090527.15357-1-eichest@gmail.com> <20240417090527.15357-5-eichest@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_073134_728721_C6DF54AF X-CRM114-Status: GOOD ( 33.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, conor+dt@kernel.org, nick@shmanahar.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linus.walleij@linaro.org, linux-input@vger.kernel.org, alexandre.belloni@bootlin.com, Stefan Eichenberger , krzysztof.kozlowski+dt@linaro.org, claudiu.beznea@tuxon.dev, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Dimitry, On Wed, Jun 19, 2024 at 06:12:45PM -0700, Dmitry Torokhov wrote: > Hi Stefan, > > On Wed, Apr 17, 2024 at 11:05:27AM +0200, Stefan Eichenberger wrote: > > From: Stefan Eichenberger > > > > Add support for poweroff-sleep to the Atmel maXTouch driver. This allows > > us to power off the input device entirely and only power it on when it > > is opened. This will also automatically power it off when we suspend the > > system. > > > > Signed-off-by: Stefan Eichenberger > > --- > > drivers/input/touchscreen/atmel_mxt_ts.c | 71 +++++++++++++++++++----- > > 1 file changed, 57 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c > > index 7c807d1f1f9b..f92808be3f5b 100644 > > --- a/drivers/input/touchscreen/atmel_mxt_ts.c > > +++ b/drivers/input/touchscreen/atmel_mxt_ts.c > > @@ -317,6 +317,7 @@ struct mxt_data { > > struct gpio_desc *reset_gpio; > > struct gpio_desc *wake_gpio; > > bool use_retrigen_workaround; > > + bool poweroff_sleep; > > Why is this separate from "enum mxt_suspend_mode suspend_mode"? Can we > make MXT_SUSPEND_POWEROFF and use it in mxt_start() and others? It still > can be driven by the "atmel,poweroff-sleep" device property. I agree and will change this in the next version. > > > > /* Cached parameters from object table */ > > u16 T5_address; > > @@ -2277,6 +2278,19 @@ static void mxt_config_cb(const struct firmware *cfg, void *ctx) > > release_firmware(cfg); > > } > > > > +static int mxt_initialize_after_resume(struct mxt_data *data) > > +{ > > + const struct firmware *fw; > > + > > + mxt_acquire_irq(data); > > + > > + firmware_request_nowarn(&fw, MXT_CFG_NAME, &data->client->dev); > > + > > + mxt_config_cb(fw, data); > > Is this really required? As far as I know all maXTouch controllers have > NVRAM for their configs and should not lose configuration even if power > is cut off. In fact, the whole automatic request of firmware/config upon > probe I think was a mistake and I would like to get rid of it. In fact, > on Chrome OS the version of the driver in use does not do that and > instead relies on userspace to check if firmware update is needed. > > If this is actually required you need to add error handling. You are right, and the configuration goes to non-volatile memory, so this is not needed. I will remove the firmware loading here and improve the error handling. I will keep the firmware loading in the initial probe for now, to be consistent with the non poweroff-sleep version. Regards, Stefan