U-boot Archive mirror
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Tom Rini <trini@konsulko.com>, Jaehoon Chung <jh80.chung@samsung.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Chris Morgan <macromorgan@hotmail.com>,
	Ryan Walklin <ryan@testtoast.com>,
	u-boot@lists.denx.de, linux-sunxi@lists.linux.dev
Subject: [PATCH 6/6] power: pmic: sunxi: add AXP707 support
Date: Thu, 16 May 2024 00:48:39 +0100	[thread overview]
Message-ID: <20240515234839.26898-7-andre.przywara@arm.com> (raw)
In-Reply-To: <20240515234839.26898-1-andre.przywara@arm.com>

The X-Powers AXP707 is a PMIC with some buck converters and a larger
number of LDOs, alongside some charging and USB circuitry.

Add the descriptions for the five DC/DC regulators that we will need,
and enable that when CONFIG_AXP707_POWER is enabled. We won't need DCDC2
till DCDC4, but by using the position in the array for the index we keep
the code cleaner.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 drivers/power/axp_spl.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/power/axp_spl.c b/drivers/power/axp_spl.c
index e38895c5c7d..8c9698612b5 100644
--- a/drivers/power/axp_spl.c
+++ b/drivers/power/axp_spl.c
@@ -62,6 +62,21 @@ static const struct axp_reg_desc_spl axp_spl_dcdc_regulators[] = {
 #define AXP_SHUTDOWN_REG	0x32
 #define AXP_SHUTDOWN_MASK	BIT(7)
 
+#elif defined(CONFIG_AXP707_POWER)				/* AXP707 */
+
+static const struct axp_reg_desc_spl axp_spl_dcdc_regulators[] = {
+        { 0x10, BIT(0), 0x20, 0x1f, 1600, 3400, 100, NA },
+        { 0x10, BIT(1), 0x21, 0x7f,  500, 1300,  10, 70 },
+        { 0x10, BIT(2), 0x22, 0x7f,  500, 1300,  10, 70 },
+        { 0x10, BIT(3), 0x23, 0x7f,  500, 1300,  10, 70 },
+        { 0x10, BIT(4), 0x24, 0x7f,  800, 1840,  10, 32 },
+};
+#define AXP_CHIP_VERSION	0x3
+#define AXP_CHIP_VERSION_MASK	0xcf
+#define AXP_CHIP_ID		0x81
+#define AXP_SHUTDOWN_REG	0x32
+#define AXP_SHUTDOWN_MASK	BIT(7)
+
 #else
 
 	#error "Please define the regulator registers in axp_spl_regulators[]."
-- 
2.35.8


  parent reply	other threads:[~2024-05-15 23:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 23:48 [PATCH 0/6] power: pmic: sunxi: consolidate AXP SPL drivers Andre Przywara
2024-05-15 23:48 ` [PATCH 1/6] power: pmic: sunxi: only build AXP drivers for SPL Andre Przywara
2024-05-15 23:48 ` [PATCH 2/6] power: pmic: sunxi: introduce generic SPL AXP DC/DC driver Andre Przywara
2024-05-15 23:48 ` [PATCH 3/6] power: pmic: sunxi: replace AXP717 SPL driver Andre Przywara
2024-05-15 23:48 ` [PATCH 4/6] power: pmic: sunxi: use generic AXP SPL driver for AXP313 Andre Przywara
2024-05-15 23:48 ` [PATCH 5/6] power: pmic: sunxi: use generic AXP SPL driver for AXP305 Andre Przywara
2024-05-15 23:48 ` Andre Przywara [this message]
2024-05-20 12:48 ` [PATCH 0/6] power: pmic: sunxi: consolidate AXP SPL drivers Peter Robinson
2024-05-20 14:18   ` Andre Przywara
2024-05-20 16:31     ` Peter Robinson

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=20240515234839.26898-7-andre.przywara@arm.com \
    --to=andre.przywara@arm.com \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jh80.chung@samsung.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=macromorgan@hotmail.com \
    --cc=ryan@testtoast.com \
    --cc=samuel@sholland.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).