From patchwork Mon Sep 30 04:45:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13815362 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 67CB4CF649C for ; Mon, 30 Sep 2024 04:48:03 +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:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=x6fQANF7cLgNYEImELd2aRDhcfXDngeWPNi/O1BMJo8=; b=3eWirAynMSR6u/CqOqZ161QsSk tC37x4JB43yyVVXNpLVOSonOUwASqE0hhVwVbCrX4qNcQqSlFEETUwIvgn0GNw9b3a3WI6uQykGYp 9HWd+8H5BU7gBHQgHfkXhAFuOLvgeV0MyzpcZSG3x7RgWHITLvgoq3x89OsUIKOIxh7/wllMM/IWP MKwfh50u4KifY24OLw8gK28eP4eyKBDGteg7TN3Lhna9FzZFifSD3atVpHL59Ih+/sQWkqkOixL4g qCCo6MqofWuM8Is8PVTIkGZBaD+glxY+Ey2yM1ceov0ZmTvI1HoAjKCO30rWqKkQ0rZAgnmGDZoe+ 6KaN3eQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sv8K8-0000000FuxD-0gJ1; Mon, 30 Sep 2024 04:47:52 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sv8It-0000000Fuh1-3h3L for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 04:46:37 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-206bd1c6ccdso36110605ad.3 for ; Sun, 29 Sep 2024 21:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727671594; x=1728276394; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=x6fQANF7cLgNYEImELd2aRDhcfXDngeWPNi/O1BMJo8=; b=dFeEAak0PC1CF/EamN3NDumPPpLEGC7EUB9RrVmC+J0NwgiledNBv+U8j6BgyEKrG3 t1SAeSYEN1YEApkCTEuR9uGyQkbBLPyPZljUaNxSIOZxG0rX9LvN75R8Cq7Z7fUR38zx 4+OqskECM7ABbmj5ErOzK5P5D3ER6uSHEXNSE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727671594; x=1728276394; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=x6fQANF7cLgNYEImELd2aRDhcfXDngeWPNi/O1BMJo8=; b=sE6Hz5RrkYw5gA05mvXYe/t8+3LQjhasCXKxkNhJsGipMgL6hRF0aIX2hMa1/8dPuN /Z7bb2nHz072cySmuJEP7nY83YERiO6ge3UBGLbj8mEd/GdRDa0MIIQzXCVac/j5celD cX6R7IxS+gbiMprvmaPKdZ7q/2yh3kSSFodRBLbrbVz13CcIs/sWoHLE9baExCQ7yi8X K8JAHB73SuKAD+EFSGGEFFbkv3Z/eRu3Ouy2AoOmMkxvJF+qwJdElIZr6IE/0O5Xer8X 3caV1du1O4nzuoN8/HlqwQKc1+LdETv7MZT+pg4SjyzdXvcxWjYesbybUgpND7/1+vB0 /rNA== X-Forwarded-Encrypted: i=1; AJvYcCVM/nsrm33f9L5+vir8s28e5cLBnfFdTdbcGM/LlhcdATbR4EXJeep8QYYOSmo+ilXh/kOcLisdScr7NmSYG6VM@lists.infradead.org X-Gm-Message-State: AOJu0YwdSh+ANyvWWDMX4A3YqCV7UFC43tPNxAH4f07gqsDRUxuBoMyJ jwJK+q1Kpuyqw31Xo0DDsAaFhNB1PKI0sE8s7svqgG2A/DPmSGVsSItCBG4eLw== X-Google-Smtp-Source: AGHT+IENQ7NhAJEfEEzudtLCJxzrSxYTgcSTJ2qYcUG48+ffvUH/sGw4msh0WJHorJMBcHhknsJBxQ== X-Received: by 2002:a17:902:e844:b0:20b:65a8:917c with SMTP id d9443c01a7336-20b65a923c0mr77993745ad.10.1727671594304; Sun, 29 Sep 2024 21:46:34 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:659b:6caf:831b:3926]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20b37e0d65asm46236925ad.123.2024.09.29.21.46.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Sep 2024 21:46:33 -0700 (PDT) From: Chen-Yu Tsai To: Ulf Hansson , Matthias Brugger , AngeloGioacchino Del Regno , Mark Brown Cc: Chen-Yu Tsai , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Douglas Anderson , Johan Hovold , Andy Shevchenko , Pablo Sun , Macpaul Lin , Sebastian Reichel Subject: [PATCH v9 0/3] Add of_regulator_get_optional() and Fix MTK Power Domain Driver Date: Mon, 30 Sep 2024 12:45:20 +0800 Message-ID: <20240930044525.2043884-1-wenst@chromium.org> X-Mailer: git-send-email 2.46.1.824.gd892dcdcdd-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240929_214635_973919_4681FF5C X-CRM114-Status: GOOD ( 16.50 ) 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 Hi folks, This is v9 of my of_regulator_get_optional() series. This series was split off from my "DT hardware prober" series [1]. Changes since v8: - Reformated stub versions with `clang-format` - Collected Andy's Reviewed-by for the first patch - Moved OF-specific devres version to of_regulator.c - Made _of_regulator_get() static again - Made devm_regulator_release non-static Changes since v7: - Added stub versions for of_regulator_get_optional() for !CONFIG_OF and !CONFIG_REGULATOR - Added new patches for devres version and converting MTK pmdomain driver At ELCE, Sebastian told me about his recent work on adding regulator supply support to the Rockchip power domain driver [2], how the MediaTek driver has been using the existing devm_regulator_get() API and reassigning different device nodes to the device doing the lookup, and how the new of_regulator_get_optional() is the proper fit for this. Patch 1 adds a new of_regulator_get_optional() function to look up regulator supplies using device tree nodes. Patch 2 adds a devres version of the aforementioned function at Sebastian's request for the two power domain drivers. Patch 3 converts the MediaTek power domain driver to use function. Each of the latter two patches depend on the previous one at build time. Ulf would like the regulator patches on an immutable topic branch so that he can merge it and the pmdomain patch. Mark, if you could oblige? Thanks ChenYu [1] https://lore.kernel.org/all/20240911072751.365361-1-wenst@chromium.org/ [2] https://lore.kernel.org/all/20240919091834.83572-1-sebastian.reichel@collabora.com/ Chen-Yu Tsai (3): regulator: Add of_regulator_get_optional() for pure DT regulator lookup regulator: Add devres version of of_regulator_get_optional() pmdomain: mediatek: Use OF-specific regulator API to get power domain supply drivers/pmdomain/mediatek/mtk-pm-domains.c | 12 +-- drivers/regulator/core.c | 4 +- drivers/regulator/devres.c | 2 +- drivers/regulator/internal.h | 4 + drivers/regulator/of_regulator.c | 88 ++++++++++++++++++++-- include/linux/regulator/consumer.h | 31 ++++++++ 6 files changed, 121 insertions(+), 20 deletions(-) base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc