From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46A27C433FE for ; Fri, 8 Apr 2022 14:47:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YnD19bN+/R00T4wKky7NxkmLvl3C9YcgbQSurc05uA8=; b=1g9/6wF7mcl7IB RbvUWULpWjgmZy6chaSy16DBAlvrIhFrgRbtOxkZBf630bv1vkTH80OAy6CpxeWaU+O/QAHfKxhXH VK6xpVM9FIwyF1miCevUHV7EknnylC+//J7v0GhFau8FeRE5sop881r7/aZsmWh5kEZZ16oZjRm/j 8hmtCO4cdYYEjz4DJR0UECDuKQsaw23j1RIrpnuy4PDJoMRd17hIic9X+5HwsElBNaMJmJrVYfNJp pf0s/1V+LuS2vxtdcEng60Ml6oqlKz9CVR6W4GKlp8I6fT+NCAJUm2JsbTQjkAgwut69O2yXgEQF0 0xz88JO2gcz6FQqT4ZdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncpst-0003P5-09; Fri, 08 Apr 2022 14:46:47 +0000 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncpso-0003Ml-6B for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2022 14:46:46 +0000 Received: by mail-ot1-x336.google.com with SMTP id z9-20020a05683020c900b005b22bf41872so6223414otq.13 for ; Fri, 08 Apr 2022 07:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=usp.br; s=usp-google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=nQma87vV/Spb3EZ0EqoG0KuNOfA00UbBpa4tPzu13w4=; b=zKXvr1U1vJ2BY4adOfDdjAJGxk2u66if55H7yv6F7ERih3Mo1tiNVTDguvb8L0AGqt SbshL1YV9SfW+AqHfYM0/890CJEQbhQJmeN0pNi3MB1yB4u3xC6d2xHWRiLLJHmpUcfI s+wkBvD46AjcAl9xhnxNQ72p7fj85AEx8g2Qe/PX3lquC/1NYed6S+TAVVTszij330MZ j5O0ZMMACctYrjKtvPO7uPPr2oqxdHnZCVNrKpmIrqIu6Rfnky+FT4zQxfVRDNAMhqtA OsqSppfbcjzCQGzbOKZDzEXfR+Su6V2WUxzq+2EkaEPhFwsKIqlfANbMPcgmvOR4jYh8 FUbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=nQma87vV/Spb3EZ0EqoG0KuNOfA00UbBpa4tPzu13w4=; b=lGqbyDjjHF4d8caNxF67fC96jZyqLFoDwbL5qhDyYVHrGhkRtg1j2O0dYsb/D90bGa 8xYC9QCreAn/ntJiHvszG+cRIra4BmLz0Ox9Y8bXZRh2LBAzAXMe2wg4Ei9MZvSXn+YJ H14k/fe4M+UZUUNZ8qYa0OqTzWi/29Rry0NR1v543M19yEWBfI8qoZLZHO+pP548xI3i ZAQc+PvysSFSyFfliW5Mg12/zl/dALTaKKAjWpGwEV+2i+pUIBHGtdDs6VNz6xG09G1T 83w+WCJzUXD1Ggs/pBIou3FmUextpbm9XQK5pPqjQ8PNVWCmwboJxgwfmaGyx/AaMXBq omtA== X-Gm-Message-State: AOAM530/MilYU+IgOQFmXs3Ro/vmQmtCjYmm4dnFalNh8o/m/7tD/DOa LztoZLOFPegwvoMvHfKz4Bz2Hw== X-Google-Smtp-Source: ABdhPJy0DT+OtOqa+Z/SPqsxkKlELAYaxgVGZcL3+NgXfK/cboKKfEkv3MyaT0cTLrKwpHj0LXo/WA== X-Received: by 2002:a9d:1729:0:b0:5b2:3828:c84c with SMTP id i41-20020a9d1729000000b005b23828c84cmr6922455ota.362.1649429198659; Fri, 08 Apr 2022 07:46:38 -0700 (PDT) Received: from fedora ([2804:14d:8084:84c6:2e13:8e30:84f7:1597]) by smtp.gmail.com with ESMTPSA id r3-20020aca4403000000b002ecf4d70c83sm8620617oia.27.2022.04.08.07.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Apr 2022 07:46:38 -0700 (PDT) Date: Fri, 8 Apr 2022 11:46:32 -0300 From: =?iso-8859-1?Q?Ma=EDra?= Canal To: Lorenzo Pieralisi Cc: l.stach@pengutronix.de, hongxing.zhu@nxp.com, robh@kernel.org, bhelgaas@google.com, helgaas@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, linux-imx@nxp.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] PCI: imx6: Replace legacy gpio interface for gpiod interface Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220408_074643_685580_7E8D7B44 X-CRM114-Status: GOOD ( 26.80 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 08, 2022 at 03:23:39PM +0100, Lorenzo Pieralisi wrote: > On Mon, Nov 01, 2021 at 10:03:11PM -0300, Ma=EDra Canal wrote: > > Considering the current transition of the GPIO subsystem, remove all > > dependencies of the legacy GPIO interface (linux/gpio.h and linux > > /of_gpio.h) and replace it with the descriptor-based GPIO approach. > > = > > Signed-off-by: Ma=EDra Canal > > --- > > V1 -> V2: Rewrite commit log and subject line to match PCI subsystem st= andard > > V2 -> v3: Change gpiod_set_value_cansleep for gpiod_set_raw_value_cansl= eep > > --- > > drivers/pci/controller/dwc/pci-imx6.c | 30 +++++++++------------------ > > 1 file changed, 10 insertions(+), 20 deletions(-) > = > Maira, Lucas, > = > what's this patch status ? Please let me know. Lorenzo, Thank you for the feedback. Since I sent v3, I didn't get any feedback from= the community. If you have any feedback, I would gladly work on it. Thanks, Ma=EDra Canal > = > Thanks, > Lorenzo > = > > diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/contro= ller/dwc/pci-imx6.c > > index 80fc98acf097..f08865ac0b40 100644 > > --- a/drivers/pci/controller/dwc/pci-imx6.c > > +++ b/drivers/pci/controller/dwc/pci-imx6.c > > @@ -11,13 +11,12 @@ > > #include > > #include > > #include > > -#include > > +#include > > #include > > #include > > #include > > #include > > #include > > -#include > > #include > > #include > > #include > > @@ -63,7 +62,7 @@ struct imx6_pcie_drvdata { > > = > > struct imx6_pcie { > > struct dw_pcie *pci; > > - int reset_gpio; > > + struct gpio_desc *reset_gpio; > > bool gpio_active_high; > > struct clk *pcie_bus; > > struct clk *pcie_phy; > > @@ -526,11 +525,11 @@ static void imx6_pcie_deassert_core_reset(struct = imx6_pcie *imx6_pcie) > > usleep_range(200, 500); > > = > > /* Some boards don't have PCIe reset GPIO. */ > > - if (gpio_is_valid(imx6_pcie->reset_gpio)) { > > - gpio_set_value_cansleep(imx6_pcie->reset_gpio, > > + if (imx6_pcie->reset_gpio) { > > + gpiod_set_raw_value_cansleep(imx6_pcie->reset_gpio, > > imx6_pcie->gpio_active_high); > > msleep(100); > > - gpio_set_value_cansleep(imx6_pcie->reset_gpio, > > + gpiod_set_raw_value_cansleep(imx6_pcie->reset_gpio, > > !imx6_pcie->gpio_active_high); > > } > > = > > @@ -1025,22 +1024,13 @@ static int imx6_pcie_probe(struct platform_devi= ce *pdev) > > return PTR_ERR(pci->dbi_base); > > = > > /* Fetch GPIOs */ > > - imx6_pcie->reset_gpio =3D of_get_named_gpio(node, "reset-gpio", 0); > > imx6_pcie->gpio_active_high =3D of_property_read_bool(node, > > "reset-gpio-active-high"); > > - if (gpio_is_valid(imx6_pcie->reset_gpio)) { > > - ret =3D 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 =3D=3D -EPROBE_DEFER) { > > - return imx6_pcie->reset_gpio; > > - } > > + imx6_pcie->reset_gpio =3D devm_gpiod_get_optional(dev, "reset", > > + imx6_pcie->gpio_active_high ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW); > > + if (IS_ERR(imx6_pcie->reset_gpio)) > > + return dev_err_probe(dev, PTR_ERR(imx6_pcie->reset_gpio), > > + "unable to get reset gpio\n"); > > = > > /* Fetch clocks */ > > imx6_pcie->pcie_phy =3D devm_clk_get(dev, "pcie_phy"); > > -- = > > 2.31.1 > > = _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel