From patchwork Fri Oct 15 14:42:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 12562247 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 72CAAC433FE for ; Fri, 15 Oct 2021 14:53:53 +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 476F9611C3 for ; Fri, 15 Oct 2021 14:53:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 476F9611C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com 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: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l4fE/YU2otF+rxH3k2t0a4tDwmkJUaFmoPCWe9RxPsA=; b=R8IAGzfKaY2yLT QZ+WlIJTH5j+bByOvjKYykI2QxMk1L0qRbqRsPnjguoU/sx+B3jj2irqt99rZgnc5NWy9yVHAqJ4D GumKGPR3Q15TRHCqWHArryYSRhdTU3bnzBl6hRGsMhDNyjL+OWAiZguSrh9HOH0MmLuDb09agE2pm jsMdatFb/KPgQKxZXzVaLtuyguafIFhCKQA8eb/wG77t8Izu7yHeVGGp349R2imB86ur6cHHuRvUU xZ7LqCJMeZX1t5Q0EsqgIRO34zFe5ZpbWWckvxAoK5EqbRdlGW78ccCA/EaILNQJtGJglPH70qRyQ gn/NrA3EHuu6ImFBXgVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOYx-007jQg-WD; Fri, 15 Oct 2021 14:52:00 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOP6-007fy5-Mq for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 14:41:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634308908; x=1665844908; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9tJXikfeFqXFLvozQFAnutFEBzkbc2DDc4AO1Qx2cbM=; b=UsQdzRnaBhFZnNEg1Y5KDI/eHp6ri+mWpO95TE1+RHVLd39/V1CAt2Vf GHEEv4b13WT4GWuZZkf6ScNCwTB5jYNVpDF+XJnw77g3MwTfbxrUvJlnw PyTSMRws0ZTO7sPg3Mw9JsZT/lDGtEPCN4bVc8yhYtTx2cPBvtyvg3qTy OtKEGUNSu+glDpyqM52noIpY78C9WqN6hH2VNX0lglEPmgekpr46oOwnE dva1CTih36lCJ8yys+dxwmCG2XxwsTnOXWyTqp9c0CVDsMthE6FZKi3+D NS2DIM14HIng5P9VrQTv4xYJnoS0VvrKJGQtZI8/VSTsFczjpGGUq0SqE g==; IronPort-SDR: W+oc4kns8kbpohM77eURWSvCXnQ6UdX23+EvT8brmt8ax1TGMenE7BPUKJ33A9JjOhlXJ/oxhd +gZmonQyr7MSTDy1Sq4Q3bWeTrBKdjrB3SKg2UaVhtKNg2620SRKcze96J+eVJKsGwNpqFcUWp yTWLDS2mQC0ld0iiH1UK1EY6VqXDfRRA0+XUlHm1WadT6ylpL0SJ9oshRXk4wUm7iEEmMRwsOz VPYERhwyZM4pG01Wd9QLdSkZbKt1Jzr97wOEbU2AU1Kgr9R9t+tTtZLj+qHAVhQjfSB+ogG+q8 ByTikYQwE4jMLgqBRXpJf8Zr X-IronPort-AV: E=Sophos;i="5.85,376,1624345200"; d="scan'208";a="135665731" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Oct 2021 07:41:47 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Fri, 15 Oct 2021 07:41:46 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 15 Oct 2021 07:41:44 -0700 From: Horatiu Vultur To: , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH v5 2/2] pinctrl: microchip sgpio: use reset driver Date: Fri, 15 Oct 2021 16:42:59 +0200 Message-ID: <20211015144259.219909-3-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211015144259.219909-1-horatiu.vultur@microchip.com> References: <20211015144259.219909-1-horatiu.vultur@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211015_074148_885996_267C2E85 X-CRM114-Status: GOOD ( 12.63 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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..529808c5af18 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, NULL); + 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");