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 E0F4AC2BA1A for ; Thu, 20 Jun 2024 01:13:05 +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=UtvZzPbiVDm2fGC/hNhp/8eLXltMc47O/VCFEAdXX3g=; b=2UOnKw777c8nRrpkK0yu2E2ISH YCg7FfS/LxKE7HzB6XByimSq7huZlnYFWsaAxB97usze6Z8FBZCHefq73q116TlHPKYhCQa8dGyK2 B3uaA4tRVEtTObTCzBzZyM0cdbi82qdNzP4VKMZfkDlZgrdl57UaRXsyRirelgOi7tqQMGJns5zUi 4Jplqge8Dbo1LikMZsVZdixDNTs5uhHbWiw711Q1u+BVeGbpzB/blVsgOMY5BTp6gTpveHMLfciH7 e5dHb9xeITH+v7eNHBSgjh/lRucjJ+GzaOMYWKWkmSfg9Wg0a8h+tz8teXiCtdfSmMQSNKuDCmWog wCZWwqww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sK6MA-00000003Dtt-2r3o; Thu, 20 Jun 2024 01:12:54 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sK6M5-00000003DtE-49OM for linux-arm-kernel@lists.infradead.org; Thu, 20 Jun 2024 01:12:53 +0000 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-6e4dbca52f0so285322a12.0 for ; Wed, 19 Jun 2024 18:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718845969; x=1719450769; 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=UtvZzPbiVDm2fGC/hNhp/8eLXltMc47O/VCFEAdXX3g=; b=M2+vPwaVEj1/zGqkMStq31/PHuM2n6yU63Ee8BknG+L8Eeu88u0M60m9Wa5iOE4x8G vgmn9ib9Yf/USd0w+5D+wJZoultc9W64KwIDko41qOy8qqE6yJWtwfO7bylxlhaY28Kf o7rIeh49EAaNAzgswc8eTSYGw7a0ODYwnU0dnTQIXKjU5Ey6kz7iZ3FiQRniKtyel/Wf uhGeXIiZRavQ7HRBIm1OIxMrhiW5LQun65kGFsTDkYpXHvNTw+PZ8hEzP8uPGGFPG/ue sKfqavnnflLYfr5hLQMSGQBTQwpiIeTF56TKTn5Fzdc0WuMog7bCr1RRI4bDIZ4R2Dpd So6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718845969; x=1719450769; 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=UtvZzPbiVDm2fGC/hNhp/8eLXltMc47O/VCFEAdXX3g=; b=SlacFV2tVDVTMRi6AvPozSidCkcCTleMSSKLBV0T4LE6L3qfEk5etGMaYaPYd3Yb10 149sdt4ASqVx0JfdBMT8vzKTW8yX5W9BbDHvq1FaAapYqAwesC87X/hRdGKdmAOnKP7N nznyn3zAjhKvBZIKwyXC3eTbARRCp3Wk6yTbOzZJyVWkEVyQCpxHiysABFfeCfD92Ur2 zxyYQZOS6GW7ts3ws4TPFpmC/3WziKDfxOGWT/J07wMf34/sHpoA46ubQJ4TwSo6G7ua XuRXFDxmrjIsGsyX+Hh26NV71WC9uEP11xRUglhK8c1IxAdErSvPCwQGNcHqhHQZPWch cDxw== X-Forwarded-Encrypted: i=1; AJvYcCXB5ew0L5Zqt2xF1ztXcbkwoa8vMGyAn7Z7GFWCG7DobxVmwjzFGl3SDjxm+P62h7/zIqDsdphkZg8zngwIZJ4FIxYFenctsV3LgaE8eGLPg5vUMi0= X-Gm-Message-State: AOJu0YyPvLmnRn1j/QQchx8nLFsCOl8Le7UneC6F5albmtBDtWn1jr5i p8pkrtZ0v97nL6BamOj7nZ25iUQCbb42wYP2XgB27etNcBahngm5 X-Google-Smtp-Source: AGHT+IEcLf7lv1yrtj40upN5wlspygK1BImuzVSjfItDZZ1Ahzzekk8L9Ndysr+GKBxGEvT0LQS66w== X-Received: by 2002:a17:90a:cf02:b0:2c7:b045:254a with SMTP id 98e67ed59e1d1-2c7b5daeac7mr3566594a91.46.1718845968950; Wed, 19 Jun 2024 18:12:48 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:36d9:2b1f:59f:8e9e]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c7e4ffe7b0sm340390a91.3.2024.06.19.18.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 18:12:48 -0700 (PDT) Date: Wed, 19 Jun 2024 18:12:45 -0700 From: Dmitry Torokhov To: Stefan Eichenberger 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: <20240417090527.15357-5-eichest@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_181250_156520_585AD07C X-CRM114-Status: GOOD ( 26.26 ) 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 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. > > /* 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. Thanks. -- Dmitry