Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp651496rdb; Fri, 26 Jan 2024 06:54:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IFUAHICJppDF88VdaS5zhi2tYKYeYvdpPpjg/Aldp2GFwhlEgspuNFU/cgeuCv0XkVWTa2O X-Received: by 2002:a05:600c:1c9c:b0:40e:88ad:89f9 with SMTP id k28-20020a05600c1c9c00b0040e88ad89f9mr977232wms.89.1706280869367; Fri, 26 Jan 2024 06:54:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706280869; cv=pass; d=google.com; s=arc-20160816; b=kex71QXZ5l88EcUfQ3BwZVe/q/6fqM/inZTbUtSkHAsdC3ruUUTXEbCq44Gs+3SSAj z+xImqDqREfmYZN+t200UvyjdhL6uN0IMXL383OT18FVJvrbDea87Lh0CP2POpoTJi2k WPL/Y3v7E1Sbppd/hwBxBgFx4yM8gDzxfVuKPG7YG8GWLdbb4EWwz4lQK4DnVAAa7fJB 45YXQ+5/39eoRiEM5e+cxjfshkF5BCAUnYUAeuk4hH343gM+7ZXFQhuSfk7n8AqHKdQ3 9zSjhEVK0/8Ff1eUzrL0zYLD1L1Ek8F6P66H/EvcabC1zOscozd98W3ajEOtnsaLDl5A f1/Q== 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=0in7eUMCy1CUgdfa3NkgNoUarIRy00PjQmN5k2XOfW8=; fh=ihwxVJW8DyodhmdJo1IfhLUDNDWeXh+49SpWXYbpL2Y=; b=bFkdVkhtshBJ8iy6JgsyEtxFYN0Y8CetZSJK3ekg1OW+/qSTC8ZjVxtK2p5R+XlPPM MzOpKbsv/BpG3r9tZJIsjOOp2Mt/txajhphEA42gue88ZZ1ow0eaevMkk+4Zutgxti79 QDFIocjpOXm+rIyEmeXtfa7s7qdVO8ADaiP87ZcgAll/VHxvnSY2prC7DBI7/76oDB+T u5lRM/3EQuCb2aMPEBmz9otaDHR6A5Eg3J1VFwXcdAjnHUqQ4x1jMlC+J2ONVsB3pRjm szp74w7lrK2mtoDSDwW4L/iZVlPd78jDs2VSmmkBuR5omnlJfOiX5q1QoeNFIpMgDTyZ dQsA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=XDC7cnmS; 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-40213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40213-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l22-20020a170906079600b00a30f4e39fe1si629920ejc.782.2024.01.26.06.54.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 06:54:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=XDC7cnmS; 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-40213-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40213-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 am.mirrors.kernel.org (Postfix) with ESMTPS id CA5431F2A5DC for ; Fri, 26 Jan 2024 14:42:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0FEFF219F0; Fri, 26 Jan 2024 14:38:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="XDC7cnmS" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 B03E921107; Fri, 26 Jan 2024 14:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706279895; cv=none; b=rW/5SSd98+mk0fP3ML3hcaBmNwzD6QIepztaQ9W6kKza+UtTWxFXuHx1wF9+m6PigO5V+Oozzgx1gv/u7Lf3T4qq79imx47IymInxtg3KGxKMxPkHtz7GkIjPloHeCMsGJhSjLDhYbvflEDcwkaJ4zIPgHCOCQsh9itZ9ekPfhs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706279895; c=relaxed/simple; bh=nojq5nYUo0DZ/hdPX7i/iFjXrH0M0NPWbBoCjfRlmNI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=adCHHb4yMNuP8miiA3dqF+Yufu4B0UGTPrUkJ7R9l7wbyTaerbs5FpNmY61Dr4ai4LNVvpW/gPdQhbQvbIT+lZ04Ra7w8kkVcsSad9bVI2C31/Qh8h840o8306PB4NanLgNXiGrHiObtfmwrWzDR6tME85p70zU7HZdFTKVihoo= 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=XDC7cnmS; arc=none smtp.client-ip=217.70.183.194 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 A193640010; Fri, 26 Jan 2024 14:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706279891; 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=0in7eUMCy1CUgdfa3NkgNoUarIRy00PjQmN5k2XOfW8=; b=XDC7cnmSoyMATdXpU1tgJyrpCGrrYHdLBskthJV5CEbt+4EavYPPm6csGnBGXzgYekdVL8 E0BQ3R6CohJrEbsZ5/Jp78XV1Kf0+VloyBOdyiDXrEelIyOKn8DSXyzfCCF4ZoJy82Nsnc DLJQ726Avyas/qGdXAwuyxPzCSkeApHT20xNdPNcMKgnhn93AvbfW7dMDNouZTS3eG2ePZ 818Qvb7yNhR2wLyxK3JucldVg7POKnMmQGAx4CB6NhbIN5+Lq0Vq/Tw6YEM7MTx3tsXUUw DgvTId9KkB9BrkLAqWPBWdQarOBiBKqUq9Tie7n6H7+0gG4lqaM/sBOq1xWR7g== From: Thomas Richard Date: Fri, 26 Jan 2024 15:36:56 +0100 Subject: [PATCH v2 14/15] PCI: j721e: add reset GPIO to struct j721e_pcie 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-v2-14-8e4f7d228ec2@bootlin.com> References: <20240102-j7200-pcie-s2r-v2-0-8e4f7d228ec2@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v2-0-8e4f7d228ec2@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 Add reset GPIO to struct j721e_pcie, 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