From: Andre Przywara <andre.przywara@arm.com>
To: Lee Jones <lee@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>
Cc: devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev,
linux-kernel@vger.kernel.org,
Martin Botka <martin.botka@somainline.org>,
Chris Morgan <macromorgan@hotmail.com>
Subject: [PATCH 5/5] regulator: axp20x: add support for the AXP323
Date: Thu, 3 Oct 2024 12:14:44 +0100 [thread overview]
Message-ID: <20241003111444.543964-6-andre.przywara@arm.com> (raw)
In-Reply-To: <20241003111444.543964-1-andre.przywara@arm.com>
The X-Powers AXP323 is a very close sibling of the AXP313A. The only
difference seems to be the ability to dual-phase the first two DC/DC
converters.
Place the new AXP323 ID next to the existing AXP313A checks, to let
them share most code.
The only difference is the poly-phase detection code, which gets
extended to check the respective bit in a newly used register.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
drivers/regulator/axp20x-regulator.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 3ba76dbd0fb9..e3cc59b82ea6 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -1341,6 +1341,7 @@ static int axp20x_set_dcdc_freq(struct platform_device *pdev, u32 dcdcfreq)
step = 150;
break;
case AXP313A_ID:
+ case AXP323_ID:
case AXP717_ID:
case AXP15060_ID:
/* The DCDC PWM frequency seems to be fixed to 3 MHz. */
@@ -1527,6 +1528,15 @@ static bool axp20x_is_polyphase_slave(struct axp20x_dev *axp20x, int id)
}
break;
+ case AXP323_ID:
+ regmap_read(axp20x->regmap, AXP323_DCDC_MODE_CTRL2, ®);
+
+ switch (id) {
+ case AXP313A_DCDC2:
+ return !!(reg & BIT(1));
+ }
+ break;
+
default:
return false;
}
@@ -1565,6 +1575,7 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
"x-powers,drive-vbus-en");
break;
case AXP313A_ID:
+ case AXP323_ID:
regulators = axp313a_regulators;
nregulators = AXP313A_REG_ID_MAX;
break;
--
2.25.1
next prev parent reply other threads:[~2024-10-03 11:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-03 11:14 [PATCH 0/5] regulator: add X-Powers AXP323 support Andre Przywara
2024-10-03 11:14 ` [PATCH 1/5] dt-bindings: mfd: x-powers,axp152: Document AXP323 Andre Przywara
2024-10-03 15:12 ` Chen-Yu Tsai
2024-10-03 15:49 ` Rob Herring (Arm)
2024-10-03 11:14 ` [PATCH 2/5] mfd: axp20x: ensure relationship between IDs and model names Andre Przywara
2024-10-03 15:12 ` Chen-Yu Tsai
2024-10-03 11:14 ` [PATCH 3/5] mfd: axp20x: Allow multiple regulators Andre Przywara
2024-10-03 15:19 ` Chen-Yu Tsai
2024-10-04 9:41 ` Andre Przywara
2024-10-06 22:48 ` Andre Przywara
2024-10-03 11:14 ` [PATCH 4/5] mfd: axp20x: Add support for AXP323 Andre Przywara
2024-10-03 15:20 ` Chen-Yu Tsai
2024-10-04 9:42 ` Andre Przywara
2024-10-03 11:14 ` Andre Przywara [this message]
2024-10-03 14:52 ` [PATCH 5/5] regulator: axp20x: add support for the AXP323 Mark Brown
2024-10-03 15:21 ` 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=20241003111444.543964-6-andre.przywara@arm.com \
--to=andre.przywara@arm.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=macromorgan@hotmail.com \
--cc=martin.botka@somainline.org \
--cc=robh@kernel.org \
--cc=wens@csie.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