From mboxrd@z Thu Jan 1 00:00:00 1970 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 672A31CF91 for ; Thu, 25 Jan 2024 09:44:05 +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=1706175846; cv=none; b=Ms6LUGzNdGltfp5OANYb8PY10FIe16yfTdDiKDhpvECKh7FstFA/iW7ZNCF97QdX2JgJSHC+tvRDH1RmRz1FYoBELtUNOu87L4SdZxWgwelUVmF/bgNyS84dCxmJYsbzNJOwaZrSKk8+UQzCQRfw+NuiQ9uuU6aWkfNbRVpNpTw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706175846; c=relaxed/simple; bh=RgBY/UGCd4plfjZ1+ESyM3yfa/sdiUadST2GFLW/M4o=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=CMQJC5d1UIibYyFH67kOtD+FvM1DeLikY5KDcsUNDDOEJwdt5QONM9Yv4fNPQ0pEBcq268m0rqcruxuSvoyYN21XGW3fiav6NyxMa4JlE73ywuwDIi6lnWx3kVW5N8rXzsoBD18Bfei+j36P4d0vxNiX0BuRMuz6R1NSQJ8J3iY= 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 1rSwGv-0002Ku-8h; Thu, 25 Jan 2024 10:43:45 +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 1rSwGu-002FmK-Q5; Thu, 25 Jan 2024 10:43:44 +0100 Received: from pza by lupine with local (Exim 4.96) (envelope-from ) id 1rSwGu-0003mR-2L; Thu, 25 Jan 2024 10:43:44 +0100 Message-ID: <34d4e5bc7492d51b921b0633d51ed5c71b12657e.camel@pengutronix.de> Subject: Re: [PATCH v5 4/6] reset: Instantiate reset GPIO controller for shared reset-gpios From: Philipp Zabel To: Krzysztof Kozlowski , Srinivas Kandagatla , Banajit Goswami , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Rafael J. Wysocki" , Viresh Kumar , Frank Rowand , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.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: Thu, 25 Jan 2024 10:43:44 +0100 In-Reply-To: <20240124074527.48869-5-krzysztof.kozlowski@linaro.org> References: <20240124074527.48869-1-krzysztof.kozlowski@linaro.org> <20240124074527.48869-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: devicetree@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: devicetree@vger.kernel.org On Mi, 2024-01-24 at 08:45 +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 Reviewed-by: Philipp Zabel regards Philipp