Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp147411lqs; Thu, 13 Jun 2024 06:32:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+W5MsYe15SioG4zsv0NI+rFcGd0sGNRvrtxhPz2F9iVi/eYIbFKj3dUR25LYeFPN+PEEq5g/PsZyPMsn2zAKBv0nP/Dsl/oXnSaR5YA== X-Google-Smtp-Source: AGHT+IEznCKZIAg332pgPC0bYIFRwVSSkY4x2Aoi5xsHJvj58OnqYxHrsw5F2BBo6XqqdGbuBTl0 X-Received: by 2002:a05:6a20:3d94:b0:1b4:a478:2275 with SMTP id adf61e73a8af0-1b8bf098180mr4443886637.29.1718285555552; Thu, 13 Jun 2024 06:32:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718285555; cv=pass; d=google.com; s=arc-20160816; b=wK/osph3jSHqReCDUvrRVkppjX5QlteiFtZiTEpD8eNmgLEKmSPYLFjp5AATncVZj8 NGqBzZOIwqnfvlc8088TuaIvPh1PcRgrQLCwTmmWEsO0TiFhtrYBAGPetF/CO4nctqgq zJ23en0hwH3xuH12u5aQSN3Erm2LCZmtiLPlJ6yInFWtqddXichlEUsP2aO5c5G8Cxn/ 2Ta45Ky3VBmrywXOsY9SUdvt//BzDy35yHrRYYf2tfkH+0qTeBE48cLDQEyuNVnkFFKL g9TG8zG9ErhkdB1ehW9iGIzc593/XpJT7VVnwv5djA354zdko6h7p+REZdyWwHwd+r9R LWBg== 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=jPqUbSf1Qdf1yloJtVBeCvPFg+XlI7QIXeQdbRho+l4=; fh=jhDd7fPr50pt/7AT3ZKjMssyVGTEdEgMheLVuKLyfsg=; b=d5CtqMNMPxvVt+oUeskvZtw7TX+5bgSGdY08MCZl3T6CAlmBnhnaHOBFakVL7165zB ID63oXiVqZFb+vusXI/3YwyzQ1FKprdQYEnHdBPXnKMyffFlcwfmQH4OVLBsJy1ZikXc ZnK7qS11lWKmApVcAzjavpM16ciL5L06XqppgF7cvi04SGy6cpd2+aCtrfuEL9cuWdO6 fb5lmirpIQ7kUVViTe0LEeE9RaLvwdIuW/tVfGjK/XEE7L94nPhDyqQ31eb8muYRE0hk Zgnp+DBnNKmWWVpV1KeWFkuowB/tnkdJ5jpmc3udKxYyDh8Y23Xe7OJrmPUHQ+fF0rtZ fzng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RKrtvdq0; 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-213255-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213255-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d2e1a72fcca58-705ccb7261esi1412551b3a.245.2024.06.13.06.32.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 06:32:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213255-linux.lists.archive=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=@bootlin.com header.s=gm1 header.b=RKrtvdq0; 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-213255-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213255-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 40402B23C14 for ; Thu, 13 Jun 2024 13:08:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7C8C814431C; Thu, 13 Jun 2024 13:07:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="RKrtvdq0" 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 90217142E81 for ; Thu, 13 Jun 2024 13:07:52 +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=1718284074; cv=none; b=sfvg0UdjOgREanvSgkdY33POrC78vl9BKDGNrHqjeooM6i4MXv8GOj5vZnMieHKbrXd3SDQHMFWhu8drqtyjKuz9AOw0zw3XfYsk6vat+D54jE41e+aKNfaC7MjcoEPYE8LlsTG72U5CfTkNU6Uss3WWFhH557KGN8emQFGdHt0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718284074; c=relaxed/simple; bh=KoeKOC9BxNbULIOx5THehrA2LvyMrmoh0J2kqk1uxqk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NqSLDmqbb2s4XQGuGCRyvF5iw+4BCXiw3MOWvSGkX8hLy25SL8Lht3eqmZsmoCBro9U5ndwfMMQiga0iE49xGvgZe+ZcXWNNgwgGQAYSRBGgx+ushZD/tQJxt/X2gG+9gPxoDxoBfa+VFyFHs9v4HA44BREENVpPJKyls82nxns= 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=RKrtvdq0; 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 852C0240003; Thu, 13 Jun 2024 13:07:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1718284064; 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=jPqUbSf1Qdf1yloJtVBeCvPFg+XlI7QIXeQdbRho+l4=; b=RKrtvdq0hC2/jVYPZXrCIbBpbVPtezi8Xmq7AsBucCN/8VRQ01OeU+YJRYGXQFCu70cAoi gWo5WU2D20OwWRl8/jG7xhubDQeDJjH2l9MvjPn24E3qluWIvKiqPOsPFgsFaOXeDpFs/a ZfxJ20Hp1qY3w5fjqcthFwpFAi9CNqMUDhtiobwkGUMPVUZXY+Jz2QBMaDjHDDM9zBWE+1 KLC46yShOdEA9/G+xuq10QmEQDqIipoFEX2res29SxNOYrQRsQtB4WtZjEVKw1/YjCvDQ8 +UTcYTTpXkfxUEUzXCYc3jcT97+k+EoOtn/VwPR1S3wFtgiMvOM5k+lWhsbsdA== From: Thomas Richard Date: Thu, 13 Jun 2024 15:07:31 +0200 Subject: [PATCH 2/2] 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: <20240613-mux-mmio-resume-support-v1-2-4525bf56024a@bootlin.com> References: <20240613-mux-mmio-resume-support-v1-0-4525bf56024a@bootlin.com> In-Reply-To: <20240613-mux-mmio-resume-support-v1-0-4525bf56024a@bootlin.com> To: Peter Rosin Cc: linux-kernel@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 30a952c34365..00405abe3ce3 100644 --- a/drivers/mux/mmio.c +++ b/drivers/mux/mmio.c @@ -130,13 +130,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