Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp543852rdb; Thu, 15 Feb 2024 07:52:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX0M//kB6+gJtBwbtEq2IxmxMO2gR7AFOgL4l2Qacfk5l6SYOsgTxzjl5R/WNNq6+7BF9193wEgdfb5cAI1dnNNg5yJwR9xK8WQp0THVA== X-Google-Smtp-Source: AGHT+IFML7eo5X60yfy1H2KZo9vqbXQqWmGw+gffsewDbKFwhexOodzWluxhQJF1pBp6eXFpJxxb X-Received: by 2002:a05:6a21:1789:b0:19e:4e58:4f04 with SMTP id nx9-20020a056a21178900b0019e4e584f04mr3140710pzb.61.1708012374447; Thu, 15 Feb 2024 07:52:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708012374; cv=pass; d=google.com; s=arc-20160816; b=skx8hV18Wr1V7Ub14qw+LaEYXatgz7GeZ5hVCWvNrW3kWBKlTOWHXRRIfmM5PVaWi+ ulQ4m0Ol+K5XTJFlRv0r0L57x4qwUGBOlX3+DICnJDdPechKrbZmHEJM/StVvdVMMYiG ONMpJ560dfG6NnhK2E2kvrIP8Ne1O84v+aAvVzN3r6vOvQaIlQnStTBYM+iCUCzgwNbS WWO3FB+/TdgKMO3f9CRzJbFOGWAUyxVW+rBuuxQGvMsklOi181Wmq15zNx2duBJM+ky4 fqPmvrf9J+8mSWVIJa81VPPDVweY8tqpoBCgRIipKTwDWEmNP3XQVNAzd48PtixS0tAf BMrg== 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=u4vVCbZCdjErPKHgNoTCllAMtn9YdU2fnFLAQjECyy8=; fh=wHZQkXie84v2FP+2z7dUEuyvptHwnAyqgx34WxJkhrY=; b=y0uzZiELShhfgvQOOCrkc11rilres2p6AonXxdQNtvvueMuXJPlnWh9eAl0q8JYtEW qTkwrBwvMf2Yj6eVGGhJONx+7dFQ8TS2FA1KO2qLn0oBV2W6U9IKej1gmmhXvi0fs399 PpIG/mLr+he0X2yunykruMyam8FyGAZaya1x2KsFqfNRY//tkVk6auM7Ip7ebK5nzMTo 18G5BwgY8Ha0f3o9dLxHoMv3CYvY0nSVXCfMJC+shgDzeHFdzto32EoD3yproQc4kJGZ ylqpBm56+C4WIBzViRS+0XxV3N2xOIOS4u4utu1yCFpGp9thcSW3jMTuLyUE/i3/vaOq cdxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=CTlTRNho; 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-67165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67165-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 be9-20020a056a001f0900b006e0d3db5fb9si1337132pfb.92.2024.02.15.07.52.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 07:52:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-67165-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=CTlTRNho; 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-67165-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-67165-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 2F7EAB2D37D for ; Thu, 15 Feb 2024 15:23:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 71C871384B1; Thu, 15 Feb 2024 15:18:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="CTlTRNho" 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 147E81369B1; Thu, 15 Feb 2024 15:18:19 +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=1708010302; cv=none; b=HNEvr2CSTzmss5GKp0VLH6p/tSy0cIZGZctMiRbf+6BQJWIoLbsbYgyl0n7C1U9OEsRvKh/zYTEIecMGg5wVWZ6ZjwJlIjVGE0UJPmrTSATz+scHhPHBOmeh7CyJLHTY7tTG4TdSkVZH4jaqSw2Mjso+u9z5prAbVJM36ceQPDY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708010302; c=relaxed/simple; bh=2TFlPyM41Sf4t4xii6hgp5vJ3GALCdhGjxyGeqMQFvc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MUtl/YDu0cQ9YUHNU8cAs7hCjcoE0pfOrPq6vAI37wDfX45Vkrjdtt15oSdEt3Iq2mQyE7OUleRRsoy8F12X/Fp4bYa/ZjofUHXDh+MtNqM4097RFhsQrLsW05Cs47f7TQIkEZNI8kp1zSyA9OVSPrePyoz/pgeHhTv43nqcG3w= 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=CTlTRNho; 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 6C64E240014; Thu, 15 Feb 2024 15:18:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708010298; 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=u4vVCbZCdjErPKHgNoTCllAMtn9YdU2fnFLAQjECyy8=; b=CTlTRNhoSLbiKdNqJqJoTxW34TZblJl7HncADB4IKrF2CasieEf6kuQgLn8yrL5MPK1iCa TC4eUeby5RjZNaVO+ufcWQoVFvj5woDEEXH1dQZliElSIDEZ9B7I/vTUA3gtyWyUzeLcHM PtHAnIlk1C0zcWkR4E0wHTHxg+ZwDOSYvwCJZ/eWnll8wzZIqKTa9ClMG/cj/I+ktkwhrf NZXHgNJTkwGAkM9fjEDJeG0mjplmLiXVliAkBYXNEvfY0QhYx72LjBRY9tZNaaeP2zo5AI Q222yjhEVScLtF/CTQMpb7N3mTwxitYkUDAIvmOW83XHkfDwa3uWWbU0tnyv/w== From: Thomas Richard Date: Thu, 15 Feb 2024 16:18:02 +0100 Subject: [PATCH v3 17/18] 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-v3-17-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 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 2c87e7728a65..9c588e79f5ac 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); -- 2.39.2