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");