Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp236667lqa; Fri, 26 Apr 2024 23:44:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUshliaVW5+1yZSh0lWPB+pzLKifPs3/1e59QPBKZ4ak4tJlIpJMIqMnSzYp6KQrwpNCxo5F/utMqJ4D28jQea1rngfrXzAEyhRqjaHSQ== X-Google-Smtp-Source: AGHT+IFbGYFC0cmz7FoSgC+zD6kBtz8YuJvHOMVXYqA6fjlVUN0NlkVpT7N73NCIaieRtY5xiFpU X-Received: by 2002:a05:6808:6c9:b0:3c8:533d:3e9c with SMTP id m9-20020a05680806c900b003c8533d3e9cmr4766147oih.13.1714200240385; Fri, 26 Apr 2024 23:44:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714200240; cv=pass; d=google.com; s=arc-20160816; b=XpCmOhZaohjj8rukdPzak3yhuCicIuH+ikuYaOYxI+3MpWmeRKFteR42JyQVCQPQrI JsOCSyyWU1n8N2VY/H2lMRRs9Gyd4X1HyDWuyOM3eQg3NNbmwGFHkpSj7d6ZZo0pAQiR XlH+hOdx6JC38QqZv+D1I2nyq7M52v3gq17BHTmtArrmMLvYffmh9lfhJOLGrqjaDo8Y TakwNJDPcOo/03D8qk8PIG0W/7x2qE5k+eaUeCvEowFyvXhDQ6s01Hn/cI4b4oMgTXaH sOdNAhirqk74EiWB9n6pHdug44wWUphkXBEHrwbX7seDXbny0bRnagjRWkPKWsowr07i Vdqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eTGnh4hJsxF2w2JcjcnIEUBbWbOx1xRb7gasYjxARjc=; fh=n0FX9WBlYfPk89t8iXyU7rVSLi5CEYNV1761kNXoHqQ=; b=0klu3T9YavOM8ah4axbzoPEMX7r7awcOvA8TjRFVtGG22I0ZPzp8CONvWrV4BMevJZ BMqtjsccAFO/0sYwArDg/gvWJwdYH0lL3tfF73AM3r0w8FyGppS/SiThrMVxvhN74nat enWdGtu3HIamcbVbjkTsGVRWf6xMANiTt7G2pdhupKZRgWCYQ9tPUBKizjXQGlrpVF1L OFhIPuaR8h7+Il6ZDLVCPZ+GYvuk9F4SEkAyS68dgzLhTylD/7udEOklDNtv7s7NEqzF Wm+PJtjMd9642eulYQ8xkAEYF4wk37Vvxod3ThEY/qqhbW7rNZVonhnIuVc0odk+XKfQ DiwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nhlE4v8u; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-160925-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160925-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d13-20020a63d64d000000b005cdc5c9d6a2si16931166pgj.576.2024.04.26.23.43.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 23:44:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160925-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=@linaro.org header.s=google header.b=nhlE4v8u; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-160925-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160925-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 94F7BB21B74 for ; Sat, 27 Apr 2024 06:43:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B933042055; Sat, 27 Apr 2024 06:43:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nhlE4v8u" Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1BC3340861 for ; Sat, 27 Apr 2024 06:43:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714200224; cv=none; b=eBPNobDB45gl3LN17rFfuE7sVrNtrBVRcc532pnns4o3ECHYNYTTPDShpy64Y/28v5Kz607TsOOt0AYDsMnvLFkSHy6i4qc5xd7ryTJMgBtWpn4j+PMNrqCHjk8ETefVeZ5H/+a37u/v6udK0PC13m4seYaJrWGaX7P9aAktke8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714200224; c=relaxed/simple; bh=LPalAcWzxJ0yMmzch32JrWfIS3osx/TskoGrevHHB+I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VCPgt5GDtLFfXcQvdOchKW7JMFtxa/4Zf1/Y9fd4G94cygxdjfo6TWBfjeQAXK2jTcKjU9qoEYHHpewmUuIEsDbgahp7xOZZE6lpyrCrbIZHBFEoxufXV1YZ9xPmpx0XoP1YaJ4fLx+6tAvBWBVcmg54ySO2l219IadyVSAv4Rc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=nhlE4v8u; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1e651a9f3ffso16483975ad.1 for ; Fri, 26 Apr 2024 23:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714200222; x=1714805022; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=eTGnh4hJsxF2w2JcjcnIEUBbWbOx1xRb7gasYjxARjc=; b=nhlE4v8uXrRITTAz2S2QDw3PeQ4pWeCsq/RImGuBIbekxAa1CzHLpt88wd8YkSCnzj m/p25FWigh70lcWUBjikG1sBpak8ZEEjCpUx45P2DtaLkE3RqSTvHmyiE40IwMO0hT5J IfDIXU0LWqRe1K47KTRMZ/YKKOynz3XA7CsU/aHuOIfHQJFyKW5E9gk36mTVKhu/2kc9 FgpkIC823duU/jDf2ZHIHPKQPLk1G634V1aV2JVXUzFXNxAZdlu5pNiLMts83SCbxrsw 82pci51rxM7GSNGzuCN3SR32YdzvoHCEJbKpDm+73/iqeDZjuvkqCHQ5CSfVHHUEIxnL gpwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714200222; x=1714805022; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eTGnh4hJsxF2w2JcjcnIEUBbWbOx1xRb7gasYjxARjc=; b=K6eXQ9OhS+NVgd56vdV1FMgEFXVYwGfXRWk3G2ADSY2eMc6nnJiCeFpkVx1yOtMnWD y9CH2d9jd/g4HW6zy2nfUi79ctug1cTzYSllQKAmJ6Iy6pS5iAjJb52klJiSbRV9/lhu u9ZZkzhjWKCFc3T0NmUr7reh9+O+EeGHXnF5NJ2xilM6ZfVltz51WW5VJkmAy1+VyU4N qTedDnbun19KTnEtphveu0uB5sdqLXD7tbfnc5s1Zmea4VOnr/tV0grZk2ZnC23QWucL JyrQP+EFMvS8g76MPVl70ZRnkVYPnDiEdpNNTp8GRUw/JZd8zQ+F8vEPjFHJz5m540QZ UyCw== X-Forwarded-Encrypted: i=1; AJvYcCU9htvyWL3p8C5GqYtNCDFRM7cJnNLCk/ZztKb0dwVMvJ1x99ZLit2SKXfQmSrzCZYPgKRqiZZSEiVRI4FaaklUdMgUXSRPeuDsHsxp X-Gm-Message-State: AOJu0Yy5Pe0mY7Yc2+CETILhVhQ+kFKRVHd9tFZoml5xjEmHDPr2vyWk ODv9DByvLz4mXkEYanfOviXAejFCZg83ktk08uaTgDtX17W54ZzMZqWxd3IMnw== X-Received: by 2002:a17:903:240a:b0:1e9:6609:37d4 with SMTP id e10-20020a170903240a00b001e9660937d4mr6065899plo.9.1714200222300; Fri, 26 Apr 2024 23:43:42 -0700 (PDT) Received: from thinkpad ([120.60.53.237]) by smtp.gmail.com with ESMTPSA id b21-20020a170902d89500b001e44578dccasm16507119plz.254.2024.04.26.23.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 23:43:41 -0700 (PDT) Date: Sat, 27 Apr 2024 12:13:29 +0530 From: Manivannan Sadhasivam To: Andy Shevchenko Cc: Frank Li , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , linux-omap@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, Vignesh Raghavendra , Siddharth Vadapalli , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Yue Wang , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Xiaowei Song , Binghui Wang , Thierry Reding , Jonathan Hunter , Thomas Petazzoni , Pali =?iso-8859-1?Q?Roh=E1r?= Subject: Re: [PATCH v2 3/4] PCI: imx6: Convert to agnostic GPIO API Message-ID: <20240427064329.GB1981@thinkpad> References: <20240423172208.2723892-1-andriy.shevchenko@linux.intel.com> <20240423172208.2723892-4-andriy.shevchenko@linux.intel.com> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240423172208.2723892-4-andriy.shevchenko@linux.intel.com> On Tue, Apr 23, 2024 at 08:19:06PM +0300, Andy Shevchenko wrote: > The of_gpio.h is going to be removed. In preparation of that convert > the driver to the agnostic API. > > Signed-off-by: Andy Shevchenko Reviewed-by: Manivannan Sadhasivam - Mani > --- > drivers/pci/controller/dwc/pci-imx6.c | 37 ++++++++++----------------- > 1 file changed, 14 insertions(+), 23 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c > index 917c69edee1d..d620f1e1a43c 100644 > --- a/drivers/pci/controller/dwc/pci-imx6.c > +++ b/drivers/pci/controller/dwc/pci-imx6.c > @@ -11,14 +11,13 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > #include > #include > #include > -#include > #include > #include > #include > @@ -107,7 +106,7 @@ struct imx6_pcie_drvdata { > > struct imx6_pcie { > struct dw_pcie *pci; > - int reset_gpio; > + struct gpio_desc *reset_gpiod; > bool gpio_active_high; > bool link_is_up; > struct clk_bulk_data clks[IMX6_PCIE_MAX_CLKS]; > @@ -721,9 +720,8 @@ static void imx6_pcie_assert_core_reset(struct imx6_pcie *imx6_pcie) > } > > /* Some boards don't have PCIe reset GPIO. */ > - if (gpio_is_valid(imx6_pcie->reset_gpio)) > - gpio_set_value_cansleep(imx6_pcie->reset_gpio, > - imx6_pcie->gpio_active_high); > + gpiod_set_raw_value_cansleep(imx6_pcie->reset_gpiod, > + imx6_pcie->gpio_active_high); > } > > static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie) > @@ -771,10 +769,10 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie) > } > > /* Some boards don't have PCIe reset GPIO. */ > - if (gpio_is_valid(imx6_pcie->reset_gpio)) { > + if (imx6_pcie->reset_gpiod) { > msleep(100); > - gpio_set_value_cansleep(imx6_pcie->reset_gpio, > - !imx6_pcie->gpio_active_high); > + gpiod_set_raw_value_cansleep(imx6_pcie->reset_gpiod, > + !imx6_pcie->gpio_active_high); > /* Wait for 100ms after PERST# deassertion (PCIe r5.0, 6.6.1) */ > msleep(100); > } > @@ -1285,22 +1283,15 @@ static int imx6_pcie_probe(struct platform_device *pdev) > return PTR_ERR(pci->dbi_base); > > /* Fetch GPIOs */ > - imx6_pcie->reset_gpio = of_get_named_gpio(node, "reset-gpio", 0); > imx6_pcie->gpio_active_high = of_property_read_bool(node, > "reset-gpio-active-high"); > - if (gpio_is_valid(imx6_pcie->reset_gpio)) { > - ret = devm_gpio_request_one(dev, imx6_pcie->reset_gpio, > - imx6_pcie->gpio_active_high ? > - GPIOF_OUT_INIT_HIGH : > - GPIOF_OUT_INIT_LOW, > - "PCIe reset"); > - if (ret) { > - dev_err(dev, "unable to get reset gpio\n"); > - return ret; > - } > - } else if (imx6_pcie->reset_gpio == -EPROBE_DEFER) { > - return imx6_pcie->reset_gpio; > - } > + imx6_pcie->reset_gpiod = > + devm_gpiod_get_optional(dev, "reset", > + imx6_pcie->gpio_active_high ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW); > + if (IS_ERR(imx6_pcie->reset_gpiod)) > + return dev_err_probe(dev, PTR_ERR(imx6_pcie->reset_gpiod), > + "unable to get reset gpio\n"); > + gpiod_set_consumer_name(imx6_pcie->reset_gpiod, "PCIe reset"); > > if (imx6_pcie->drvdata->clks_cnt >= IMX6_PCIE_MAX_CLKS) > return dev_err_probe(dev, -ENOMEM, "clks_cnt is too big\n"); > -- > 2.43.0.rc1.1336.g36b5255a03ac > > -- மணிவண்ணன் சதாசிவம்