Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp524698rdb; Thu, 15 Feb 2024 07:21:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXsP5fCRqWFdM1TGKUwIxP34U78HiMXhpmll6k/nOVWpL+PsbxgJyhU995uwGvyzHbpn2CCrZ5mla5+MisIIHsGBp/R1fc2Z7SXlfQpJQ== X-Google-Smtp-Source: AGHT+IFM/vitmyQ/sZ8HUdWsx9dDo9+I2OF5fG1yay4+6q75RbsXx+UAiDLvQcQSyoHV7zE7qIpA X-Received: by 2002:a05:6a20:5a1b:b0:19f:2df0:13fd with SMTP id jz27-20020a056a205a1b00b0019f2df013fdmr1496709pzb.29.1708010503555; Thu, 15 Feb 2024 07:21:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708010503; cv=pass; d=google.com; s=arc-20160816; b=W3aYMHbliQwwyHOyTzBgD7A9piZlpT8nUsEUhteMI8k3o7T+c06ViUxvbF1pulEaA0 m5a7xXNEsAn6nPUl0UGgPDjOQeh2JX5zk+c/BcwL5XHJBG0ZzlmfoDwCz9lREOOAFUhY eg4o3h6A5bFk0w9PO409qrwbomDaD2CNsIHanBS2VHj5j11HLxwczHrF6Q7XeqqnwUo9 0BZo7EpFPmiMyDlGI/y3Bbsa4GqxNMLbotEusGeeXyXd1YkEPGEXqKpg4Q9vmBlOoDNc D3rpl+/F+KrnxRe4xmB556HD0ipZXu1k2hJQGAdGX36LydqW/UBLh9r9wBMOmzG4TiqO 3J6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=mPxPc7Xvb7+q1PFnLq8F3pklOXjELgiYL5RrEQlPZLM=; fh=wHZQkXie84v2FP+2z7dUEuyvptHwnAyqgx34WxJkhrY=; b=cYmba53YpRY2yzMRNLVZ04LcghMR/K5SK9w3PD8yGE4ioBqMKwZw0spmEgNOyojEQh 2wdvm09pQsXxYf93iy0z5rYafTmgWIOyaEQWThJhjiFJoaXHdn1q+ojk5sWtRv4gPq30 woeR+5eWhTfzTwx+qj7wP9448y13Ae6d8SBkCUDFLQD6atrBbtxjeaeGyLooc2UD4t22 YVTQKy0+UcktzckFOsUR9sSdl1d5f0vbUFoZVhKY8dnyzbitORHNA87u1Ft8ANEFwmCl A2yWAKwMlkvYqPW8VGPhlDCfdlEvbNTnSNO7zKQZLb7Wx9N92w4I7DMa454gfXp0Mnie xDsw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=hv4KJLdE; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-67153-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67153-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n10-20020aa7984a000000b006dd881750d2si1289746pfq.46.2024.02.15.07.21.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:21:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67153-linux.lists.archive=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=@bootlin.com header.s=gm1 header.b=hv4KJLdE; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-67153-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67153-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 30FAA284403 for ; Thu, 15 Feb 2024 15:19:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3910134750; Thu, 15 Feb 2024 15:18:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="hv4KJLdE" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D84E6132C2D; Thu, 15 Feb 2024 15:18:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010290; cv=none; b=jXC7OObq3T+J/x7jPg0Ae9NCIPPGNw2xIaKS8pzGwoFh9jSp6LcCxP9WOA+0UuQJB+vJayYaEZtmzqEe6SYu+wcwe4Zf4za81/ngiu0s3qTf0wUBi49P/6lLhaijL3ocUcHA0Z5hNWW+HId37Ydc9I0EFIZ5cJpL+UDpGKEs7sk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010290; c=relaxed/simple; bh=5c3PEdEw9K2SWSbCnl8JZa/Az4dMYehFM7efi82xY10=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TVObwfY6VFbbsdfKFBxsEyOZrG4HRaWNbjRcCf6IZAe2LHt3ukqhFsOzipten9UCJnodwEsNSXua2hG73WlmDjJzLMQXwwnhgLB7tYDizb4fen43HlEa+7Ujw0OZbw+hEFgufn75dmdOJZvcVEo6dcxeKvyNiKNiX+kwGrnIBgs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=hv4KJLdE; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 2E89F240014; Thu, 15 Feb 2024 15:18:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708010286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mPxPc7Xvb7+q1PFnLq8F3pklOXjELgiYL5RrEQlPZLM=; b=hv4KJLdEm3D68ygjCeQI0f6Li0bYy6g5tgDVSnZMtNe5x1p7CsSbwqLnRHg6UPqX2YrxVe 10MkwKsoaqwKb5voo2rwB+E1cey1kphwHuEJI+D9LjchjctBi2Hgsm8bSrfselmBVdPuVh SEebNpingPgX6J9U4thp4aGS3BJO4liAmfG4PckUMTSG/sUAOx71jXmetVFjjVbR1BNuf7 YwG6o1He6OZPyy76WnL8/Ke04Dc1nflsHMnflWwDL28k3u+tbMUGl0denojY3kPv8dOfy2 /Oa1lFZtnWTPEK6ZIwkUKlkuRKgFAjwozvFucfG1Lhd4K5etvMd9xmCCo1LXMQ== From: Thomas Richard Date: Thu, 15 Feb 2024 16:17:51 +0100 Subject: [PATCH v3 06/18] mux: mmio: add resume support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240102-j7200-pcie-s2r-v3-6-5c2e4a3fac1f@bootlin.com> References: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v3-0-5c2e4a3fac1f@bootlin.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com, Thomas Richard X-Mailer: b4 0.12.0 X-GND-Sasl: thomas.richard@bootlin.com From: Théo Lebrun No need to save something during the suspend stage, as the mux core has an internal cache to store the state of muxes. This cache is used by mux_chip_resume() to restore all muxes. Signed-off-by: Théo Lebrun Signed-off-by: Thomas Richard --- drivers/mux/mmio.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mux/mmio.c b/drivers/mux/mmio.c index fd1d121a584b..892ff4714b68 100644 --- a/drivers/mux/mmio.c +++ b/drivers/mux/mmio.c @@ -125,13 +125,25 @@ static int mux_mmio_probe(struct platform_device *pdev) mux_chip->ops = &mux_mmio_ops; + dev_set_drvdata(dev, mux_chip); + return devm_mux_chip_register(dev, mux_chip); } +static int mux_mmio_resume_noirq(struct device *dev) +{ + struct mux_chip *mux_chip = dev_get_drvdata(dev); + + return mux_chip_resume(mux_chip); +} + +static DEFINE_NOIRQ_DEV_PM_OPS(mux_mmio_pm_ops, NULL, mux_mmio_resume_noirq); + static struct platform_driver mux_mmio_driver = { .driver = { .name = "mmio-mux", .of_match_table = mux_mmio_dt_ids, + .pm = pm_sleep_ptr(&mux_mmio_pm_ops), }, .probe = mux_mmio_probe, }; -- 2.39.2