From patchwork Fri Jun 21 14:45:01 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Philipp Zabel
X-Patchwork-Id: 13707720
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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A31BBC27C4F
for ;
Fri, 21 Jun 2024 14:45:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help
:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:
Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:
From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:
List-Owner; bh=Km1YA+3HFKLGPXVM7kXtuo3fsiB7J9F/3+UumpC9EKw=; b=OXukRxJCd3idBz
uUwVkb/Eiuwp3hrMNRu9YBzh0DH4xy63kt59NlHVM6NIcKbcxutJ/+MYMjcjXimSqk8JsGLDBLGkc
+48atg5k3o81KAQxgT3q/RrODl6oy2IGVZIg48S93vpuspaFv63vzl9iX1cZSYaQIiEdGtOTON5zw
LB7AhoWMUsmp8/aDbicG0emWMQtJRJn2r1f/yoGISMOQISh6XD13Tz1BfaY5Z9BQGJYrJLu/sERPa
yJ4OV+j58ZoHsv25ewsBDtC8TUAIjPpPdfrmIfL+sCyjyh/UGHQFhZEQJlEsUV56gYWWrMjJX0Png
K1Zwq0szs1ffiBbvlJsw==;
Received: from localhost ([::1] helo=bombadil.infradead.org)
by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux))
id 1sKfVu-00000009ZDI-2UtM;
Fri, 21 Jun 2024 14:45:18 +0000
Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104])
by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux))
id 1sKfVp-00000009ZAQ-2Q8Q
for linux-arm-kernel@lists.infradead.org;
Fri, 21 Jun 2024 14:45:16 +0000
Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54])
by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92)
(envelope-from )
id 1sKfVn-0004LC-Ar; Fri, 21 Jun 2024 16:45:11 +0200
From: Philipp Zabel
Subject: [PATCH RFC 0/3] reset: Requesting pre-deasserted, auto-reasserting
reset controls via devres
Date: Fri, 21 Jun 2024 16:45:01 +0200
Message-Id: <20240621-reset-get-deasserted-v1-0-94ee76fb7b7d@pengutronix.de>
MIME-Version: 1.0
X-B4-Tracking: v=1; b=H4sIAO2RdWYC/x2MPQqFMBAGryJbG0iCf7xW8AC2YhHMp27jk6yII
N7dxWKKKWZuEiSG0C+7KeFk4f+m4vKMpjVsCwxHdfLWF7byziQIDrMoEUG0PhBN6ZoyNChCbSv
SdE+Y+fq2A/VdS+PzvPzQ5cprAAAA
To: Kunihiko Hayashi ,
Masami Hiramatsu ,
Lad Prabhakar ,
Geert Uytterhoeven , =?utf-8?q?Uwe_Kleine-K=C3=B6?=
=?utf-8?q?nig?=
Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
kernel@pengutronix.de, Philipp Zabel
X-Mailer: b4 0.14-dev
X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::54
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-arm-kernel@lists.infradead.org
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
X-CRM114-CacheID: sfid-20240621_074513_708738_ED88C2E0
X-CRM114-Status: UNSURE ( 7.01 )
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
There is a recurring pattern of drivers requesting a reset control and
deasserting the reset during probe, followed by registering a reset
assertion via devm_add_action_or_reset().
We can simplify this by providing devm_reset_control_get_*_deasserted()
helpers that return an already deasserted reset control, similarly to
devm_clk_get_enabled().
This doesn't remove a lot of boilerplate at each instance, but there are
quite a few of them now.
regards
Philipp
Signed-off-by: Philipp Zabel
---
Philipp Zabel (3):
reset: replace boolean parameters with flags parameter
reset: Add devres helpers to request pre-deasserted reset controls
reset: uniphier-glue: Use devm_reset_control_bulk_get_shared_deasserted()
drivers/reset/core.c | 103 ++++++++++----
drivers/reset/reset-uniphier-glue.c | 24 +---
include/linux/reset.h | 274 ++++++++++++++++++++++++++++--------
3 files changed, 289 insertions(+), 112 deletions(-)
---
base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
change-id: 20240621-reset-get-deasserted-5185a8e4a706
Best regards,