From patchwork Fri Oct 15 13:25:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 12561543 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 AC1E9C433FE for ; Fri, 15 Oct 2021 13:26:43 +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 77CD1611C8 for ; Fri, 15 Oct 2021 13:26:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 77CD1611C8 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=4wxiw58hl0ajbt 5x5RlVZc05rdPc+jk5Tnf1FyPK8jJa9FJmaOR7zVN8KryniWKEaLno3Ql8ctbrDC+NR+K8fxxh6iR ZXEs3nInQXAp0lpDMzxn5ISteN6uWKLrCjz+mBh+mgJIUbOWFs3iYTZxkaGsM1XyUBIaD/6PdF0pB aHvRWLlPz3heUjP3MSI34wzZKGs5VAUDPJ3QwyyDg7kCwGslsJngXCIKq/3gmrjskIpMEdht1Q+PP PlQaW0VNfSXauBUEwJ7FszEBbzk6VKBXLqaUqrrmLtz8szzd5O5N4x+vm2Gw1ykaFD97XiLSQWjf5 F3AMgneP/u4twUhXBU8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbNDH-007C41-U3; Fri, 15 Oct 2021 13:25:32 +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 1mbND2-007Byi-K6 for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 13:25:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634304317; x=1665840317; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZI+/jkZ9HIZYKKCL9WS4VRlk6uYGVABKF2GuTEy4CUE=; b=sKnHnJbR/oNNYjoaoM6DNsHZELE2xAyFcNPvJ9PtE26hi8eGvNU+j+1I cJWHoIWZgFHUIv50zPv9rqNHpPl7iRJbGCJ83Vmtn23jybq2geZbhUwJn LwhRRrbZ3iCcDK4pZ/paz/yG/5VXFehAieOt506/BjzvW7NjJjg89Iudk /+hHE6E/ccDSBNe+OItt2Cuhih3+lJAL9rsJ5xYeRjzblv9QJ1/gYr00J TEQXYmc73gbBzKtVl4C0jR7L84QvTxSOdSE9qjF5RDGnJ+zaiE6HVz0P7 jSnIUhuKTuxx1O+4SBWRqN6udS4y/nvxf5Acnd64MPc/9Ia5Ty13vqiIi w==; IronPort-SDR: qFXocuqBaVCSHxtzsPmpntoZ1+upS3uKNp6Gewag9vl0UxuyAa2jT5uVQDWQPPAn/gcXF1DP2l dgoznQOhnIyM6qH4/j4fcV/v7OPDrSrBhoRi3vDxLtLoItkOZ++4vTMSdRJiOXUDzRZHDjAQx6 sTV3JPuKV/Al9QZe+z9+WDthVnnVYFoTG6IE49McWhmegenOV3wRbjV5iGyQJ+n6dSvo7JLAPp hLNYCpGTZB027rxYqVASmRklvA/uWR6B9I3Fa3Ov6ASi0xsrdeey4rPbHiYkJPSLz2XY1u31Bp P/O0iI1EIu+eLdHru1kh7TBI X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="139843060" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Oct 2021 06:25:16 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) 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 06:25:14 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 15 Oct 2021 06:25:12 -0700 From: Horatiu Vultur To: , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH v4 1/2] dt-bindings: pinctrl: pinctrl-microchip-sgpio: Add reset binding Date: Fri, 15 Oct 2021 15:25:25 +0200 Message-ID: <20211015132526.200816-2-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211015132526.200816-1-horatiu.vultur@microchip.com> References: <20211015132526.200816-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_062516_693670_6AD3B006 X-CRM114-Status: UNSURE ( 8.31 ) 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 13:25:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 12561547 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 99CE9C433F5 for ; Fri, 15 Oct 2021 13:27:01 +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 62B3661151 for ; Fri, 15 Oct 2021 13:27:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 62B3661151 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=o+6jOPLAfeWhKaV0KJKo0QDg1FOaEM3wlrD5l7RzGxY=; b=0z6/a14jlon7OK qoMjhC44TLmMd8u3d0Di7BUaVQBma9rKG81O0rHZOtI3DHSaOLPDDT+RtkCTtFcaHs9x12uULuW6e v/Jm6Q/kHF+720PYq5VRYBUs3+NFpbD7s+UFzYfVmR9ikDx+wJi460CLaSIsE6qgKF4nvcSSsr0gU iVQCsGKrujsJHzNbmkgTgMh0Tfuc3++haejFZGJ4VJH+ZliXr4JSsvQSv2NkjFtgD9GftKnWSrYaw n13+fWnTqbD3CcKt1u4gs/ZzmRMkqJZRHyqphnNqOjQTr7UU090CWsC6D0Yr0fAAacmVq5GsAsuhF JrFR+k24rBnM8G1UEyIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbNDS-007C7D-F0; Fri, 15 Oct 2021 13:25:42 +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 1mbND4-007ByD-De for linux-arm-kernel@lists.infradead.org; Fri, 15 Oct 2021 13:25:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634304318; x=1665840318; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ztoqgqQaf0S6laz4BagIDcZq+SkBeBXQipu6xdcNRDM=; b=L/k3dWoGED277KhLJZOrvpUkbJJ4JCpk1q+i9OLvBiH3vCP78i0cL/Ii Lj6zzKJbpzCqudT8cs6eZ3wfimtKfzJtjTETivwyq1HW9FJyas0NSDTN7 wgapWwp6Xgivbl9XDgDI3hZG+FqMfcghswnNP+GMoypjuoBOWdKFwP37I Rt8xdIM/l2saYqVtgcUXajvYyZBVvOhgegQ7YpYZIV4bi3I2WBqqx1HFJ h1oeZAy/LdVU35lg/4lJpFRDM1UsxC8HwNRwykWumdX+IpHixFz7Y1VfW 6sz2A3Rw+Tqtvn4y+fp7sA8w0fprXEk2dmZko7gTPmSuawm4iihm9YsTa w==; IronPort-SDR: 6jy7qIJYIv4MHZN6f7DhDOJLfn8aniG64iZCZJ4S0Y9ZNI3L3MYyqZJ14RlvYit/y6HCIvnLqH TH7w7jKG+qEl626uB24XkkL89sqzX7JdxLNVqpfC3iSAybbkSqVy+wCGzME4Nftmsb71CNysVh YX4LAYbuwyG16fl3R4NxL0CN1XjTE01E9tphd0W5KZn5cS+1vWkW3MhPf7T89CoqitYek4s0t7 ReavjlwEvSd7YGbEyLIn+lMU/84sDGefrGt3wZwTdnTrUnwSoeJTE+31UuD/k6xNcnTP2CUzcS Qyt2vmMWTc0tSqHPNoiOj74/ X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="73075277" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 15 Oct 2021 06:25:17 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) 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 06:25:17 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Fri, 15 Oct 2021 06:25:15 -0700 From: Horatiu Vultur To: , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH v4 2/2] pinctrl: microchip sgpio: use reset driver Date: Fri, 15 Oct 2021 15:25:26 +0200 Message-ID: <20211015132526.200816-3-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211015132526.200816-1-horatiu.vultur@microchip.com> References: <20211015132526.200816-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_062518_571569_97C7DD43 X-CRM114-Status: GOOD ( 12.82 ) 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pinctrl/pinctrl-microchip-sgpio.c b/drivers/pinctrl/pinctrl-microchip-sgpio.c index 072bccdea2a5..23f5a744edc4 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,9 @@ static int microchip_sgpio_probe(struct platform_device *pdev) priv->dev = dev; + reset = devm_reset_control_get_optional_shared(&pdev->dev, NULL); + 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");