From patchwork Fri Feb 9 10:50:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Eichenberger X-Patchwork-Id: 198817 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp772887dyd; Fri, 9 Feb 2024 03:06:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IH43MxlU8Vrqy6esNq4BMAMpnkDE6EwEwMeX9DN5a6vmSCPyTLY6vl/f1/4MFSiEPHdNB4V X-Received: by 2002:a17:902:d4cd:b0:1d9:1cb5:558b with SMTP id o13-20020a170902d4cd00b001d91cb5558bmr1290477plg.15.1707476781101; Fri, 09 Feb 2024 03:06:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707476781; cv=pass; d=google.com; s=arc-20160816; b=U5i3HeLbL4et9eIV2PiUvBS2JfcemA+kGAj//bWcstqHnzoE4UGMqFyyDibOSKzBx/ RxfN68B2QU4Grw2eMIGpWwbageN5tOmaOWo14YvlVVcaOZlC99X7Gq0Yqz67c8+KZ3K7 lNgEWBQgrl8cXY9Mqz1D/yBBZoE6bK1905qDfFlGsSlvwbgtK7YPB7r/J/L2+tasMFU1 H4ikavueOEKARjvUtBjj58QNeH+eThQzvAFWUxld6vNOPKVntiBATVLpqvQZtKUUC/xg Yh6xU0wdH2L6LA8FDjWla8cHL6x+IS4V5F689v1oU1RE/L5fyHe1TUd7Tl2OhfTGJm3P a5NQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=SZwRK1DevWHs7TSy/8l1VCGmE7RT9MSmuvvOPNO04ZE=; fh=++urSfMgL5tSl4/t9m5c/P+p0GGmnAEdWy8KoEIhwjs=; b=LO7PZcMwezZR3RmWBoHIvtSqYwTJK87QTEHdsEzTFIBnG55Glz6V7/l0CNXnjYXhrX r4w/DtU4X2PwWXfvTYcfaL0JtXFHkqIlxJ773eP8JXdAseuh2MOyn/XUHiUc2R56mWkR 3Ijt3McOf7ngnmQ8vqM8f1Oi1qRReHESA8xjUwwhuSl40ZfxMYJ1IRlQmSQ6lmOcxB6y rgq6rqHUQEJvCXllMl58bNPV/fxpoIfJwHVckJxljOQk0fxp9bwN9VGGcbRU1oeeKv9t FP44w8c7IB8GmukzBoCldz3rYVunsu5fuurkXu+878DIFT3tRhzYBfG/xycmCaWtcrpE UMTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eyYiqGwI; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-59246-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59246-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCXc0gRghlYfbvk7QlOmuSkstJysW2qRuDf7pQkad56O5ltXf9CLULFC/6ANA49ZDRLlfXc6i4nUWA+mns6mZFDQyU8ZkQ== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n18-20020a170903111200b001d7204a84ccsi1470907plh.156.2024.02.09.03.06.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 03:06:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59246-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eyYiqGwI; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-59246-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59246-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 510EBB24515 for ; Fri, 9 Feb 2024 10:51:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 772B8328B1; Fri, 9 Feb 2024 10:50:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eyYiqGwI" Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C62128E0F; Fri, 9 Feb 2024 10:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707475820; cv=none; b=HdL+endDNxXo6Qv2EtPAQ6OnUvgbcvspqwr5wAEii1rGNNSMDii9V1kxSLCgjd5Uo4mb6+2XBaYA28dhpSIO4fZxe6wYgDAvNzlrJvpJzZGN5qU1+5uyeSr3kXwTUlzWEXN9NS0lkygkLvZ2BeyGig/csGytRUvHfJyDqPZQzmk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707475820; c=relaxed/simple; bh=t0Yp1kY6qtM37V8D5tGl8e+xZzRSxjruApL0YIVR4Cs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=NTuaRw8CQaFCuF6FwpOzKa4780R13qFN8vxxV4/fTgj42pJ4DyFPfdXDCbFC/xGZVRjVBzEqlxm1ZWGmRJRd3FBWH9HqYa22SYJFuvDr2gijyDdGZen80zd0+5Wr4hmqbhYnPrZFFbxrf1yJGakaK6aRLNDBNdjA4Xx5esXx7Tc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eyYiqGwI; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4101eb5a115so7122995e9.1; Fri, 09 Feb 2024 02:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707475817; x=1708080617; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SZwRK1DevWHs7TSy/8l1VCGmE7RT9MSmuvvOPNO04ZE=; b=eyYiqGwI5cmqFg9fzF037ul0/+W/YghJJCgHldBH5KJG87wrLZFxkeydt8dgplmy62 mkFHpOOoi6u7zKpmHdC9PLpcRihX7xn5EtGNwGZDG4l9SbfaRXIxqGMVCkuuCqP/9s9h E+vQP5QQ7IGp0Hqe6OUcHtqpgcBu7CEFmTl5ixAvPaprRQI07tfLZS6ffBVxL1mWdZL5 TOgdgvp88m9w8ytQoDW3BHENxc7t0F1BPPn3RdmxHHE3zvV94Y3DhVaREoxrQJzw5fsH QTFB25F1XFtW/YM8oDAd7QmjL93Bfx5AzKjl0bwJ27HItJr9zrkuwn6g/lmxWj35eEl9 gwAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707475817; x=1708080617; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SZwRK1DevWHs7TSy/8l1VCGmE7RT9MSmuvvOPNO04ZE=; b=fVdozm/iYMENsbW5sAjjgl1aImPrxYPMFcwQGoDCxPDqU0DUK3rry8OzlboGmWb4GP GoXg005OAVp46WTcvhVORE4pfWbLXY2+uwSchWEf3Zrz9GCHyOiDuKVbBQoqvGbNCy/8 uMUaaVNYdChcSY1E9K3hvw4T59xNskr8cHU33bwpt23toupFQLYgOUcVFMRKej545f8p zd0omOJotSKeJ68zy3LcFqkFGVFlD63sYvKg/JJxkvzB6czFsol+YKQxKadFhkyCUn0C RHST3pJPYCh0zrnvKzWW206phIisXuZEaRaXhAuX6BxMAa2kKdDO1iwMKLvU8qNF/oZ2 Z1Wg== X-Gm-Message-State: AOJu0Yynjg6XdBpNGzJxCrsBBKSmPzksoIgd/mF+mxIaLoGIlSBseIcw tBZ1rpyK9PIyqckr+eowwQ1UpfzL+Odre5j0vLkKpwtzNYY7a32X X-Received: by 2002:a05:600c:3596:b0:410:6506:68c2 with SMTP id p22-20020a05600c359600b00410650668c2mr760796wmq.14.1707475817104; Fri, 09 Feb 2024 02:50:17 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWTJFCYzflemGUHHiGpmSJ3L4fd/0g+ziBN0wzI9pf89I5j691ofb14mCig7J21SNfrnQ2SfNXEl/990+T7tDJ5KLytUAnv2fCQ0xz8y5Gedr8A6PP6WAQmM/o7OpnJ88gYCHFIHmkaVR8tKkt0obhRtOP1bKAdv0H0NYFBcZFX7zvrMsNsj86M8o6Ong7PcG61ULuJg5Fr4OBromd71W0ZpOPn4LIwDdxYwxaAxH1FLhhFO6Jz2KX810tnLulakx3XRdtmB41q1D7aQYnKPHPguIXTubp5LL1B5Qavf4U80mEBUslVxB1BBo22DcDh6UMI7wzeAi3nXl0pIrjiiLx9reUZat/IIHJtkctFSu2XS1HYVYFSBC488bgoS6H0EmnkTGSg9HB6FcCQJUcPwmux5O2eV6zNtO7Y+hv/8dGc+YEpFEA2f3Fty/BNvtfPDkrHfsoyE7LOBhM4I2VOBhrPOGB3awEhX/2rsmEz6HpK8xetYluvjEgydRw4YrIQwhhJWu7nm4Xn7Sqm/Z3c41Alh3uu9odVm1HbXgNo+o1vP1ViVzIImFwAE3+IZTEm4FRMvG6PezfnspnE1UcQisrLnd5wyYI= Received: from eichest-laptop.toradex.int ([2a02:168:af72:0:765:2268:762e:2748]) by smtp.gmail.com with ESMTPSA id t18-20020a05600c199200b0040fc26183e8sm253627wmq.8.2024.02.09.02.50.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 02:50:16 -0800 (PST) From: Stefan Eichenberger To: nick@shmanahar.org, dmitry.torokhov@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev, linus.walleij@linaro.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, francesco.dolcini@toradex.com, Stefan Eichenberger , Krzysztof Kozlowski Subject: [PATCH RESEND v3 1/2] dt-bindings: input: atmel,maxtouch: add poweroff-sleep property Date: Fri, 9 Feb 2024 11:50:11 +0100 Message-Id: <20240209105012.22470-2-eichest@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240209105012.22470-1-eichest@gmail.com> References: <20240209105012.22470-1-eichest@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790419173328866819 X-GMAIL-MSGID: 1790419173328866819 From: Stefan Eichenberger Add a new property to indicate that the device should power off rather than use deep sleep. Deep sleep is a feature of the controller that expects the controller to remain powered in suspend. However, if a display shares its regulator with the touch controller, we may want to do a power off so that the display and touch controller do not use any power. Signed-off-by: Stefan Eichenberger Reviewed-by: Linus Walleij Reviewed-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/input/atmel,maxtouch.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/input/atmel,maxtouch.yaml b/Documentation/devicetree/bindings/input/atmel,maxtouch.yaml index c40799355ed7..8de5f539b30e 100644 --- a/Documentation/devicetree/bindings/input/atmel,maxtouch.yaml +++ b/Documentation/devicetree/bindings/input/atmel,maxtouch.yaml @@ -87,6 +87,12 @@ properties: - 2 # ATMEL_MXT_WAKEUP_GPIO default: 0 + atmel,poweroff-sleep: + description: | + Instead of using the deep sleep feature of the maXTouch controller, + poweroff the regulators. + type: boolean + wakeup-source: type: boolean From patchwork Fri Feb 9 10:50:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Eichenberger X-Patchwork-Id: 198816 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp765676dyd; Fri, 9 Feb 2024 02:51:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXBT4HdNQfomFfOqs4kZkTKK0RlBm4AffdD/RydgFa0kb21ILAb6ZMm+ZKcpYiAPGdDG6g X-Received: by 2002:a17:903:2b08:b0:1d9:ec19:2c95 with SMTP id mc8-20020a1709032b0800b001d9ec192c95mr1387623plb.58.1707475907658; Fri, 09 Feb 2024 02:51:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707475907; cv=pass; d=google.com; s=arc-20160816; b=rwZsF1P0Cpu8o48saq3OmBuAKDZZArEv3rqgmkWFnfPnBbNVz0dNF5bdsEfy1tYqXp /gqO3nCoCXaqWENo0jB7JfpSoLDwqAiJkS+AiI5vXYAqd61qAeLhEgcrTTkm/O5zBv1x Lr221vMVzIohIQmbE4HDl65Jlx5ulqSSy6sKnZVt6G6B7QofDfLT0DRsImyCI4wqFWDJ nfTPDE7CeYJDABasNBb7+D1BwCvbEaN0sllQNOZymHCImDgePpoz6mSY9DON5zGoe53A pw9Uol9/+dyhulp8kASm9BQ97U+kg1IQEb5bRa7AAWYtKiGquBRzlhFXGiFyJ1uXYPoC XWOg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mVc4M1YbGvNb8ipoFp9BUg+QNpL61/sf2CwDTAOM2wc=; fh=auIWwahl3Sx7knKs+L4bywGsPX6mxdHcGR4EWU7o16g=; b=VLm9H9fD54Ks9wabs2Df8gTZDA1SInR78St4+f8t/szZwTpBLD/C39ck+CsNXe+Oty OiQZvwUlBuoAdBCFGZHcitya8cqiJ0BVcfaM6GYGB9c6Yvd9rOHd33AN+QIVpEh0TcUu pvz7XM7Ei+6vWpondOhaj3T0ljqFaJ8A7I5sSHMyUlxwwJYeKCNnwi9u8xhXDppgRdxC 99IzKvWR2KQU0f4jy7usRfyWLbBJD0qeCWlMbfIPCZgA2hoia0z/iPLpjpuUbMzlioYB 0O+2ERNLtxHGweSjXemV+NbRaes9Qi/FCzTOlk/7iCSdkGKDwYFdWt9WeWVRfkC815aN 5png==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NMl8ZlzC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-59247-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59247-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCXT7RL8Qi8gFU7VszCHnvGdnciDOAhxoSU3VMw29h7c6xICyER1PuFca0AD84ymxn2kV/9Db40A+y4yxEeCGtAG8zEwdw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t13-20020a1709028c8d00b001d78c9a13b7si1408962plo.528.2024.02.09.02.51.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 02:51:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59247-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=NMl8ZlzC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-59247-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59247-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 685262881CF for ; Fri, 9 Feb 2024 10:51:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99EB83613C; Fri, 9 Feb 2024 10:50:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NMl8ZlzC" Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 926DA2D60C; Fri, 9 Feb 2024 10:50:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707475822; cv=none; b=NycEjlezHs2ZtBzzXv9ax3vhwcbQ69PEXuIXMY9ww5HZ3WUimW+eGTuf6lk0lEi5k2AqKir6g1tUwiSSdLbVhnutiuSvI/dP9yt0LqpwpYCttFvuqvrTU3rcmwmLoESl4LElwTqoxHMFIG9XBbzpI2z3pkiK51GM35W4MUUBxro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707475822; c=relaxed/simple; bh=FACvZGCzZd/Mj3qjKO44p5hHKQ4QqwarXOST8mlvQ/U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fsJoM94rBikjK0Cif9HR84qriPTfDlOPmIA/HhX/UwcTlQWdcQUMuRTS+AxoNLVqY0e8JpIPNy3mGVdrKuZdmy7/lkMaR2hEUaZhYj6bFF23KotNZqfWAo9PiOavp1/9ydK7Fshbtbf2IpPtxzQjR/DUrkr2slxcjbe8qgzQsys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NMl8ZlzC; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4105a6be071so4393545e9.1; Fri, 09 Feb 2024 02:50:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707475818; x=1708080618; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mVc4M1YbGvNb8ipoFp9BUg+QNpL61/sf2CwDTAOM2wc=; b=NMl8ZlzCFSsRVdlsNj/tMMUds+TJ6QAsDB4rbs3uXbNHH5OiWHG2yokjAW2stcCarg bIPMIjkLbaTK9k715BStxz/9j1Vf0rQWWmQ5d7jQ0v8UhcMEjJriaNoDu9JoIsJ75+sB PCoq9Hn6/NxZhYNY63lICK7ylRQ9btYErVLDM35W+FEtNH8+uESfItIv3p8kl51fkz2f IYVUkUjyR4Jw/hZz7h2iHOqG48Oxrldmda0Y4HdhqXyScZJQ04zI5Rq/AOTaD3IiHjBh EJkLzY9GFATI4jEhZiaslJH3gtZFHHC4O0qszp2KDoyrZWWzgJqeF/xuFutNEjeDilDX Fvrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707475818; x=1708080618; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mVc4M1YbGvNb8ipoFp9BUg+QNpL61/sf2CwDTAOM2wc=; b=uetu9fU6RPhZ8T2fv02rOI45gxO+92LSuPyvflSsVK4c/2j/oLlbvBnS5QLxtF7NFD vEluHlR3OlgomeTfxH2kUq5vWKkg/yshGP3LR+NbDW3hog8+dfULUvsdSeMesUVbpd+z tS10TXXQR62s+OleHNWVnH4HVcdA60oXzY0mSbbUxSkocgLalGT+sYzobdyLeQtsoeN2 /9ReELI6aEsznuSas3eX8v8dnSbRr1gUmaEYTWVTlCZso1+cD5pHAT/vja6ZO+HLuimm iGOu3ZnvB2vZnbbSDNr5yWUf92IYcavlQVdinl284Y8xeUfvKM+mPCmM7vugFrSQxlHV Q9pg== X-Gm-Message-State: AOJu0Yxe06jbvgNTNYylUymoJz5AJDLIY6ZH8GVaQEAlKd8YLk02gFS5 vGazK4Nfom9rCY3FpgpcPnZaZB4039gMT26wWYrg2va2W1MpQmt0 X-Received: by 2002:a05:600c:46cf:b0:410:4b4:dc7f with SMTP id q15-20020a05600c46cf00b0041004b4dc7fmr655530wmo.4.1707475818274; Fri, 09 Feb 2024 02:50:18 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX4eE7ROrtmTolbB2S5sYVQJ9RixDkW0mR4Btlqzf15LrqUXDitF7gsevS5eTiwsbNuxPR71Y1KDWbB3QNk5IqGsbkC0HTatgMlq/J3EqoobkPpk6emEaggcm0BhrA1njJEBLBPEvvDi0Uo62kUPwy/c8LQIDME/BemJ/Ls4s0B8/LG0if0oQAYfbXTT+s4dxTQhvrcDPy3mtFz+7hDvHppzmvLJAjj4xZF+rSCTJ+vZGDwSUKwfpcWqoAstwU+pmtcwOMNjoFpr3vfnYPUExNYbKRTUg+ZfUnJyrEtZFtroX8c8hWxcq9wB4URcHIk+WoWWC6HxDKDFTc/LXy11APlURRec/O8h7DPe3/i6hm7nqIse9FjOgVjHir4B8ltDe8BcBJgmK/bwVqCjs7qKXE4TmbnJ+iKvGeSNZYjgkgkiadgj9qdwno7FjMA4BNf/FKSrrCXQfaX9GcvX2hFwjNcADTuwpKVkXOKV/Urug3uRR0cUEDxWoEwWpgwfoI6zGvfTMsjNXCMNMTvo3N9Xuff7gzulNWxLR6S1HVxUVAR/hLoBx/2 Received: from eichest-laptop.toradex.int ([2a02:168:af72:0:765:2268:762e:2748]) by smtp.gmail.com with ESMTPSA id t18-20020a05600c199200b0040fc26183e8sm253627wmq.8.2024.02.09.02.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 02:50:17 -0800 (PST) From: Stefan Eichenberger To: nick@shmanahar.org, dmitry.torokhov@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev, linus.walleij@linaro.org Cc: linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, francesco.dolcini@toradex.com, Stefan Eichenberger Subject: [PATCH RESEND v3 2/2] Input: atmel_mxt_ts - support poweroff in suspend Date: Fri, 9 Feb 2024 11:50:12 +0100 Message-Id: <20240209105012.22470-3-eichest@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240209105012.22470-1-eichest@gmail.com> References: <20240209105012.22470-1-eichest@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790418257541478912 X-GMAIL-MSGID: 1790418257541478912 From: Stefan Eichenberger Add a new device tree property to indicate that the device should be powered off in suspend mode. We have a shared regulator that powers the display, a USB hub and some other peripherals. The maXTouch controller doesn't normally disable the regulator in suspend mode, so our extra peripherals stay powered on. This is not desirable as it consumes more power. With this patch we add the option to disable the regulator in suspend mode for the maXTouch and accept the longer initialisation time. Signed-off-by: Stefan Eichenberger --- drivers/input/touchscreen/atmel_mxt_ts.c | 72 ++++++++++++++++++------ 1 file changed, 55 insertions(+), 17 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 542a31448c8f..2d5655385702 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; /* Cached parameters from object table */ u16 T5_address; @@ -2799,15 +2800,18 @@ static int mxt_configure_objects(struct mxt_data *data, dev_warn(dev, "Error %d updating config\n", error); } - if (data->multitouch) { - error = mxt_initialize_input_device(data); - if (error) - return error; - } else { - dev_warn(dev, "No touch object detected\n"); - } + /* If input device is not already registered */ + if (!data->input_dev) { + if (data->multitouch) { + error = mxt_initialize_input_device(data); + if (error) + return error; + } else { + dev_warn(dev, "No touch object detected\n"); + } - mxt_debug_init(data); + mxt_debug_init(data); + } return 0; } @@ -3325,6 +3329,8 @@ static int mxt_probe(struct i2c_client *client) msleep(MXT_RESET_INVALID_CHG); } + data->poweroff_sleep = device_property_read_bool(&client->dev, + "atmel,poweroff-sleep"); /* * Controllers like mXT1386 have a dedicated WAKE line that could be * connected to a GPIO or to I2C SCL pin, or permanently asserted low. @@ -3387,12 +3393,21 @@ static int mxt_suspend(struct device *dev) if (!input_dev) return 0; - mutex_lock(&input_dev->mutex); + if (!device_may_wakeup(dev) && data->poweroff_sleep) { + if (data->reset_gpio) + gpiod_set_value(data->reset_gpio, 1); - if (input_device_enabled(input_dev)) - mxt_stop(data); + regulator_bulk_disable(ARRAY_SIZE(data->regulators), + data->regulators); + data->T44_address = 0; + } else { + mutex_lock(&input_dev->mutex); + + if (input_device_enabled(input_dev)) + mxt_stop(data); - mutex_unlock(&input_dev->mutex); + mutex_unlock(&input_dev->mutex); + } disable_irq(data->irq); @@ -3408,14 +3423,37 @@ static int mxt_resume(struct device *dev) if (!input_dev) return 0; - enable_irq(data->irq); + if (!device_may_wakeup(dev) && data->poweroff_sleep) { + int ret; - mutex_lock(&input_dev->mutex); + ret = regulator_bulk_enable(ARRAY_SIZE(data->regulators), + data->regulators); + if (ret) { + dev_err(dev, "failed to enable regulators: %d\n", + ret); + return ret; + } + msleep(MXT_BACKUP_TIME); - if (input_device_enabled(input_dev)) - mxt_start(data); + if (data->reset_gpio) { + /* Wait a while and then de-assert the RESET GPIO line */ + msleep(MXT_RESET_GPIO_TIME); + gpiod_set_value(data->reset_gpio, 0); + msleep(MXT_RESET_INVALID_CHG); + } - mutex_unlock(&input_dev->mutex); + /* This also enables the irq again */ + mxt_initialize(data); + } else { + enable_irq(data->irq); + + mutex_lock(&input_dev->mutex); + + if (input_device_enabled(input_dev)) + mxt_start(data); + + mutex_unlock(&input_dev->mutex); + } return 0; }