mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: niklaus.liu <niklaus.liu@mediatek.com>
To: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Flora Fu <flora.fu@mediatek.com>,
	Alexandre Mergnat <amergnat@baylibre.com>,
	Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>
Cc: <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	niklaus.liu <niklaus.liu@mediatek.com>
Subject: [PATCH 3/3] regulator: Modify mt6315 regulator mode mask
Date: Fri, 1 Aug 2025 14:39:37 +0800	[thread overview]
Message-ID: <20250801070913.3109-4-niklaus.liu@mediatek.com> (raw)
In-Reply-To: <20250801070913.3109-1-niklaus.liu@mediatek.com>

Modify mt6315 regulator mode mask, compatible with all 6315 models

Signed-off-by: niklaus.liu <niklaus.liu@mediatek.com>
---
 drivers/regulator/mt6315-regulator.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/regulator/mt6315-regulator.c b/drivers/regulator/mt6315-regulator.c
index 2608a6652d77..092ff748fe21 100644
--- a/drivers/regulator/mt6315-regulator.c
+++ b/drivers/regulator/mt6315-regulator.c
@@ -218,8 +218,10 @@ static int mt6315_regulator_probe(struct spmi_device *pdev)
 	struct regmap *regmap;
 	struct mt6315_chip *chip;
 	struct mt_regulator_init_data *init_data;
+	struct device_node *node = pdev->dev.of_node;
 	struct regulator_config config = {};
 	struct regulator_dev *rdev;
+	unsigned int val = 0;
 	int i;
 
 	regmap = devm_regmap_init_spmi_ext(pdev, &mt6315_regmap_config);
@@ -247,6 +249,10 @@ static int mt6315_regulator_probe(struct spmi_device *pdev)
 		init_data->modeset_mask[MT6315_VBUCK1] = BIT(MT6315_VBUCK1);
 		break;
 	}
+
+	if (!of_property_read_u32(node, "buck1-modeset-mask", &val))
+		init_data->modeset_mask[MT6315_VBUCK1] = val;
+
 	for (i = MT6315_VBUCK2; i < MT6315_VBUCK_MAX; i++)
 		init_data->modeset_mask[i] = BIT(i);
 
-- 
2.46.0


  parent reply	other threads:[~2025-08-01  7:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-01  6:39 niklaus.liu
2025-08-01  6:39 ` [PATCH 1/3] dt-bindings: mediatek : add binding for pwrap,spmi niklaus.liu
2025-08-01  7:41   ` AngeloGioacchino Del Regno
2025-08-01  6:39 ` [PATCH 2/3] soc:mediatek mt8189: Porting driver for spmi/pwrap niklaus.liu
2025-08-01  7:39   ` AngeloGioacchino Del Regno
2025-08-01  6:39 ` niklaus.liu [this message]
2025-08-01  7:30   ` [PATCH 3/3] regulator: Modify mt6315 regulator mode mask Chen-Yu Tsai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250801070913.3109-4-niklaus.liu@mediatek.com \
    --to=niklaus.liu@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=amergnat@baylibre.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=flora.fu@mediatek.com \
    --cc=hsin-hsiung.wang@mediatek.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®