Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp915976pxb; Fri, 22 Apr 2022 14:12:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV0q7T5jVklLiaCpaN8yP2lPYaFYpCuPwFDEpx29JxRdvFvt9bxSGyXhka37F9W9NaIwjr X-Received: by 2002:a05:6a00:1152:b0:4be:ab79:fcfa with SMTP id b18-20020a056a00115200b004beab79fcfamr6877467pfm.3.1650661976950; Fri, 22 Apr 2022 14:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650661976; cv=none; d=google.com; s=arc-20160816; b=P5oYsfrOxpP//KBOVsZArwmwdMO/9JiMLX1fsiv/wjPMdWq4lNIO2swYms5FS7xXdR duqPuEYOTiNl/cYNOwUEpH7WEvNQrJ5+qaf7NmG5HuDlEXP5Qs3bMDtxsLJzmtYeHlK6 JfjtwJsK3RJzqjrXOs/TMoRbsw0BGlp+2EepKIW2HiPNgx+XFi7gcRnbhCKpP03yITe5 aJOL6bLlobo8Byq/Bu1cqsud+Xc+EjT9sifBgfQdzMQN3djavdaDxoBGEFZOB18PVIpu 4StLBf5Y+RQ2zzQ4GY7/KUg//5j20n7q4Ez+WxI2/5o9PeKOaDQCK86bHY5hFUTxkyCZ IN4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hjU3itzIvEGXkt6RShfQqX8saZi833+CMTU68RceKbQ=; b=CYf3AIgtd/yjeZ6yx1MmB9Mq6t/1ahboQgShsDDlwbGl55uyyrO6lKi6IhO62hksBE kGJOSfkIRjVd92B8YwTKPDln7ApvooaUx0F5EufvJHq31yVKTLfh8Z6op8az5gzFTv6o /LltyBtOHUoY3d6D9WUtVQ7lruh0nj2pPilP530rOmnRYp4DvY7nBposfRoXJx+gDGMo elAB4o2NSxJNAw+NJsasAKMtkSCmLDoMG7bOVj2INdsR2pbHr8l4LO+b2SaS3Y1pIrj6 8+QAKyja4mw3lipvU/+L9sL00Qw1BWzhV66xasXTN0HElB3sNSzqB4hbea3c78yS8X7C oiUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=F9rSym0G; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r11-20020a6560cb000000b0039d13c0c537si8935285pgv.714.2022.04.22.14.12.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 14:12:56 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=F9rSym0G; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CB62227AE75; Fri, 22 Apr 2022 13:14:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381700AbiDTTWi (ORCPT + 99 others); Wed, 20 Apr 2022 15:22:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381696AbiDTTWZ (ORCPT ); Wed, 20 Apr 2022 15:22:25 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89F52BF4A; Wed, 20 Apr 2022 12:19:38 -0700 (PDT) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 78B8622255; Wed, 20 Apr 2022 21:19:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1650482376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hjU3itzIvEGXkt6RShfQqX8saZi833+CMTU68RceKbQ=; b=F9rSym0G72plU7oK+A56qOR5TtXmlsY7KjmAhZmdks/dpMAheGWfs/qkrqPUcD/lgPTvF9 37z4Bzu6qawEri58sMuCtpgq2Ge311h9JunC3sU8mYumU3hjJO2zz/p0SBqMAvxK189KHl Fh3ohRyVZhT8xFuFWjXGRd8RqgJ+qQQ= From: Michael Walle To: Linus Walleij , Rob Herring , Krzysztof Kozlowski , Philipp Zabel , Alexandre Belloni , Lars Povlsen Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Horatiu Vultur , Michael Walle Subject: [PATCH v3 2/2] pinctrl: ocelot: add optional shared reset Date: Wed, 20 Apr 2022 21:19:26 +0200 Message-Id: <20220420191926.3411830-3-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220420191926.3411830-1-michael@walle.cc> References: <20220420191926.3411830-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On the LAN9668 there is a shared reset line which affects GPIO, SGPIO and the switch core. Add support for this shared reset line. Signed-off-by: Michael Walle Tested-by: Horatiu Vultur --- drivers/pinctrl/pinctrl-ocelot.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index 1bdced67464b..843704fa8625 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "core.h" @@ -1912,6 +1913,7 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct ocelot_pinctrl *info; + struct reset_control *reset; struct regmap *pincfg; void __iomem *base; int ret; @@ -1927,6 +1929,12 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) info->desc = (struct pinctrl_desc *)device_get_match_data(dev); + reset = devm_reset_control_get_optional_shared(dev, "switch"); + if (IS_ERR(reset)) + return dev_err_probe(dev, PTR_ERR(reset), + "Failed to get reset\n"); + reset_control_reset(reset); + base = devm_ioremap_resource(dev, platform_get_resource(pdev, IORESOURCE_MEM, 0)); if (IS_ERR(base)) -- 2.30.2