Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp580781rdb; Tue, 23 Jan 2024 08:19:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGIaRHWcg3PQqX8ap9X+eD7ECVlOtqKj/SkTyJ7jjTU+0ITJTob0Il0a+6jiV+pEMkkp1Ye X-Received: by 2002:a05:6a00:420f:b0:6ce:751b:81d9 with SMTP id cd15-20020a056a00420f00b006ce751b81d9mr8161686pfb.9.1706026765875; Tue, 23 Jan 2024 08:19:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706026765; cv=pass; d=google.com; s=arc-20160816; b=SID+JBgTRZjBMDS55LivWrperV7pcgxUDc1l7r+fstm1U6YT5GeLbEn1/Y7zxZ1xuH lKJDo3WVMDXsCd15UccB6ydt00SZe3AKTEBu6LV9e3tjkOM5vXKzJ8X4OacTxmUuyYvv WU6M3kglP+Oy7cQIibWa/50xjV/qqwJwao/tg97lBxfTHOimHCiNwc5Ckk9o9rMsKvOG gVQAH5LNlUEOBeP4u6EA4ASV2jizmGDKhA+suwOkSii0st5iIrtFsYA53by3dTHf8XKU +1Yr7Z/f6hKpDmFyM7QDQvcb5tsJ8Dh1eieG0YNwVLYKgzrjLDnun7ZOMW5vOulVLmR2 CJ4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id; bh=s6bzrXJvLoSzqLnm4QHlMPIjC9Nu5ZvTlgsGNO+lauY=; fh=xRzS6+55PGLFXGC460wxGzSXKpYa7lB1cNtDooOjqvY=; b=0Qghy5RIaF4MJdF4NUHu5HlwZHklJyCCpVpmA+WKLOKfNV6AXHnEr+K4udbvNYamhU cL69F/svaYklOtFcBpFfYHIBTd52Ai1FfYHy/Q7RZN48WkzLP+xb4zpiw0he7eUHLc+N z8ZDHBPRhpEPLlmPFGfwwsDVdsd0kRv8aPcSLUEU0CveArIXxzqm7HLW8lbQvTGISd1R co/gz9gIS7vTD+53oE3TWsRxX0ucoxJej4Uc50IlI3mpalAQm0WIFZcY5MGT9IZSdCnd IWEQSljgoWKxw8ez033/m0Otf4YzLalfIByb3WBTwNczXmge09Nh7k0yZYzBYrzt0K2w MynQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-35607-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35607-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bx2-20020a056a02050200b005ce46d33cdcsi10483427pgb.343.2024.01.23.08.19.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 08:19:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35607-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-35607-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35607-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 944C6287EF6 for ; Tue, 23 Jan 2024 15:58:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 405D261673; Tue, 23 Jan 2024 15:58:31 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EE37612D6 for ; Tue, 23 Jan 2024 15:58:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706025510; cv=none; b=jPtBMyZriQ5Sr5NTCLw4MyuamKnHnnfsI31z6gjTDcVj3gTIcNmXYOuONVTPA85t89wQuKYef2bMLVdJoXkHq07S2zhXRu5EFguTcR9tAqV/H+rppp52+dovofZ0NKtqgarVN4+8Bx2qAZGruSEdCoweBNh8OBEwZum4zeqRdgo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706025510; c=relaxed/simple; bh=FLYjzYMkf6E9zjSakhvrb6+IxLdSbdz6QkWTCjb64SE=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=OJ9fycWfzDoByjPBZdbsdgOdCmkeUale+r5IwudCwIYoypRXmcM7yhEcSL9+NaW6XgkkREFCnFaBe30yZXm5ESDgNOmpScOd7Xzq6dNtQvUMwo7yZN1GfFGS+2ZHz4OfWm0JxZyrE+cE9d/Y1f2KYdtISFLKxLYu4pLYxQC3KXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rSJA5-0005N6-Sq; Tue, 23 Jan 2024 16:58:05 +0100 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rSJA1-001rVX-T3; Tue, 23 Jan 2024 16:58:01 +0100 Received: from pza by lupine with local (Exim 4.96) (envelope-from ) id 1rSJA1-000Br9-2d; Tue, 23 Jan 2024 16:58:01 +0100 Message-ID: <9e426d8cb630a1015133027424635ea4615b3be4.camel@pengutronix.de> Subject: Re: [PATCH v4 4/6] reset: Instantiate reset GPIO controller for shared reset-gpios From: Philipp Zabel To: Krzysztof Kozlowski , Bjorn Andersson , Konrad Dybcio , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Rafael J. Wysocki" , Viresh Kumar , Frank Rowand , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Bartosz Golaszewski , Chris Packham , Sean Anderson Date: Tue, 23 Jan 2024 16:58:01 +0100 In-Reply-To: <20240123141311.220505-5-krzysztof.kozlowski@linaro.org> References: <20240123141311.220505-1-krzysztof.kozlowski@linaro.org> <20240123141311.220505-5-krzysztof.kozlowski@linaro.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Di, 2024-01-23 at 15:13 +0100, Krzysztof Kozlowski wrote: > Devices sharing a reset GPIO could use the reset framework for > coordinated handling of that shared GPIO line. We have several cases of > such needs, at least for Devicetree-based platforms. >=20 > If Devicetree-based device requests a reset line, while "resets" > Devicetree property is missing but there is a "reset-gpios" one, > instantiate a new "reset-gpio" platform device which will handle such > reset line. This allows seamless handling of such shared reset-gpios > without need of changing Devicetree binding [1]. >=20 > To avoid creating multiple "reset-gpio" platform devices, store the > Devicetree "reset-gpios" GPIO specifiers used for new devices on a > linked list. Later such Devicetree GPIO specifier (phandle to GPIO > controller, GPIO number and GPIO flags) is used to check if reset > controller for given GPIO was already registered. >=20 > If two devices have conflicting "reset-gpios" property, e.g. with > different ACTIVE_xxx flags, this would allow to spawn two separate > "reset-gpio" devices, where the second would fail probing on busy GPIO > request. >=20 > Link: https://lore.kernel.org/all/YXi5CUCEi7YmNxXM@robh.at.kernel.org/ [1= ] > Cc: Bartosz Golaszewski > Cc: Chris Packham > Cc: Sean Anderson > Signed-off-by: Krzysztof Kozlowski >=20 > --- >=20 > Depends on previous of change. > --- > drivers/reset/core.c | 213 +++++++++++++++++++++++++++++-- > include/linux/reset-controller.h | 4 + > 2 files changed, 204 insertions(+), 13 deletions(-) >=20 > diff --git a/drivers/reset/core.c b/drivers/reset/core.c > index 4d5a78d3c085..6e81b8d35055 100644 > --- a/drivers/reset/core.c > +++ b/drivers/reset/core.c > @@ -10,9 +10,13 @@ Oh, and #include > #include > #include > #include > +#include > +#include > +#include > #include > #include > #include > +#include > #include > #include > #include regards Philipp