From: Keerthy <j-keerthy@ti.com>
To: <lee.jones@linaro.org>, <robh+dt@kernel.org>, <broonie@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-omap@vger.kernel.org>, <t-kristo@ti.com>,
<j-keerthy@ti.com>
Subject: [PATCH v2 3/3] regulator: lp87565: Add 4-phase lp87561 regulator support
Date: Thu, 16 May 2019 10:02:18 +0530 [thread overview]
Message-ID: <20190516043218.8222-4-j-keerthy@ti.com> (raw)
In-Reply-To: <20190516043218.8222-1-j-keerthy@ti.com>
The LP8756x family has a single output 4-phase regulator
configuration. Add support for the same. The control
lies in the master buck which is buck0 for 4-phase
configuration. Enable/disable/voltage set happen via
buck0 registers.
Data Sheet: https://www.ti.com/lit/ds/symlink/lp87561-q1.pdf
Signed-off-by: Keerthy <j-keerthy@ti.com>
---
Changes in v2:
* Changed if/else block to switch statement.
drivers/regulator/lp87565-regulator.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/lp87565-regulator.c b/drivers/regulator/lp87565-regulator.c
index 81eb4b890c0c..af00d1ffcf33 100644
--- a/drivers/regulator/lp87565-regulator.c
+++ b/drivers/regulator/lp87565-regulator.c
@@ -153,6 +153,12 @@ static const struct lp87565_regulator regulators[] = {
LP87565_REG_BUCK2_CTRL_1,
LP87565_BUCK_CTRL_1_EN, 3230,
buck0_1_2_3_ranges, LP87565_REG_BUCK2_CTRL_2),
+ LP87565_REGULATOR("BUCK3210", LP87565_BUCK_3210, "buck3210",
+ lp87565_buck_ops, 256, LP87565_REG_BUCK0_VOUT,
+ LP87565_BUCK_VSET, LP87565_REG_BUCK0_CTRL_1,
+ LP87565_BUCK_CTRL_1_EN |
+ LP87565_BUCK_CTRL_1_FPWM_MP_0_2, 3230,
+ buck0_1_2_3_ranges, LP87565_REG_BUCK0_CTRL_2),
};
static int lp87565_regulator_probe(struct platform_device *pdev)
@@ -169,9 +175,18 @@ static int lp87565_regulator_probe(struct platform_device *pdev)
config.driver_data = lp87565;
config.regmap = lp87565->regmap;
- if (lp87565->dev_type == LP87565_DEVICE_TYPE_LP87565_Q1) {
+ switch (lp87565->dev_type) {
+ case LP87565_DEVICE_TYPE_LP87565_Q1:
min_idx = LP87565_BUCK_10;
max_idx = LP87565_BUCK_23;
+ break;
+ case LP87565_DEVICE_TYPE_LP87561_Q1:
+ min_idx = LP87565_BUCK_3210;
+ max_idx = LP87565_BUCK_3210;
+ default:
+ dev_err(lp87565->dev, "Invalid lp config %d\n",
+ lp87565->dev_type);
+ return -EINVAL;
}
for (i = min_idx; i <= max_idx; i++) {
--
2.17.1
next prev parent reply other threads:[~2019-05-16 4:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-16 4:32 [PATCH v2 0/3] mfd: lp87565: Add support for 4-phase lp87561 combination Keerthy
2019-05-16 4:32 ` [PATCH v2 1/3] dt-bindings: mfd: lp87565: Add lp87561 configuration Keerthy
2019-06-13 21:28 ` Rob Herring
2019-05-16 4:32 ` [PATCH v2 2/3] mfd: lp87565: Add support for 4-phase lp87561 combination Keerthy
2019-05-16 4:32 ` Keerthy [this message]
2019-05-22 15:35 ` [PATCH v2 3/3] regulator: lp87565: Add 4-phase lp87561 regulator support Mark Brown
2019-05-28 9:53 ` Keerthy
2019-05-28 13:27 ` Mark Brown
2019-06-08 3:56 ` keerthy
2019-06-08 19:51 ` Mark Brown
2019-06-10 5:48 ` Lee Jones
2019-06-12 10:47 ` Keerthy
2019-06-12 14:33 ` Lee Jones
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=20190516043218.8222-4-j-keerthy@ti.com \
--to=j-keerthy@ti.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=t-kristo@ti.com \
/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 NNTP newsgroup(s).