From patchwork Tue Oct 12 12:24:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 12552391 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 41CC1C433EF for ; Tue, 12 Oct 2021 12:25:22 +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 0BB21610EA for ; Tue, 12 Oct 2021 12:25:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0BB21610EA 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: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:In-Reply-To:References: List-Owner; bh=8UeF75VH6XVM7XhB+kc4kC5UWS5BOHULz7ktZ6b9tr4=; b=b8A87/Vef1eniw cKQk22cF1eiPSrEaFNg+D28mOW/OEdF+MoeSyitvI9vBMNfopglSRRlEmsBjHFqQLOCsKwmblYh3p IlzTEanK7mabBAPW3Da437OcF1Tjh91Q9desUiAh++J6ZUWBp6tpBBanAhzy6ryqWXSK49Q+mbZCb aDxq3kQ9sODtmyPFSYXc4FjEX7C8A0luUfaVer4ybFRTkDSBoNWbbU08CQMli/jy6FZyO2Faw7PWx DNowJEQwWcZ+8qjGdBFy17bocnGZQQ0cc3uPT1GQGUCs/FDWy+42q05mCyd9WJpdTX52vMm0m6e3z 9DXoZQ7zXpsX3wong2cg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1maGoP-00CkdR-08; Tue, 12 Oct 2021 12:23:17 +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 1maGoI-00Ckcl-IK for linux-arm-kernel@lists.infradead.org; Tue, 12 Oct 2021 12:23:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634041391; x=1665577391; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2SfxK57vRWHEZrPMMA/I/4JeY6YI1pn+Pq8lPJzvFYk=; b=jwK7rMZ2qC6oQYPDh5RAi5ixNdCJ4EkgijPOBsN8yFRnNCwCwhoE+QHg BCq2cfIQQ6iteH5rktmMFym7wJyn0fqdw3iJPfgTc+eLTdXC4gURvTpF+ EtwpIT1YAOdAZYIdw5Z3ta70BgfOR1aX9C6lFfD+wm230QjJ+SmxM4Cyo oxfh71ZPCtF3zMKoGmTIOXc7AHjqD0NZ0XhSM9Jbklt6c3gP5U5nf5gO4 MPfOB47T4wgrxTkJcQkElG7N2HQXDXQdZ3F3AsdoaAC/DKDJ3thQbcEGp AkO8LByH+mbrEETNosdLXp+Bjr0xq4elaKTy6Q2lVO29hlGpcxc+diAU6 Q==; IronPort-SDR: kUJmdcpXewFX2mpXw7sJ01Se7cqsg36TfUOlLLul1+v9j472YREF+WdaT8kXO7Q5CKyaRDoblo 5b9Kix/6QfsSlXlCN4Kuv5DPfqkMlySUCazsy7mhiy/6kZnukjRd3f+1tVSbHux2wjY3RpR0pM IlyvPAvjBclwBCWs3WaDwRGXIDxmCIX7cvQgo7t6av0w2Fwpqiw3FuKI87FpDYfsWP/Ytav0JJ cIzztCGMkZfRYO2zxIKS8OZHm14YNCUQwmjx8YkcCghqiOUe8me1Y7aPdG8AfcN5VGSdbZhS2V F1mG0CftwcukEwTnd5D4rV+Y X-IronPort-AV: E=Sophos;i="5.85,367,1624345200"; d="scan'208";a="139400192" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 12 Oct 2021 05:23:10 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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; Tue, 12 Oct 2021 05:23:08 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 12 Oct 2021 05:23:07 -0700 From: Horatiu Vultur To: , , , , , , , CC: Horatiu Vultur Subject: [PATCH] pinctrl: microchip sgpio: use reset driver Date: Tue, 12 Oct 2021 14:24:35 +0200 Message-ID: <20211012122435.2081930-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211012_052310_656316_C8DA5507 X-CRM114-Status: GOOD ( 13.03 ) 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pinctrl/pinctrl-microchip-sgpio.c b/drivers/pinctrl/pinctrl-microchip-sgpio.c index 072bccdea2a5..e8a91d0824cb 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,10 @@ static int microchip_sgpio_probe(struct platform_device *pdev) priv->dev = dev; + reset = devm_reset_control_get_shared(&pdev->dev, "switch"); + if (!IS_ERR(reset)) + 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");