From patchwork Wed Sep 25 09:38:03 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: 13811817 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 56ADAC369B7 for ; Wed, 25 Sep 2024 09:39:49 +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=hg1NYIg/4Cp0y5bNhAKciX8PEp+xLYeFC0blmyCsPuE=; b=DCdda8QK6UEXyrrjh+yjgzyy8H 6IcZiQ9kllDnuHQPmtljeSb8+Z6ALHgJjIpRxDxce4vnTaVrd7vJ16txaj/UA/Gsdv2WeotuQ+uDp 2868S10KYEHnlcvRdOI3GVwhUtV4gFkyOauMekCvhy7e7FigALeO48oVyaGzrqGPWjv+cp+d6q30O m90z5YRHgT8Gtbi79Gw+NG21obL8SdBGUmBE7p5EhFuh0Yrht98SlqXZIH7jfS5mN/yzGtyYU3Z6e NLFbHW9LtRTHfkYdSD1jAaW8kKdEJ5tVFBDlqxAM5vLDS9fuL2H6QrK/G0CL1riz/nmW8Mo+XJKD4 KebGJS8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stOUn-00000004dec-1qcc; Wed, 25 Sep 2024 09:39:41 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stOTP-00000004dKA-1PQd for linux-arm-kernel@lists.infradead.org; Wed, 25 Sep 2024 09:38:17 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-71971d20a95so4492391b3a.3 for ; Wed, 25 Sep 2024 02:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1727257094; x=1727861894; 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=hg1NYIg/4Cp0y5bNhAKciX8PEp+xLYeFC0blmyCsPuE=; b=fQQaRWxdm5+a+JSeiTDWKFqeUxoz3cFnX9YVHHc2ThQWB3lxTMEwFcLyK4+S+sWtY0 Cn3WD5iaAOWlek+iBfsktaaZc0A6Uhwep7fk8S3/N1IDw5RqNJwID8KLaLxf39wgtK0u VLWUM4QnbdwXAo3dJZgNiVejr5hW1IGw+lh/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727257094; x=1727861894; 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=hg1NYIg/4Cp0y5bNhAKciX8PEp+xLYeFC0blmyCsPuE=; b=u2/qK/7iB6G6qqPSv31pY+EbJOHK72N1ENvjWivNZ++JVFihPB8Cy04aI5ii/r+3uB 7WWwc+hEbfciNJVCSg19jKpx6PU+XmF8HRSYhc4qxvWwpTwzYoxyXwlvE8jzb9MxWKpp aWHTnkH7g4tuWMhN9c/8T442vHPmLzBu/R+Yk4Rz47Bi9it0kusQSNFsUgXx5/aF47pw TK1tovAwPVxh8b8dd58soUAAbsQ1xWsPiFXvebilFyyJd3fup2HsUuKEIEVnOKWE+wNn eadf3klBNtCIGWyKf/ItAvlI74M0aCxmN6Glv+KVWDfp1oh5cQbk5JcyFwH8ewDl+mwu 0FNA== X-Forwarded-Encrypted: i=1; AJvYcCW+Yj+HlYUEXxJ0LU4MIioB6QskU6U6pGuuicePbhDI7odRTExNhwDNrcpomDtUahf4E15HWoa+rT0N18Kl1za9@lists.infradead.org X-Gm-Message-State: AOJu0YxAknLggKo0JHLjZiem2yUDwZ5EC1degZO42gqizqXye3y+giLC 4PdUQZb75BXPcSaBjn8GrIGPeKhsJYWKJqz+a/4RIoYGyd2zB+/5E4Gq1Lax49k4u2ydjzyMeO4 = X-Google-Smtp-Source: AGHT+IGy6BLTQ2yk8nK1BnDwn8ihRKFUDhdNkl6yPPDueqyuBMklhO/bVczNjLCMAQ+n1ABozov4dA== X-Received: by 2002:a05:6a00:3e1b:b0:70d:2583:7227 with SMTP id d2e1a72fcca58-71b0aaa263amr3187086b3a.6.1727257093845; Wed, 25 Sep 2024 02:38:13 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:2480:2c96:2b64:cdcb]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71afc8347fesm2432789b3a.35.2024.09.25.02.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Sep 2024 02:38:13 -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 v8 0/3] Add of_regulator_get_optional() and Fix MTK Power Domain Driver Date: Wed, 25 Sep 2024 17:38:03 +0800 Message-ID: <20240925093807.1026949-1-wenst@chromium.org> X-Mailer: git-send-email 2.46.0.792.g87dc391469-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240925_023815_383997_DB05B74E X-CRM114-Status: GOOD ( 16.09 ) 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 series is split off from my "DT hardware prober" series [1]. 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. Mark, would it be possible for you to put the two regulator patches on an immutable branch / tag? Otherwise we could have Ulf ack the pmdomain patch and merge it through your tree. Sebastian was fine with converting the rockchip pmdomain some time later. 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 | 39 +++++++++++++++++ drivers/regulator/internal.h | 18 +++++--- drivers/regulator/of_regulator.c | 51 +++++++++++++++++++--- include/linux/regulator/consumer.h | 37 ++++++++++++++++ 6 files changed, 136 insertions(+), 25 deletions(-) base-commit: 2b7275670032a98cba266bd1b8905f755b3e650f