From patchwork Fri Oct 15 14:42:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 12562231 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 1C74EC433F5 for ; Fri, 15 Oct 2021 14:52:45 +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 E1FC960E97 for ; Fri, 15 Oct 2021 14:52:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E1FC960E97 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=/fo46DPIQ2uW1k39VXDfKHuCosvq1g5ieLB936UglAQ=; b=FSjGOwxc8hqC4c K49bsqg2NC9Vpd3rUECBatr/vTRotS5pH5OTZL9llkQnrHzvKbYc8efJ5lhveInoT4N0cVbmApUze w6a0Aev/2Ao++qMehJLtstV4/tE2VfbJis1WKdNnZrc9g3AjvW/H0qqbMGHW2UHogRu5aSGLRzxDX N17u1NSrEcs/4YWHbKYzbMIpcnzBAv6G7+xTx/ctd3LznGoLkOpkvXqcdb4N2QTLDXbDMau5wq/Gd fvAjoBu92g54bNDaA5OEVftt78hnqfqyLQsSwJyZU2T6HkIzqzcf/DW0qcqi0tBb4LvgoNfGj90/H t3Dz1EcMkBSHglJjRZ2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOXw-007j5F-5K; Fri, 15 Oct 2021 14:50:57 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbOP5-007fxF-14 for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 14:41:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634308906; x=1665844906; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZI+/jkZ9HIZYKKCL9WS4VRlk6uYGVABKF2GuTEy4CUE=; b=Od07SKp+OxPbztlkIgz0qfJixFLPv2CTXTYF9x1AKUqzKH21/IQ0cXs0 6pR+Yc4j63d/DcEC+h5E9SANm9UC/u6yQ8QcnOGSVAgcQVpOH3WUKVdK6 1Bo5aRwbAPNJxWylQkAWYzWRpV88ufx/yEs5245prlqEhk+xUvnVlfKWr VPZbppd+YR+uBWqFY9yLGb6JEIHpzsJQzq1QhXDB5xC9gVgzpc0yxfBdY gcR4JEheMZdpJXM6Wci0qtRzexhQ9+7eq3El4JfIBD7Csg10fvAJpm4DL NAjHV35GytSE1u/BfUshgay6kpnzv6hn4yjTcUxQ6K+yqOriml3SIPohA g==; IronPort-SDR: S8bnbHJKd3hnY5GMO5mf0j15bYEjdtGA0FRN7vUuRYfPuOEbYEmldYEhPaE4q02mT8NxSewEBJ 6VPnuKEGczpqHX3BCPbl9Z8+vPjlYh/yC4trEMNZQLE9Bu9SFcUdO+oTqXHB2+BlV2fpnCCLkP jFsktz8LzOJtqKGlUyqIFsXY4rbWzVLIvgtzzRVjP2XWY9L3jVdoq4/ZUpOQK6TDfh2S+hr4nT TI4nLhT1HCISWHmay4QKzz17C3S6bgCsjWn7IyChAUuyzBN54UxmfX/fAKftTvF7V+9H+dHhDE Tw3L9B7paliSNcDFzZQZyMGY X-IronPort-AV: E=Sophos;i="5.85,376,1624345200"; d="scan'208";a="140437677" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Oct 2021 07:41:45 -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:44 -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:42 -0700 From: Horatiu Vultur To: , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH v5 1/2] dt-bindings: pinctrl: pinctrl-microchip-sgpio: Add reset binding Date: Fri, 15 Oct 2021 16:42:58 +0200 Message-ID: <20211015144259.219909-2-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_074147_111638_0C259634 X-CRM114-Status: UNSURE ( 8.30 ) X-CRM114-Notice: Please train this message. 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 This describes the new binding which allows to call a reset driver from the pinctrl-microchip-sgpio driver. Signed-off-by: Horatiu Vultur --- .../devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml b/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml index 4fe35e650909..b0b7d02a57e0 100644 --- a/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml +++ b/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml @@ -68,6 +68,9 @@ properties: clock, and larger than zero. default: 12500000 + resets: + maxItems: 1 + patternProperties: "^gpio@[0-1]$": type: object 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");