Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1325797
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Applied "regulator: axp20x: Use linear voltage ranges for AXP20X LDO4" to the regulator tree |
| Date | 2016-02-03 19:20 +0100 |
| Message-ID | <qYac3-5uj-45@gated-at.bofh.it> (permalink) |
| References | <qXGnF-1ad-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The patch
regulator: axp20x: Use linear voltage ranges for AXP20X LDO4
has been applied to the regulator tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
From 13d57e64352a5d3457d7782bc2f8b576e12b05f3 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <wens@csie.org>
Date: Tue, 2 Feb 2016 18:27:38 +0800
Subject: [PATCH] regulator: axp20x: Use linear voltage ranges for AXP20X LDO4
AXP20X datasheet lists the possible voltage settings for LDO4, so
it was implemented using a voltage table. Upon closer examination,
the valid voltages can be mapped into 3 linear ranges.
Move AXP20X LDO4 to use linear ranges. The supporting code can be
reused with later AXP8xx PMICs, which have a number of regulators
that have 2 linear ranges.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
drivers/regulator/axp20x-regulator.c | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index fafaaa8eb8b3..7d29893f833c 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -106,8 +106,8 @@
.ops = &axp20x_ops_fixed \
}
-#define AXP_DESC_TABLE(_family, _id, _match, _supply, _table, _vreg, _vmask, \
- _ereg, _emask) \
+#define AXP_DESC_RANGES(_family, _id, _match, _supply, _ranges, _n_voltages, \
+ _vreg, _vmask, _ereg, _emask) \
[_family##_##_id] = { \
.name = #_id, \
.supply_name = (_supply), \
@@ -115,30 +115,25 @@
.regulators_node = of_match_ptr("regulators"), \
.type = REGULATOR_VOLTAGE, \
.id = _family##_##_id, \
- .n_voltages = ARRAY_SIZE(_table), \
+ .n_voltages = (_n_voltages), \
.owner = THIS_MODULE, \
.vsel_reg = (_vreg), \
.vsel_mask = (_vmask), \
.enable_reg = (_ereg), \
.enable_mask = (_emask), \
- .volt_table = (_table), \
- .ops = &axp20x_ops_table, \
+ .linear_ranges = (_ranges), \
+ .n_linear_ranges = ARRAY_SIZE(_ranges), \
+ .ops = &axp20x_ops_range, \
}
-static const int axp20x_ldo4_data[] = { 1250000, 1300000, 1400000, 1500000, 1600000,
- 1700000, 1800000, 1900000, 2000000, 2500000,
- 2700000, 2800000, 3000000, 3100000, 3200000,
- 3300000 };
-
static struct regulator_ops axp20x_ops_fixed = {
.list_voltage = regulator_list_voltage_linear,
};
-static struct regulator_ops axp20x_ops_table = {
+static struct regulator_ops axp20x_ops_range = {
.set_voltage_sel = regulator_set_voltage_sel_regmap,
.get_voltage_sel = regulator_get_voltage_sel_regmap,
- .list_voltage = regulator_list_voltage_table,
- .map_voltage = regulator_map_voltage_ascend,
+ .list_voltage = regulator_list_voltage_linear_range,
.enable = regulator_enable_regmap,
.disable = regulator_disable_regmap,
.is_enabled = regulator_is_enabled_regmap,
@@ -159,6 +154,12 @@ static struct regulator_ops axp20x_ops_sw = {
.is_enabled = regulator_is_enabled_regmap,
};
+static const struct regulator_linear_range axp20x_ldo4_ranges[] = {
+ REGULATOR_LINEAR_RANGE(1250000, 0x0, 0x0, 0),
+ REGULATOR_LINEAR_RANGE(1300000, 0x1, 0x8, 100000),
+ REGULATOR_LINEAR_RANGE(2500000, 0x9, 0xf, 100000),
+};
+
static const struct regulator_desc axp20x_regulators[] = {
AXP_DESC(AXP20X, DCDC2, "dcdc2", "vin2", 700, 2275, 25,
AXP20X_DCDC2_V_OUT, 0x3f, AXP20X_PWR_OUT_CTRL, 0x10),
@@ -169,8 +170,9 @@ static const struct regulator_desc axp20x_regulators[] = {
AXP20X_LDO24_V_OUT, 0xf0, AXP20X_PWR_OUT_CTRL, 0x04),
AXP_DESC(AXP20X, LDO3, "ldo3", "ldo3in", 700, 3500, 25,
AXP20X_LDO3_V_OUT, 0x7f, AXP20X_PWR_OUT_CTRL, 0x40),
- AXP_DESC_TABLE(AXP20X, LDO4, "ldo4", "ldo24in", axp20x_ldo4_data,
- AXP20X_LDO24_V_OUT, 0x0f, AXP20X_PWR_OUT_CTRL, 0x08),
+ AXP_DESC_RANGES(AXP20X, LDO4, "ldo4", "ldo24in", axp20x_ldo4_ranges,
+ 16, AXP20X_LDO24_V_OUT, 0x0f, AXP20X_PWR_OUT_CTRL,
+ 0x08),
AXP_DESC_IO(AXP20X, LDO5, "ldo5", "ldo5in", 1800, 3300, 100,
AXP20X_LDO5_V_OUT, 0xf0, AXP20X_GPIO0_CTRL, 0x07,
AXP20X_IO_ENABLED, AXP20X_IO_DISABLED),
--
2.7.0.rc3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/11] mfd: axp20x: Add support for AXP809 PMIC Chen-Yu Tsai <wens@csie.org> - 2016-02-02 11:30 +0100
[PATCH 02/11] mfd: axp20x: Add bindings for AXP809 PMIC Chen-Yu Tsai <wens@csie.org> - 2016-02-02 11:30 +0100
Re: [PATCH 02/11] mfd: axp20x: Add bindings for AXP809 PMIC Rob Herring <robh@kernel.org> - 2016-02-02 23:50 +0100
[PATCH 05/11] regulator: axp20x: Use linear voltage ranges for AXP20X LDO4 Chen-Yu Tsai <wens@csie.org> - 2016-02-02 11:30 +0100
Applied "regulator: axp20x: Use linear voltage ranges for AXP20X LDO4" to the regulator tree Mark Brown <broonie@kernel.org> - 2016-02-03 19:20 +0100
[PATCH 08/11] ARM: dts: sun9i: a80-optimus: Add AXP809 PMIC device node and regulators Chen-Yu Tsai <wens@csie.org> - 2016-02-02 11:30 +0100
[PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers Chen-Yu Tsai <wens@csie.org> - 2016-02-02 11:30 +0100
Re: [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-02-02 14:30 +0100
Re: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers Julian Calaby <julian.calaby@gmail.com> - 2016-02-03 01:30 +0100
Re: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers Joe Perches <joe@perches.com> - 2016-02-03 02:30 +0100
Re: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers Julian Calaby <julian.calaby@gmail.com> - 2016-02-03 02:40 +0100
Re: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers Chen-Yu Tsai <wens@csie.org> - 2016-02-03 08:00 +0100
[PATCH 04/11] regulator: axp20x: Remove voltage readout support for switch regulators Chen-Yu Tsai <wens@csie.org> - 2016-02-02 11:30 +0100
Applied "regulator: axp20x: Remove voltage readout support for switch regulators" to the regulator tree Mark Brown <broonie@kernel.org> - 2016-02-03 19:20 +0100
[PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC Chen-Yu Tsai <wens@csie.org> - 2016-02-02 11:40 +0100
Re: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC Mark Brown <broonie@kernel.org> - 2016-02-02 13:20 +0100
Re: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC Chen-Yu Tsai <wens@csie.org> - 2016-02-06 13:50 +0100
Re: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC Mark Brown <broonie@kernel.org> - 2016-02-08 16:00 +0100
Re: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC Chen-Yu Tsai <wens@csie.org> - 2016-02-08 16:00 +0100
Re: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC Mark Brown <broonie@kernel.org> - 2016-02-08 17:30 +0100
Re: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC Chen-Yu Tsai <wens@csie.org> - 2016-02-09 06:50 +0100
[PATCH 10/11] ARM: dts: sun9i: a80-optimus: Disable dummy regulators vcc3v0, vcc3v3, vcc5v0 Chen-Yu Tsai <wens@csie.org> - 2016-02-02 11:40 +0100
Re: [PATCH 10/11] ARM: dts: sun9i: a80-optimus: Disable dummy regulators vcc3v0, vcc3v3, vcc5v0 Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-02-02 17:30 +0100
Re: [PATCH 10/11] ARM: dts: sun9i: a80-optimus: Disable dummy regulators vcc3v0, vcc3v3, vcc5v0 Chen-Yu Tsai <wens@csie.org> - 2016-02-02 17:50 +0100
Re: [PATCH 10/11] ARM: dts: sun9i: a80-optimus: Disable dummy regulators vcc3v0, vcc3v3, vcc5v0 Maxime Ripard <maxime.ripard@free-electrons.com> - 2016-02-04 20:00 +0100
[PATCH 06/11] regulator: axp20x: support AXP809 variant Chen-Yu Tsai <wens@csie.org> - 2016-02-02 11:40 +0100
Re: [PATCH 06/11] regulator: axp20x: support AXP809 variant Mark Brown <broonie@kernel.org> - 2016-02-03 18:20 +0100
[PATCH 03/11] mfd: axp20x: Add support for AXP809 PMIC Chen-Yu Tsai <wens@csie.org> - 2016-02-02 11:40 +0100
csiph-web