From: Nicolas Heemeryck <nicolas.heemeryck@devialet.com>
To: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Nicolas Heemeryck <nicolas.heemeryck@devialet.com>
Subject: [PATCH 1/2] regulator: pca9450: Add LOADSW regulator
Date: Fri, 17 Mar 2023 10:39:10 +0100 [thread overview]
Message-ID: <20230317093911.1254530-2-nicolas.heemeryck@devialet.com> (raw)
In-Reply-To: <20230317093911.1254530-1-nicolas.heemeryck@devialet.com>
Make the load switch present in the PCA9450 accessible and configurable
from the devicetree. Note that the SWIn for the load switch is
connected to BUCK4.
Signed-off-by: Nicolas Heemeryck <nicolas.heemeryck@devialet.com>
---
drivers/regulator/pca9450-regulator.c | 32 +++++++++++++++++++++++++++
include/linux/regulator/pca9450.h | 4 ++++
2 files changed, 36 insertions(+)
diff --git a/drivers/regulator/pca9450-regulator.c b/drivers/regulator/pca9450-regulator.c
index c6351fac9f4d..ccb61fc73a59 100644
--- a/drivers/regulator/pca9450-regulator.c
+++ b/drivers/regulator/pca9450-regulator.c
@@ -99,6 +99,12 @@ static const struct regulator_ops pca9450_ldo_regulator_ops = {
.get_voltage_sel = regulator_get_voltage_sel_regmap,
};
+static const struct regulator_ops pca9450_loadsw_regulator_ops = {
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .is_enabled = regulator_is_enabled_regmap,
+};
+
/*
* BUCK1/2/3
* 0.60 to 2.1875V (12.5mV step)
@@ -452,6 +458,19 @@ static const struct pca9450_regulator_desc pca9450a_regulators[] = {
.owner = THIS_MODULE,
},
},
+ {
+ .desc = {
+ .name = "loadsw",
+ .of_match = of_match_ptr("LOADSW"),
+ .regulators_node = of_match_ptr("regulators"),
+ .id = PCA9450_LOADSW,
+ .ops = &pca9450_loadsw_regulator_ops,
+ .type = REGULATOR_VOLTAGE,
+ .enable_reg = PCA9450_REG_LOADSW_CTRL,
+ .enable_mask = LOADSW_CTRL_EN_MASK,
+ .owner = THIS_MODULE,
+ },
+ },
};
/*
@@ -661,6 +680,19 @@ static const struct pca9450_regulator_desc pca9450bc_regulators[] = {
.owner = THIS_MODULE,
},
},
+ {
+ .desc = {
+ .name = "loadsw",
+ .of_match = of_match_ptr("LOADSW"),
+ .regulators_node = of_match_ptr("regulators"),
+ .id = PCA9450_LOADSW,
+ .ops = &pca9450_loadsw_regulator_ops,
+ .type = REGULATOR_VOLTAGE,
+ .enable_reg = PCA9450_REG_LOADSW_CTRL,
+ .enable_mask = LOADSW_CTRL_EN_MASK,
+ .owner = THIS_MODULE,
+ },
+ },
};
static irqreturn_t pca9450_irq_handler(int irq, void *data)
diff --git a/include/linux/regulator/pca9450.h b/include/linux/regulator/pca9450.h
index 3c01c2bf84f5..4e922d6010cb 100644
--- a/include/linux/regulator/pca9450.h
+++ b/include/linux/regulator/pca9450.h
@@ -24,6 +24,7 @@ enum {
PCA9450_LDO3,
PCA9450_LDO4,
PCA9450_LDO5,
+ PCA9450_LOADSW,
PCA9450_REGULATOR_CNT,
};
@@ -209,6 +210,9 @@ enum {
#define LDO5H_EN_MASK 0xC0
#define LDO5HOUT_MASK 0x0F
+/* PCA9450_REG_LOADSW_CTRL bits */
+#define LOADSW_CTRL_EN_MASK 0x03
+
/* PCA9450_REG_IRQ bits */
#define IRQ_PWRON 0x80
#define IRQ_WDOGB 0x40
--
2.34.1
--
- Confidential -
next prev parent reply other threads:[~2023-03-17 9:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-17 9:39 [PATCH 0/2] regulator: pca9450: add " Nicolas Heemeryck
2023-03-17 9:39 ` Nicolas Heemeryck [this message]
2023-03-17 9:39 ` [PATCH 2/2] bindings: regulator: pca9450: Add " Nicolas Heemeryck
2023-03-17 11:49 ` Krzysztof Kozlowski
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=20230317093911.1254530-2-nicolas.heemeryck@devialet.com \
--to=nicolas.heemeryck@devialet.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.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®