Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp888485rdb; Fri, 9 Feb 2024 04:30:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFpmlnq9+z5Qz2eH9RQQM+N1Gj1ZRMFtvXOkhCEETqVE2ufo6A96HmQ+r3Xnc0CKbjDCfBQ X-Received: by 2002:a05:6214:5508:b0:68c:a8df:37e1 with SMTP id mb8-20020a056214550800b0068ca8df37e1mr1590082qvb.4.1707481810323; Fri, 09 Feb 2024 04:30:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707481810; cv=pass; d=google.com; s=arc-20160816; b=ugeLVv0bYMrwz2Y/xMbYqg6t8NA64E9VPdriWFVS5A/iNa2+bHSqr4/6GWC13ZwHKT Fzd07KdHOlp1pN7FoDvbPT7uGPzn9OVKtiT0zB0wX7zWLXgR/m+e5grpn/hJkMQTO9mU GD8Nr2+St8zgzfo39CZgYVTVrsrCZDfS3IB+yDpukG+E0lOE3RDsdYy0SucXwOwQ8RuY 3NkGhi9oKCXysOfmYwzFyNWgJfAZj9KOsXjFJMaI8slO9Md+uERPycCoUT7rR+2CruYr 8yfaJ3E0JIWEz3xi1hnT2YGisfWIY9s793hOHvqKezvRi89vANEvvtnTb5/iT4+pmZQt Nevw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=NHy3VGid497O23zJdu4K5s/J5uKQU2yHP46MdF54AZI=; fh=EnM82guEaju9FZbiq5yoZpP72DxV5PyLuQLyYdBHvm0=; b=Wgluy2mSspVvGdlcd3vodASDLrRi05ZUjm+X1EEo8yQKfDz7pfCS2Slhj8lgt+1ZJr NCdux/K6CGaEiLADoBhK3CjOxlGmWdMutFku9fHeKVOiVp8FAjxCOV4oP+vgjtlA+9p1 4g+q/j16kbQ9/ctFteJPPyDm3s9AGbeOHzUtOx6SEkFL454+U+qNFghLyghQrgYFiHkM t45SOS6M6DXQqvs+260EwtRvrsPevDXZhVytvAgN/N7rpmMsemEcAbF7skwzSjRvOwJu EFxOBzQxjmsDfkAo4RMOT1No3LJmHnjq5DXOrsrU1lLKmr7QA5GAl4cgX1tVslHupphS VLbw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b="cy/0XMGb"; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-59025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59025-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCWoy40m8LEoP0Zh6ySUjsKQITLwWwR9a4MNTnhRSNNV0JaXmkO1u9kAses38Kv7IB+ISPmUfALkW4eRxmjSWoVBI9+XZEH8CbIz67WXsw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c2-20020ad45ae2000000b006896efd10basi1810989qvh.536.2024.02.09.04.30.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 04:30:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b="cy/0XMGb"; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-59025-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59025-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 50BD51C20C8C for ; Fri, 9 Feb 2024 05:55:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F29B05730C; Fri, 9 Feb 2024 05:54:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="cy/0XMGb" Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 393CB56B91 for ; Fri, 9 Feb 2024 05:54:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707458097; cv=none; b=aAIlm3PjpHYWQ579dQwi4RM7XTrEvfW9efPEhcz9Otu7LhFZcfeL0BymGlh6JkdZ7JGkmoJA243iAiY4JJzRS8HaCvvKE2ecwHgYdV9y8DGfGk4fSb4FtkJh87IkaYcKTTvUjEcQYEUQndkZg87Hi2tG6rD4MS1QcHr2MHzs5Qw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707458097; c=relaxed/simple; bh=6O8nnoLFzLnwrH6TEG7OKKLM/CWovHK2pvgd9GTlM+o=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kBnKaOrAG2UqCHLJwCat5FUNBiCMTx0EYS+4k+4PIBhRho7PJi2McHpK+PkHZ1bYWGEMtwl7+0vYC1kfiNy/3HXIHcXMsW38gJ16UtQdGoopDzJoPpSmwoneVYZ4L8YQC3QqM5QXPw4nP/HZ7/WJMKhoXvqe2cMUZokmdGxkmI8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=cy/0XMGb; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-33b189ae5e8so186412f8f.2 for ; Thu, 08 Feb 2024 21:54:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1707458092; x=1708062892; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=NHy3VGid497O23zJdu4K5s/J5uKQU2yHP46MdF54AZI=; b=cy/0XMGbR1xqhphlo5YTxJ73BcLObnVTw5shjcV1fGZnCWhWfO+Mbjjw0mDXld/aHY SkpekrfFD7Zr0U0nfZohZC7cIwYd43lDZrZ849xIS2q7Nd1oWdgXpuhdZC8U9wJtC2mb mFmr9tI6NZtykrZ0sUEka+HLRvO1UI90e3KJ8UTdTbJU37QlVXbI9jFKOXYC5daGmk3P dWZRN7LO9P4hekAc5FvJ5ASCzeaIzOZJ5umesvFVQ4amsgnZgZfh3HvRXMBcodlsHDH4 sfk3U++xCFe97PE3XswrHjaFEvEF0WUfp853eFx6BQ+/owSLTX1h2OpK7ZJlO78dXeqy 7iSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707458092; x=1708062892; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NHy3VGid497O23zJdu4K5s/J5uKQU2yHP46MdF54AZI=; b=cWRqpNt+QwLzagJkGzHjc6+XJG2uO1h+gZMbbkdxwLdEDTt0Jzo8orvA93mk99HbdX 6eoLGnM2FKY9f9hBNXiZXbiyj1m5Rzz8soP1E36RNluu6VphowYojAbtAP10gRi55l+y u2evIAsf5TK7y7zos6JOX6tr3TnRYQgxAJokAc4s2lkQx6B57augz/QT+O4h1RzIpeZ4 84XAaF988wBPGplL8pSwetDup5TRjRYpOh6dWPd9BCmyD+5hs0zKQhbtL7Hs0xvumSnX 2n/PmcTRW3R6XM7KdzLxJnEs/4gTvromkVcd3WS45FzaVPOay4m7hFqbjkyysDq22HV9 8oYg== X-Gm-Message-State: AOJu0Yw/weOIzEcwpJtHhg2xnzp/V7Ru9ThS214RT+sKvbAJ5e5F98Ih qhFpk8sMSdgLEQqXL/MOsOG/Vtq7iO3ejohBvmauFjE/ueYpK16w/D8LPE01RIs= X-Received: by 2002:a5d:610e:0:b0:33b:6073:335 with SMTP id v14-20020a5d610e000000b0033b60730335mr308406wrt.55.1707458092359; Thu, 08 Feb 2024 21:54:52 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCX1LTGYuUHSatTm8Me5EcYa9WUXtVNfzARxigi860VQ5Rq7gIsMBnx0vA+gwoeJNxbCkKIxdaGe+FscX6cDei8pfhGg7XfsgCIywQVrSdywbTCUMDb2xrxHYGGLzCMRAzUg1LIIqcfEAlw4XSWGsOOr+w0R69BTgdEIymGST8Y23aGlmGpqevfwINrzDxfUTaqepBaglGKG2wBO5Z52fgsiVfghIrsb4OewvS19Hw3QqhzB3tGlu7Uw8jbL7F8zBPM5oW3iYhDp9PD6uCSvddmB2gOpNEi/KZdixLLOAAcsKdg3A47oYlXExfiV8z03wsUNQZsYy/2vLJn5pMgpLNUjIGeIDY9NPC5GXjc5Pwy8pPiE3Kj2ijYLa46VzwO+DccNT791McPS9Bwo5XrnpI/QJCExCGFDYmPGmA== Received: from [192.168.50.4] ([82.78.167.124]) by smtp.gmail.com with ESMTPSA id bv28-20020a0560001f1c00b0033b4335dce5sm921517wrb.85.2024.02.08.21.54.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Feb 2024 21:54:52 -0800 (PST) Message-ID: Date: Fri, 9 Feb 2024 07:54:49 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] pinctrl: renesas: rzg2l: Add suspend/resume support Content-Language: en-US To: geert+renesas@glider.be, magnus.damm@gmail.com, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linus.walleij@linaro.org Cc: linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Claudiu Beznea References: <20240208135629.2840932-1-claudiu.beznea.uj@bp.renesas.com> <20240208135629.2840932-2-claudiu.beznea.uj@bp.renesas.com> From: claudiu beznea In-Reply-To: <20240208135629.2840932-2-claudiu.beznea.uj@bp.renesas.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 08.02.2024 15:56, Claudiu wrote: > From: Claudiu Beznea > > pinctrl-rzg2l driver is used on RZ/G3S which support deep sleep states > where power to most of the SoC components is turned off. > > For this add suspend/resume support. This involves saving and restoring > configured registers along with disabling clock in case there is no pin > configured as wakeup sources. > > To save/restore registers 2 caches were allocated: one for GPIO pins and > one for dedicated pins. > > On suspend path the pin controller registers are saved and if none of the > pins are configured as wakeup sources the pinctrl clock is disabled. > Otherwise it remains on. > > On resume path the configuration is done as follows: > 1/ setup PFCs by writing to registers on pin based accesses > 2/ setup GPIOs by writing to registers on port based accesses and > following configuration steps specified in hardware manual > 3/ setup dedicated pins by writing to registers on port based accesses > 4/ setup interrupts. > > Because interrupt signals are routed to IA55 interrupt controller and > IA55 interrupt controller resumes before pin controller, patch restores > also the configured interrupts just after pin settings are restored to > avoid invalid interrupts while resuming. > > Signed-off-by: Claudiu Beznea > --- [ ... ] > > +/** > + * struct rzg2l_pinctrl_reg_cache - register cache structure (to be used in suspend/resume) > + * @p: P registers cache > + * @pm: PM registers cache > + * @pmc: PMC registers cache > + * @pfc: PFC registers cache > + * @iolh: IOLH registers cache > + * @ien: IEN registers cache > + * @sd_ch: SD_CH registers cache > + * @eth_poc: ET_POC registers cache > + * @eth_mode: ETH_MODE register cache > + * @qspi: QSPI registers cache > + */ > +struct rzg2l_pinctrl_reg_cache { > + u8 *p; > + u16 *pm; > + u8 *pmc; > + u32 *pfc; > + u32 *iolh[2]; > + u32 *ien[2]; > + u32 sd_ch[2]; > + u32 eth_poc[2]; > + u32 eth_mode; > + u32 qspi; I missed it, u8 should be enough for these. [ ... ]