Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp630348rdb; Mon, 15 Jan 2024 08:22:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6F2pwQJCn1EJta33xV9039V5Ty1vt2i7rspszIg7qhIHvcQ37vxGu5PEWPOemZ5IA8a2o X-Received: by 2002:a17:90a:c092:b0:28e:f90:8cef with SMTP id o18-20020a17090ac09200b0028e0f908cefmr2205768pjs.9.1705335738211; Mon, 15 Jan 2024 08:22:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705335738; cv=none; d=google.com; s=arc-20160816; b=z34DoZPn5Zpjtahw8sp8g2wz/zjoH+79F+j6vz/u2lzm2yH3P728ph3aIHzQIK2WTX 36+eKWUBOOhpAE2jfoNUiaeodtZlTQ6S7WoRVthjBFQyr4m9Rl7UtTddzFYRrsa57yUn x0drF9wv3A5FhvtU551cAEKzR3preyjivka4Iv6oFdmScx287nYcgT4vDVnYZAOpQ6nD S7gzxgdkI2dXcYawrMUrhV5U9IX42UqDKWPASbc0t8gWT0FqjrNiFNgWIWPATjCRdyyB F2O1iAEFCGgE5CYLFc1tjsB5uAS0Cw0o89/5t2CuKdjOm6qDUKHOpSRjNjg9upU2VER8 oHqQ== ARC-Message-Signature: i=1; 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=6Zc7oDGWLY59Id14ADaThozzre9i+PeSim2lQYTQhJU=; fh=ihwxVJW8DyodhmdJo1IfhLUDNDWeXh+49SpWXYbpL2Y=; b=IKdz4WAUGEjAWZIWKjs8gpnMjnOu3ctyv1pQX0sFZUIOQXfT0vmbKqc12m/c17Zif9 hC1TuG6q9v5FqF8Qj3vAbnSPGGWWGGLwOqsnSEhpYGLqMX7nAI+r7ExvCaqsS3UM0RR2 ggx1hzUmUOLaQ8taYErmSWY0PsWPLLE9hBsk6fsLG5X7BF7GzPEBbcZl8aKoFLqSUwwY d1XYVxgVV7XVaCT5/2F42XuCnw/OKMkTNWlbo5grpq2DX3piFJojdUV9GsDWsu0LLcZF O00NUi2ywXhRavP7OVL38e03jPJCIgO2AkWXlhTAAsMhdDmT2vN63zgnhSQNC0X1eWp1 yq+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=X9WmaQWw; spf=pass (google.com: domain of linux-kernel+bounces-26246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26246-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 p24-20020a17090adf9800b0028b6acef394si9158816pjv.1.2024.01.15.08.22.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 08:22:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26246-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=X9WmaQWw; spf=pass (google.com: domain of linux-kernel+bounces-26246-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26246-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 1D097B2238C for ; Mon, 15 Jan 2024 16:21:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 895631A738; Mon, 15 Jan 2024 16:16:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="X9WmaQWw" Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (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 6F4B51A287; Mon, 15 Jan 2024 16:16:31 +0000 (UTC) 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 85B07C000B; Mon, 15 Jan 2024 16:16:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1705335390; 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=6Zc7oDGWLY59Id14ADaThozzre9i+PeSim2lQYTQhJU=; b=X9WmaQWwwETfW8dfJA1H1y0E/fv7gA9agoRHyRjTmfy4DU6xneG2cNNHyxhTAP8o/90RXr wqNNK3LbwCu3OiYNWMPnwY6Iv3PXuZGfDHelcqvc+kPycf0AH/FVGB6dlb1LcOD1O56v6I lItnrOTKbPIwsut/lHb0AZouJXqv74d5litMfv8xIB0q7iOgSWAr9Z1wI1QAgpl8vj9JmL qa8IbSiF38YNuq6zJz0xBsNz0W4NzxbenqgznEbAzFds/o8uJ8CYxjv5vlu1aSC6S5bL1m H9eHBIfqubYclIYmf5ufs4GWb4u8TSBT8xOsiDAiH9/Tr0lihoNGJ5dx5Xtfuw== From: Thomas Richard Date: Mon, 15 Jan 2024 17:14:54 +0100 Subject: [PATCH 13/14] PCI: j721e: move reset GPIO to device struct 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-v1-13-84e55da52400@bootlin.com> References: <20240102-j7200-pcie-s2r-v1-0-84e55da52400@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v1-0-84e55da52400@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 , Tom Joseph , 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 Move reset GPIO to device struct, so it can be used at suspend and resume stages. Signed-off-by: Théo Lebrun Signed-off-by: Thomas Richard --- drivers/pci/controller/cadence/pci-j721e.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c index 9b343a46da11..477275d72257 100644 --- a/drivers/pci/controller/cadence/pci-j721e.c +++ b/drivers/pci/controller/cadence/pci-j721e.c @@ -54,6 +54,7 @@ struct j721e_pcie { struct clk *refclk; u32 mode; u32 num_lanes; + struct gpio_desc *reset_gpio; void __iomem *user_cfg_base; void __iomem *intd_cfg_base; u32 linkdown_irq_regfield; @@ -359,7 +360,6 @@ static int j721e_pcie_probe(struct platform_device *pdev) struct j721e_pcie *pcie; struct cdns_pcie_rc *rc = NULL; struct cdns_pcie_ep *ep = NULL; - struct gpio_desc *gpiod; void __iomem *base; struct clk *clk; u32 num_lanes; @@ -468,9 +468,9 @@ static int j721e_pcie_probe(struct platform_device *pdev) switch (mode) { case PCI_MODE_RC: - gpiod = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); - if (IS_ERR(gpiod)) { - ret = PTR_ERR(gpiod); + pcie->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(pcie->reset_gpio)) { + ret = PTR_ERR(pcie->reset_gpio); if (ret != -EPROBE_DEFER) dev_err(dev, "Failed to get reset GPIO\n"); goto err_get_sync; @@ -504,9 +504,9 @@ static int j721e_pcie_probe(struct platform_device *pdev) * mode is selected while enabling the PHY. So deassert PERST# * after 100 us. */ - if (gpiod) { + if (pcie->reset_gpio) { usleep_range(100, 200); - gpiod_set_value_cansleep(gpiod, 1); + gpiod_set_value_cansleep(pcie->reset_gpio, 1); } ret = cdns_pcie_host_setup(rc, true); -- 2.39.2