From patchwork Mon Oct 18 08:57:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 12565385 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 016B6C433F5 for ; Mon, 18 Oct 2021 08:57:56 +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 C5873610A3 for ; Mon, 18 Oct 2021 08:57:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C5873610A3 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=YrwbWxBc5krKvWXytK+HYSPk/0aTAURMcSs8MkW2OcQ=; b=CWAlQG4vk1TqPB c0TAN+eh3z7is0z9IAY8fhmB9fX98ZMfTVEXQNWquLWiJVICo92VvvXxjvPSjEe0ZlzN329hPtDT/ fKS8XYL9x9xOIo8BuG6kHUBSnTAh4Oa/hY9BO19HxWleFMLV02IrcDqCv04x7RARiJu+2gmdsri+g ys5g+5puM83LZZrPqjiz8rTvJ4v1bI+2Orsm6YbX7372Vgn4EN0nyMuawqFsOrGdOglIx+9scQzsy 9FOHPw1DnFbEcOwW4jcurs4FoDR4nF+Km/X48g3WbrzHI/8XYqkPdFsxdfGshQeFRI9SnAidvqQNF IZqRFqGhFIXAhgVoQ7jQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcORq-00EiMw-O7; Mon, 18 Oct 2021 08:56:46 +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 1mcORe-00EiL7-93 for linux-arm-kernel@lists.infradead.org; Mon, 18 Oct 2021 08:56:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634547394; x=1666083394; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XJ1941v6zZfSvZQKQMytePL/8r8njzCROg8alY9Add0=; b=b6wdsxLQP9GwkuTxPJ9PXx7a3leK/SVkCMjFi3Uj+SmgI/lUAvZnRNOQ mMyFKxqKibnS6dsmhKRlJCYojvtxn7NQz+xSyFg5fEDuAf36N9lzRhl// pKboe3KvEKYICi4NJbMjZpisAK9K2VJsvPU5+jUs82I8n9JkYjtzxnyHK ypmA5ZHFfeO3riWqS2BnsMQ4rGZ/ogo8ovBW7PGG28NN+RnwXOPpVre5+ XDZHkagWAzlUFZNHpUpzheRMEcSjp4fUHei+mtEPhXIuf7CCmlcSF3yA3 DWLlu5PxdAMGYaDIBf+1tKjFpn4qv+4BMB4hO3Gbo7SOVmECVZ5x9Ka2h Q==; IronPort-SDR: 2HLXB5salHeherzJ3jNuI+e277GMUuKMzrGWSQC/2UH36sibK7PP70Pr/BSRkX33UfkslqmG8z 5lEnx8Mifcj0KSjcKLeWfwevYH5P/MvMB9bmTt49JdlSnOxX69QLJwPdq00q3Olu3mk9+m2SlX h1dMlzW8+FCZa90lHxUAfsRvN/jD7pDBqJgkS7QFaoY1Da55cIHaYGuvgCMw+PRPkzgxJJVfpJ YAUtOPkumj3U4A3T7CUkxdDqfFGAGooWJcOpBwXHqbXjCKWWOaDs1I7dgjgGO5eZZXmdIgSr3/ QnjqSDZP/2iegpLdHT/uYzai X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="140703344" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 18 Oct 2021 01:56:33 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Mon, 18 Oct 2021 01:56:32 -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; Mon, 18 Oct 2021 01:56:30 -0700 From: Horatiu Vultur To: , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH v6 1/2] dt-bindings: pinctrl: pinctrl-microchip-sgpio: Add reset binding Date: Mon, 18 Oct 2021 10:57:53 +0200 Message-ID: <20211018085754.1066056-2-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018085754.1066056-1-horatiu.vultur@microchip.com> References: <20211018085754.1066056-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-20211018_015634_347437_762E584F X-CRM114-Status: UNSURE ( 8.73 ) 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 which allows to call a reset driver from the pinctrl-microchip-sgpio driver. Signed-off-by: Horatiu Vultur Reviewed-by: Rob Herring --- .../bindings/pinctrl/microchip,sparx5-sgpio.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml b/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml index 4fe35e650909..cb554084bdf1 100644 --- a/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml +++ b/Documentation/devicetree/bindings/pinctrl/microchip,sparx5-sgpio.yaml @@ -68,6 +68,13 @@ properties: clock, and larger than zero. default: 12500000 + resets: + maxItems: 1 + + reset-names: + items: + - const: switch + patternProperties: "^gpio@[0-1]$": type: object From patchwork Mon Oct 18 08:57:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 12565389 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 404C7C433EF for ; Mon, 18 Oct 2021 08:58:03 +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 094BA60F9E for ; Mon, 18 Oct 2021 08:58:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 094BA60F9E 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=G54AXGOWuqunK4iF73Ds4+3G90e0XUt7LUqZfxjKVW0=; b=ViOjwsptamAHaa WF+jzWyfP9tL9t6Kh0C+e8oTo9k4qfYRopLgeQXVhP14WMFrDbKYG0GV1cvgVKPGlLFBXK9bpGn1j MWkJzX4xMm2XdnzMVwOVeLjSnUoQ9VaDo2kQ95oJw/mASZzZ/0ewXbiaW18QvaSG3pXVE/7+gpEi0 s/omFVwP5XZaUIU2NpMwb6ykE8tRAWhw77WljfJOQdkmfgYOGSsUF/orTY/4nH121wfbMOuirSbV1 n1sEsGkU0umMOYwZVW6Xt6E0MfftznvuO6J1m0QO7NMxqW0LO0CKOX8f/m8c8F4T8mDQGfckVbOWA 0fLbOi9JbMor7l1zr6dQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcOS0-00EiOj-9B; Mon, 18 Oct 2021 08:56:56 +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 1mcORg-00EiLn-47 for linux-arm-kernel@lists.infradead.org; Mon, 18 Oct 2021 08:56:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1634547395; x=1666083395; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dmu56FePmkD9SY8hzYkN3QZ2I6g48iWva5nUKCFMZ7o=; b=EfdWBnnqO64x6kIIADYdX4136p0wH0Qhe62xNGl5B00kj4R1wfq8VlVB lTk54eppjFacbY4Cjfp0D2QrsfVu99rn4wORDGxG8ekib9rBfcesuB/mz wi24+ZLBLEqnSWvouHLiJk7/YDmI6m4DNzdkfzPEuWrmrwEI6wW6Hsvox WBUFyICvl6n4Cq7AuDnvGP+SqCVsL99vpDwPmseelG4RN+pJxzhjlOFnq Fi0uAA6LJqbek129BYhrdutDwAaixa0Wsz1NW5JUVfDXSty1FJpAotocN o3nhIF1AnOqC8DdLZqN27GKm5YNaQAwA1od+60NhjGiucjHialie1Yuok Q==; IronPort-SDR: ma6XuNJHNk0zBhi/s3TCpI6P3ozcJWelL9tvnJSOdsbxuS3NoFDUPOZHwMiuONyNI5BFQs7gjg RED/xQTkDp5GpiR3lClag3Attx5Ct4/7AbKon3jfrMmg9aJoVbsh1uRV3y3ga5/sdaZt2ZBC5U tnNwLNkvTQ7e+bKIh+zlHowXUtM2MVg+QXkPzIQUV1ElmWvCqjAG2Y6g6Og0n+Q+2S84NE1wOu R8bvUPgJD7SjUmD3jDqPA9f6bNpLSWYRJP1ZSO8Sr0BNw4pKDbRf7AxPjurevw7pMcTlwMdznC IcytAtXeQHpntk/T4NPRLn+7 X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="148516571" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 18 Oct 2021 01:56:34 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Mon, 18 Oct 2021 01:56:34 -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; Mon, 18 Oct 2021 01:56:32 -0700 From: Horatiu Vultur To: , , , , , , , , , CC: Horatiu Vultur Subject: [PATCH v6 2/2] pinctrl: microchip sgpio: use reset driver Date: Mon, 18 Oct 2021 10:57:54 +0200 Message-ID: <20211018085754.1066056-3-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211018085754.1066056-1-horatiu.vultur@microchip.com> References: <20211018085754.1066056-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-20211018_015636_209966_BE56F51F X-CRM114-Status: GOOD ( 13.52 ) 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 Reviewed-by: Philipp Zabel Reviewed-by: Steen Hegelund --- drivers/pinctrl/pinctrl-microchip-sgpio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/pinctrl/pinctrl-microchip-sgpio.c b/drivers/pinctrl/pinctrl-microchip-sgpio.c index 072bccdea2a5..78765faa245a 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,11 @@ static int microchip_sgpio_probe(struct platform_device *pdev) priv->dev = dev; + reset = devm_reset_control_get_optional_shared(&pdev->dev, "switch"); + if (IS_ERR(reset)) + return dev_err_probe(dev, PTR_ERR(reset), "Failed to get reset\n"); + 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");