From patchwork Wed Oct 13 08:42:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 12555513 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 8BFD4C433F5 for ; Wed, 13 Oct 2021 10:54:26 +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 517E160ED4 for ; Wed, 13 Oct 2021 10:54:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 517E160ED4 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=8UeF75VH6XVM7XhB+kc4kC5UWS5BOHULz7ktZ6b9tr4=; b=OUZHnozUBLAtmE XOXkmPYQMsg9YcfKotXg8IHLQF+TMc8SGos8FGqW2IMoWFBLRdmkJSa9cMnxs8JWDZeIM8pitdRxm m5e2eRJj1Gp62wKkQuiSz+CeEohwbsuI5l9SBCQtRxX/ivqP9z8TpXg/fJvBE612m7DdI8Emn7+jv BSYtWHh8mUHzyfuA61OaAuQ/Dps+b2xXDSaS5Wgd9bhoissb9AZqYFzjeVgZtBJ1gJV8hLLbxcwKg 60ouP0tfe48yy1kLe0mQ/wxmHUbj2uH4igm+/fUuFSMXkX+FXT4HpkNYZJnBXCvtRRdX4Wj9Bl9GU 0BYx3lv2S3yqKD+8b1dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mabrb-00G6vF-SO; Wed, 13 Oct 2021 10:52:02 +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 1maZpW-00FcYJ-3e for linux-arm-kernel@lists.infradead.org; Wed, 13 Oct 2021 08:41:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634114502; x=1665650502; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2SfxK57vRWHEZrPMMA/I/4JeY6YI1pn+Pq8lPJzvFYk=; b=RXbXkwEUYEM8pQ6TJMWG2AUKxzn8gQU2iHESbkvxzx5haFBRjtfga/kd 9Ja/GqmaCgcWjbRJlL4T6MTcrXiBjRR4K18jD+tzEjO8QP2WMsH4WceEi nFWFclQMMKFwhOSvavEEK5cJJFe1PrCQ5yOxVAoKMlIFr0tevwTRox1YR cjYSmlGZ7xsmujWof3kFpF/x6fDiXUqFA5ZNzXxNtfOxNcHlXI70QeWi0 Y9z0gjAg0i1kndkKV6G/281OHRzYgR35lSXJ7ihNezS7w0Go82og46EGs bYOImjPdCGH3vJnfBYcINWER3t5dl35Xm4ZZ4wmwDfEDFC1DZTgtbJGBO w==; IronPort-SDR: rRB1HVAnKZzbuOFDt3wOq3966HtGLzDXjFNbESo3l/cXxfc/HdD00t6L6fF4JOAUmgZ8FYYAUo cbwqE0cYaU0E17QyCDCElV9D+KCjPvTaMnIXcot0mWGaeGolt9K41mIIE7vMUKs7+qWi5qcIu/ RkrBMK1lcRfZGNxnA5HUXa3fw1EQOqwoZSX67SbrMfNzGdcBlcZjX9kaObZqHsu2t68fDLCml2 HIPUhyAK/qY8hjHR/hoTrvJbBjJLxAJ6PcDqZf19Joxlqc5yVhL38rm8WKT7ramXTb6orn+Rmm mjx5h3xJTp2wmwIm/d2xZfGi X-IronPort-AV: E=Sophos;i="5.85,370,1624345200"; d="scan'208";a="140121183" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 13 Oct 2021 01:41:41 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 13 Oct 2021 01:41:41 -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; Wed, 13 Oct 2021 01:41:39 -0700 From: Horatiu Vultur To: , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH v2 2/2] pinctrl: microchip sgpio: use reset driver Date: Wed, 13 Oct 2021 10:42:17 +0200 Message-ID: <20211013084217.2298553-3-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211013084217.2298553-1-horatiu.vultur@microchip.com> References: <20211013084217.2298553-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-20211013_014142_176730_2B4E6ECD X-CRM114-Status: GOOD ( 13.73 ) 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");