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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4ED7DC433F5 for ; Mon, 18 Oct 2021 11:03:16 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1D1516103C for ; Mon, 18 Oct 2021 11:03:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1D1516103C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pRuFgFNnDajzk+yp8FTOerh1u9salATk4ImiEipsZg0=; b=ZdXtMEJW8YNylu fHxGCb3PEzrntzan7oMhmzOBvjn170cjIyoS8Y3Cxyi62U68n1Fv05rLS4DSTehm2Gv/ymSkOAOnz q3cwT61YNnPCQZsLytysPwNOqBLErzZoAfbmTNuYDUcU7gIR+OYp1mGzraF6t302PcbhfqgfUqdn5 CluvpwPo2awbfe/ZB+YjjHaaGaSMas3LW7c+BHsB1EoR/2ysAvyQj+ax48Ffz71fyE22MACy2T43m Ju4y0GCWJKF7N7U6bZN5X7RYKEkzofX75gtl4266ECoF/tms0ggkKDIbifPEqKlWW8/IglF51Utzl MG38jelLHRJ+Qh+OaBGA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcQOY-00FCzl-GM; Mon, 18 Oct 2021 11:01:31 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcQ1J-00F3hk-8E for linux-arm-kernel@lists.infradead.org; Mon, 18 Oct 2021 10:37:31 +0000 Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mcQ1B-0002BW-0I; Mon, 18 Oct 2021 12:37:21 +0200 Received: from pza by lupine with local (Exim 4.92) (envelope-from ) id 1mcQ19-0005y0-Mz; Mon, 18 Oct 2021 12:37:19 +0200 Message-ID: <6f46c5ab7458e1368abfeb8dee6e24271f39d236.camel@pengutronix.de> Subject: Re: [PATCH v6 2/2] pinctrl: microchip sgpio: use reset driver From: Philipp Zabel To: Horatiu Vultur , linus.walleij@linaro.org, robh+dt@kernel.org, lars.povlsen@microchip.com, Steen.Hegelund@microchip.com, UNGLinuxDriver@microchip.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Mon, 18 Oct 2021 12:37:19 +0200 In-Reply-To: <20211018085754.1066056-3-horatiu.vultur@microchip.com> References: <20211018085754.1066056-1-horatiu.vultur@microchip.com> <20211018085754.1066056-3-horatiu.vultur@microchip.com> User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211018_033729_342522_EA78D016 X-CRM114-Status: GOOD ( 21.57 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Horatiu, On Mon, 2021-10-18 at 10:57 +0200, Horatiu Vultur wrote: > On lan966x platform when the switch gets reseted then also the sgpio > gets reseted. The fix for this is to extend also the sgpio driver to > call the reset driver which will be reseted only once by the first > driver that is probed. > > Signed-off-by: Horatiu Vultur > --- > drivers/pinctrl/pinctrl-microchip-sgpio.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/pinctrl/pinctrl-microchip-sgpio.c b/drivers/pinctrl/pinctrl-microchip-sgpio.c > index 072bccdea2a5..78765faa245a 100644 > --- a/drivers/pinctrl/pinctrl-microchip-sgpio.c > +++ b/drivers/pinctrl/pinctrl-microchip-sgpio.c > @@ -17,6 +17,7 @@ > #include > #include > #include > +#include > > #include "core.h" > #include "pinconf.h" > @@ -803,6 +804,7 @@ static int microchip_sgpio_probe(struct platform_device *pdev) > int div_clock = 0, ret, port, i, nbanks; > struct device *dev = &pdev->dev; > struct fwnode_handle *fwnode; > + struct reset_control *reset; > struct sgpio_priv *priv; > struct clk *clk; > u32 val; > @@ -813,6 +815,11 @@ static int microchip_sgpio_probe(struct platform_device *pdev) > > priv->dev = dev; > > + reset = devm_reset_control_get_optional_shared(&pdev->dev, "switch"); This is the first GPIO driver that I am aware of that requests a named reset control, so I'm still not sure if this should be called "switch" instead of "gpio" or just "reset", just in case there is a future model where the GPIO controller reset is not shared with the switch reset. > + if (IS_ERR(reset)) > + return dev_err_probe(dev, PTR_ERR(reset), "Failed to get reset\n"); > + reset_control_reset(reset); > + > clk = devm_clk_get(dev, NULL); > if (IS_ERR(clk)) > return dev_err_probe(dev, PTR_ERR(clk), "Failed to get clock\n"); But whichever name you choose, the code is Reviewed-by: Philipp Zabel regards Philipp _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel