From patchwork Thu Oct 14 08:59:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 12558115 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 7132BC433EF for ; Thu, 14 Oct 2021 09:01:12 +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 427BF61152 for ; Thu, 14 Oct 2021 09:01:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 427BF61152 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=TQzPqWblnM66SA E3N4iT9sF/L842Bg+ixikmxDYW67GjqsgQ7a1b1bKnR7H6gltO3Ozqe+CtLOldRwvAuzJHw4HeuRn irFXqWbxFJfZ2fI7tgdiP657Neq8PXOgySe2J/lId3BAqi2ZIYKbblhGInRHzz+ZgI+RjVYWmdf4E nmcAxZRvgk7lGaqeUeQGDbmNjD/lCCxDQmkJB3agRYHMZvZkgCMAVHTMm6K/rXBc18GtDFnm9BIqk W5r9q0FqAKO8k4/8PuByrCAJnyuHf0SvfldGTRJSIToBZYHVVwyiJQbqrvv+/uzEkqFCMY5VO3aMd FNqiZVdAnIVWeKNLRwbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mawZv-002H6l-6Z; Thu, 14 Oct 2021 08:59:07 +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 1mawZS-002GzX-Lo for linux-arm-kernel@lists.infradead.org; Thu, 14 Oct 2021 08:58:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634201918; x=1665737918; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2SfxK57vRWHEZrPMMA/I/4JeY6YI1pn+Pq8lPJzvFYk=; b=p+N33KQQAGBjG/FlvgGDhBOwWWi79HKOJ5zLK1nPrPSb5n/goijWOimP c2d2w9IhByqeH2iAHD+7oZmyCCeXm4B683VPRVUxtaADK8FJ2Zgu9xhfo nmlWqNHSGUq6rNYyqeeTd4mTEgIUY1oiF/Bbsmsiou4AcayIuOzO3Tr59 jzXnFsEZG2x4RhufdQ333lnlXkW+3WRQIbMGDZlT3W3J1Qelwv5KLJBOq /HGQ+FMrOpDKxcLw1Xv7lmLIj+juzZ/qiGEeWJBHxpWCaTUd7MzUVXXxX UUhy5eZsro0eafnSW0o1TuHjd1ylLoQwcZl5Plqeam8kLU8qFUkiHtP0y Q==; IronPort-SDR: Qf/lBrOUwB/cqSFaTWYx9GBfFVfLWdJcXkZ5ReUrI1ZMY4Vk2fP2L47p7HGcTgo5UV9QtYw6dA LFOvSEPkDBKgDRbhbF2+aQvr0W8sreSQdUORJzeW825I1RxZA2cYsLkn/o/w/UE1DGD06Ib0P1 RgDFSJT6KaTJqMx4+32RNN0UK8x4Nbox1j+7NtXnkP2VhRp/cjpWTzyQVEh3/pYLz5CPuPk4eZ tHEFlo+pXLfaQJdS6NY0O5stxQKVOgsXCMlJlRMhJxlwnEvNb+B0LcyqhaLPuCqn1yC3MW4TGa lw8q2Gmxr1cMFLqzOs+gZwll X-IronPort-AV: E=Sophos;i="5.85,372,1624345200"; d="scan'208";a="132960570" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Oct 2021 01:58:37 -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; Thu, 14 Oct 2021 01:58:37 -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; Thu, 14 Oct 2021 01:58:35 -0700 From: Horatiu Vultur To: , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH v3 2/2] pinctrl: microchip sgpio: use reset driver Date: Thu, 14 Oct 2021 10:59:29 +0200 Message-ID: <20211014085929.2579695-3-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211014085929.2579695-1-horatiu.vultur@microchip.com> References: <20211014085929.2579695-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-20211014_015838_798558_18EC282B X-CRM114-Status: GOOD ( 13.02 ) 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");