From patchwork Thu Oct 14 08:59:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 12558113 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 8ACD4C433F5 for ; Thu, 14 Oct 2021 09:00:57 +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 5703861152 for ; Thu, 14 Oct 2021 09:00:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5703861152 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=/rjNWLLG8/ELrL6UkaR+A4atKk7ZlVltxggljfTnhOQ=; b=JEjrGRdh/TwFjQ 0ZaRXoZdAHU1pauNBoBIH0D9yfLAo8JHv3zFmzGWjLCXtkglE58C55lcHhcjJpxMo3i/tdaw8Kn9I axRm92g8r6+zfjSTXn06Qfagzyd0pnjDYW/6Es/v5fs+ZYw5NZGIlXc43HKg1ocuo99EamdgFSF3p XiCQlP4/WoNDI6/wHHYif1Y9Znb8nACe12O4rTB4P/CVUfPrf5d7Y+yqPFOJRKNv+ooAwI6Z0bAK/ OaJZ9t9ZJlN4g5Rpus6RNAk9woRApAZyJyP9thupJsnvOaNx59ISb0uVvDgkvRYvJtXdqGOGG8Jvg Zroxybn0L85AYInu37vA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mawZg-002H2y-UY; Thu, 14 Oct 2021 08:58:53 +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 1mawZQ-002Gyj-LZ for linux-arm-kernel@lists.infradead.org; Thu, 14 Oct 2021 08:58:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634201916; x=1665737916; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=x6ERzaviBGE9gRkQRs52lHzKzv/Gbwl17DQLyfGhip0=; b=Bz4H9ZPW6omPUdSlOsxLkljel9v5A+FzKKP6MMP6N5Wia1eujmEW3Cdf 0kE0lXbRZjIquqaB6KQvr48QXNN5ziIVxGv1hC/5tq0AORxzuNIX9CFsY ++4aifDHe3QYp2gKJf7APyY4pC6LwfuH1qHnTP8cLDNv3cMAw4aswAfsW RuCecuDfb8y1MFp2PZf0hCWGsbW15RV2AnXQuVgzfxucUYzlh3ciNMZyg +Lxlb+OqhiqaUqspDRNa3OfHaLbhouHC/ZsVYXj3x8G9EBZR4hdt0s4Nw sxO5rIPnhn7y8i68u8F2tddT5PzOX60tv+fWMnrK29PsPI5xQoFj+t0wI w==; IronPort-SDR: GPGDaDGJWLyrVgrr3balPbTJR1GW7k30Oes+iXGYIadrse7cffwAMjTMeqyAVrotp905VlX55L dHV7JqdJukFVFbdi2yudfUaqerkkZ/hfdjlvjR8uBMW3B+DF1c/wPH24Flssio7G14c4lUzk+c y2RmziAfwMY4nY14DE4BOqf18snMm4xVlfM1tDMxOsb2Yd/0mY/N0X4S+LfxNOquP0pf6MDY8t K8iOtzDVnkClU7r3uK858DFaYcF5VRHTczU78Gw56704vMczlpWWIFVCVyGeiFkbfnDO/zSQLW 2FO6aik5K3AlNnmktunaY2xB X-IronPort-AV: E=Sophos;i="5.85,372,1624345200"; d="scan'208";a="139676508" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Oct 2021 01:58:35 -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:35 -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:32 -0700 From: Horatiu Vultur To: , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH v3 1/2] dt-bindings: pinctrl: pinctrl-microchip-sgpio: Add reset binding Date: Thu, 14 Oct 2021 10:59:28 +0200 Message-ID: <20211014085929.2579695-2-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_015836_737497_DBCC2E41 X-CRM114-Status: UNSURE ( 8.26 ) 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 for calling the reset driver in the pinctrl-microchip-sgpio driver. Signed-off-by: Horatiu Vultur --- .../devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml b/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml index 4fe35e650909..d7b3aa726e1d 100644 --- a/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml +++ b/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml @@ -68,6 +68,12 @@ properties: clock, and larger than zero. default: 12500000 + resets: + maxItems: 1 + + reset-names: + maxItems: 1 + patternProperties: "^gpio@[0-1]$": type: object 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");