Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1323945 > unrolled thread

[PATCH 00/11] mfd: axp20x: Add support for AXP809 PMIC

Started byChen-Yu Tsai <wens@csie.org>
First post2016-02-02 11:30 +0100
Last post2016-02-02 11:40 +0100
Articles 20 on this page of 30 — 7 participants

Back to article view | Back to linux.kernel


Contents

  [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
        Re: [PATCH 02/11] mfd: axp20x: Add bindings for AXP809 PMIC Lee Jones <lee.jones@linaro.org> - 2016-02-09 11:20 +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
                  Re: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC Mark Brown <broonie@kernel.org> - 2016-02-09 12:40 +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

Page 1 of 2  [1] 2  Next page →


#1323945 — [PATCH 00/11] mfd: axp20x: Add support for AXP809 PMIC

FromChen-Yu Tsai <wens@csie.org>
Date2016-02-02 11:30 +0100
Subject[PATCH 00/11] mfd: axp20x: Add support for AXP809 PMIC
Message-ID<qXGnD-1ad-3@gated-at.bofh.it>
Hi everyone,

This series adds support for X-Powers' AXP809 PMIC. This is the primary
PMIC accompanying Allwinner's A80 SoC. For now, only the power button
(PEK) and regulators are supported. These are supported using existing
axp20x drivers. This is based on the AXP223 series v7.

Patch 1 adds a MAINTAINERS entry for the X-Powers AXP PMICs. I list
myself as the maintainer.

Patch 2 adds AXP809 to the axp20x bindings.

Patch 3 adds AXP809 support to the axp20x mfd driver.

Patch 4 removes voltage readout for switch outputs.

Patch 5 converts AXP20X LDO4 from using voltage tables to linear voltage
ranges. Either one works, but regulators found on later PMICs match up
with linear ranges better.

Patch 6 adds AXP809 support to the axp20x regulator driver. This patch
depends on the previous 3 patches. It's probably easier to apply them
together.

Patch 7 adds a dtsi file for AXP809.

Patch 8 enables AXP809 support on the A80 Optimus board.

Patch 9 enables AXP809 support on the Cubieboard 4.

Patch 10 disables the dummy regulators from sunxi-common-regulators.dtsi
on the A80 Optimus board. These aren't used in the board DTS anymore.

Patch 11 disables the dummy regulators from sunxi-common-regulators.dtsi,
on the Cubieboard4. These aren't used in the board DTS anymore.


Regards
ChenYu


Chen-Yu Tsai (11):
  MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers
  mfd: axp20x: Add bindings for AXP809 PMIC
  mfd: axp20x: Add support for AXP809 PMIC
  regulator: axp20x: Remove voltage readout support for switch
    regulators
  regulator: axp20x: Use linear voltage ranges for AXP20X LDO4
  regulator: axp20x: support AXP809 variant
  ARM: dts: sunxi: Add dtsi file for AXP809 PMIC
  ARM: dts: sun9i: a80-optimus: Add AXP809 PMIC device node and
    regulators
  ARM: dts: sun9i: cubieboard4: Add AXP809 PMIC device node and
    regulators
  ARM: dts: sun9i: a80-optimus: Disable dummy regulators vcc3v0, vcc3v3,
    vcc5v0
  ARM: dts: sun9i: cubieboard4: Disable dummy regulators vcc3v0, vcc3v3,
    vcc5v0

 Documentation/devicetree/bindings/mfd/axp20x.txt   |  31 +++-
 MAINTAINERS                                        |   6 +
 .../dts/{sun9i-a80-cubieboard4.dts => axp809.dtsi} | 151 ++++++++++---------
 arch/arm/boot/dts/sun9i-a80-cubieboard4.dts        | 133 ++++++++++++++++-
 arch/arm/boot/dts/sun9i-a80-optimus.dts            | 133 ++++++++++++++++-
 drivers/mfd/axp20x-rsb.c                           |   1 +
 drivers/mfd/axp20x.c                               |  79 ++++++++++
 drivers/regulator/axp20x-regulator.c               | 165 ++++++++++++++-------
 include/linux/mfd/axp20x.h                         |  59 ++++++++
 9 files changed, 623 insertions(+), 135 deletions(-)
 copy arch/arm/boot/dts/{sun9i-a80-cubieboard4.dts => axp809.dtsi} (53%)

-- 
2.7.0

[toc] | [next] | [standalone]


#1323946 — [PATCH 02/11] mfd: axp20x: Add bindings for AXP809 PMIC

FromChen-Yu Tsai <wens@csie.org>
Date2016-02-02 11:30 +0100
Subject[PATCH 02/11] mfd: axp20x: Add bindings for AXP809 PMIC
Message-ID<qXGnE-1ad-15@gated-at.bofh.it>
In reply to#1323945
This patch adds the basic and regulator bindings for the X-Powers AXP809
PMIC.

Also update the DC-DC converter operating frequency for AXP22X/AXP80X.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 Documentation/devicetree/bindings/mfd/axp20x.txt | 31 ++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt
index fd39fa54571b..d20b1034e967 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -6,10 +6,11 @@ axp202 (X-Powers)
 axp209 (X-Powers)
 axp221 (X-Powers)
 axp223 (X-Powers)
+axp809 (X-Powers)
 
 Required properties:
 - compatible: "x-powers,axp152", "x-powers,axp202", "x-powers,axp209",
-	      "x-powers,axp221", "x-powers,axp223"
+	      "x-powers,axp221", "x-powers,axp223", "x-powers,axp809"
 - reg: The I2C slave address or RSB hardware address for the AXP chip
 - interrupt-parent: The parent interrupt controller
 - interrupts: SoC NMI / GPIO interrupt connected to the PMIC's IRQ pin
@@ -18,7 +19,9 @@ Required properties:
 
 Optional properties:
 - x-powers,dcdc-freq: defines the work frequency of DC-DC in KHz
-		      (range: 750-1875). Default: 1.5MHz
+		      AXP152/20X: range:  750-1875, Default: 1.5 MHz
+		      AXP22X/80X: range: 1800-4050, Default: 3   MHz
+
 - <input>-supply: a phandle to the regulator supply node. May be omitted if
 		  inputs are unregulated, such as using the IPSOUT output
 		  from the PMIC.
@@ -77,6 +80,30 @@ LDO_IO0		: LDO		: ips-supply		: GPIO 0
 LDO_IO1		: LDO		: ips-supply		: GPIO 1
 RTC_LDO		: LDO		: ips-supply		: always on
 
+AXP809 regulators, type, and corresponding input supply names:
+
+Regulator	  Type		  Supply Name		  Notes
+---------	  ----		  -----------		  -----
+DCDC1		: DC-DC buck	: vin1-supply
+DCDC2		: DC-DC buck	: vin2-supply
+DCDC3		: DC-DC	buck	: vin3-supply
+DCDC4		: DC-DC	buck	: vin4-supply
+DCDC5		: DC-DC	buck	: vin5-supply
+DC1SW		: On/Off Switch	:			: DCDC1 secondary output
+DC5LDO		: LDO		:			: input from DCDC5
+ALDO1		: LDO		: aldoin-supply		: shared supply
+ALDO2		: LDO		: aldoin-supply		: shared supply
+ALDO3		: LDO		: aldoin-supply		: shared supply
+DLDO1		: LDO		: dldoin-supply		: shared supply
+DLDO2		: LDO		: dldoin-supply		: shared supply
+ELDO1		: LDO		: eldoin-supply		: shared supply
+ELDO2		: LDO		: eldoin-supply		: shared supply
+ELDO3		: LDO		: eldoin-supply		: shared supply
+LDO_IO0		: LDO		: ips-supply		: GPIO 0
+LDO_IO1		: LDO		: ips-supply		: GPIO 1
+RTC_LDO		: LDO		: ips-supply		: always on
+SW		: On/Off Switch : swin-supply
+
 Example:
 
 axp209: pmic@34 {
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1324704 — Re: [PATCH 02/11] mfd: axp20x: Add bindings for AXP809 PMIC

FromRob Herring <robh@kernel.org>
Date2016-02-02 23:50 +0100
SubjectRe: [PATCH 02/11] mfd: axp20x: Add bindings for AXP809 PMIC
Message-ID<qXRVM-1tU-19@gated-at.bofh.it>
In reply to#1323946
On Tue, Feb 02, 2016 at 06:27:35PM +0800, Chen-Yu Tsai wrote:
> This patch adds the basic and regulator bindings for the X-Powers AXP809
> PMIC.
> 
> Also update the DC-DC converter operating frequency for AXP22X/AXP80X.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  Documentation/devicetree/bindings/mfd/axp20x.txt | 31 ++++++++++++++++++++++--
>  1 file changed, 29 insertions(+), 2 deletions(-)

Acked-by: Rob Herring <robh@kernel.org>

[toc] | [prev] | [next] | [standalone]


#1330024 — Re: [PATCH 02/11] mfd: axp20x: Add bindings for AXP809 PMIC

FromLee Jones <lee.jones@linaro.org>
Date2016-02-09 11:20 +0100
SubjectRe: [PATCH 02/11] mfd: axp20x: Add bindings for AXP809 PMIC
Message-ID<r0dyO-2DB-25@gated-at.bofh.it>
In reply to#1324704
On Tue, 02 Feb 2016, Rob Herring wrote:

> On Tue, Feb 02, 2016 at 06:27:35PM +0800, Chen-Yu Tsai wrote:
> > This patch adds the basic and regulator bindings for the X-Powers AXP809
> > PMIC.
> > 
> > Also update the DC-DC converter operating frequency for AXP22X/AXP80X.
> > 
> > Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> > ---
> >  Documentation/devicetree/bindings/mfd/axp20x.txt | 31 ++++++++++++++++++++++--
> >  1 file changed, 29 insertions(+), 2 deletions(-)
> 
> Acked-by: Rob Herring <robh@kernel.org>

No idea what's going on here.  Somehow I must have been in the
Reply-To, but never actually sent the patches initially.  So I have
people's replies, but not the original submission.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [next] | [standalone]


#1323950 — [PATCH 05/11] regulator: axp20x: Use linear voltage ranges for AXP20X LDO4

FromChen-Yu Tsai <wens@csie.org>
Date2016-02-02 11:30 +0100
Subject[PATCH 05/11] regulator: axp20x: Use linear voltage ranges for AXP20X LDO4
Message-ID<qXGnF-1ad-25@gated-at.bofh.it>
In reply to#1323945
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>
---
 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 f31d238e85e8..81f25383f2d5 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

[toc] | [prev] | [next] | [standalone]


#1325797 — Applied "regulator: axp20x: Use linear voltage ranges for AXP20X LDO4" to the regulator tree

FromMark Brown <broonie@kernel.org>
Date2016-02-03 19:20 +0100
SubjectApplied "regulator: axp20x: Use linear voltage ranges for AXP20X LDO4" to the regulator tree
Message-ID<qYac3-5uj-45@gated-at.bofh.it>
In reply to#1323950
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

[toc] | [prev] | [next] | [standalone]


#1323951 — [PATCH 08/11] ARM: dts: sun9i: a80-optimus: Add AXP809 PMIC device node and regulators

FromChen-Yu Tsai <wens@csie.org>
Date2016-02-02 11:30 +0100
Subject[PATCH 08/11] ARM: dts: sun9i: a80-optimus: Add AXP809 PMIC device node and regulators
Message-ID<qXGnF-1ad-35@gated-at.bofh.it>
In reply to#1323945
The AXP809 PMIC is the primary PMIC. It provides various supply voltages
for the SoC and other peripherals. The PMIC's interrupt line is
connected to NMI pin of the SoC.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/sun9i-a80-optimus.dts | 121 +++++++++++++++++++++++++++++++-
 1 file changed, 119 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
index 958160e40fd0..7f6bf6138966 100644
--- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
+++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
@@ -161,7 +161,7 @@
 &mmc0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc0_pins>, <&mmc0_cd_pin_optimus>;
-	vmmc-supply = <&reg_vcc3v0>;
+	vmmc-supply = <&reg_dcdc1>;
 	bus-width = <4>;
 	cd-gpios = <&pio 7 18 GPIO_ACTIVE_HIGH>; /* PH8 */
 	cd-inverted;
@@ -171,7 +171,7 @@
 &mmc2 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&mmc2_8bit_pins>;
-	vmmc-supply = <&reg_vcc3v0>;
+	vmmc-supply = <&reg_dcdc1>;
 	bus-width = <8>;
 	non-removable;
 	cap-mmc-hw-reset;
@@ -204,6 +204,123 @@
 
 &r_rsb {
 	status = "okay";
+
+	axp809: pmic@3a3 {
+		reg = <0x3a3>;
+		interrupt-parent = <&nmi_intc>;
+		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+	};
+};
+
+#include "axp809.dtsi"
+
+&reg_aldo1 {
+	/* TODO: This should be handled by the USB PHY driver */
+	regulator-always-on;
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-name = "vcc33-usbh";
+};
+
+&reg_aldo2 {
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+	regulator-name = "vcc-pb-io-cam";
+};
+
+&reg_dc5ldo {
+	regulator-always-on;
+	regulator-min-microvolt = <800000>;
+	regulator-max-microvolt = <1100000>;
+	regulator-name = "vdd-cpus-09-usbh";
+};
+
+&reg_dcdc1 {
+	regulator-always-on;
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-name = "vcc-3v";
+};
+
+&reg_dcdc2 {
+	regulator-min-microvolt = <800000>;
+	regulator-max-microvolt = <1100000>;
+	regulator-name = "vdd-gpu";
+};
+
+&reg_dcdc3 {
+	regulator-always-on;
+	regulator-min-microvolt = <800000>;
+	regulator-max-microvolt = <1100000>;
+	regulator-name = "vdd-cpua";
+};
+
+&reg_dcdc4 {
+	regulator-always-on;
+	regulator-min-microvolt = <800000>;
+	regulator-max-microvolt = <1100000>;
+	regulator-name = "vdd-sys-usb0-hdmi";
+};
+
+&reg_dcdc5 {
+	regulator-always-on;
+	regulator-min-microvolt = <1425000>;
+	regulator-max-microvolt = <1575000>;
+	regulator-name = "vcc-dram";
+};
+
+&reg_dldo1 {
+	/*
+	 * The WiFi chip supports a wide range (3.0 ~ 4.8V) of voltages,
+	 * and so does this regulator (3.0 ~ 4.2V), but Allwinner SDK
+	 * always sets it to 3.3V.
+	 */
+	regulator-min-microvolt = <3300000>;
+	regulator-max-microvolt = <3300000>;
+	regulator-name = "vcc-wifi";
+};
+
+&reg_dldo2 {
+	regulator-always-on;
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-name = "vcc-pl";
+};
+
+&reg_eldo1 {
+	regulator-min-microvolt = <1200000>;
+	regulator-max-microvolt = <1200000>;
+	regulator-name = "vcc-dvdd-cam";
+};
+
+&reg_eldo2 {
+	regulator-min-microvolt = <1800000>;
+	regulator-max-microvolt = <1800000>;
+	regulator-name = "vcc-pe";
+};
+
+&reg_eldo3 {
+	regulator-always-on;
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-name = "vcc-pm-codec-io1";
+};
+
+&reg_ldo_io0 {
+	regulator-always-on;
+	regulator-min-microvolt = <3000000>;
+	regulator-max-microvolt = <3000000>;
+	regulator-name = "vcc-pg";
+};
+
+&reg_ldo_io1 {
+	regulator-min-microvolt = <2500000>;
+	regulator-max-microvolt = <2500000>;
+	regulator-name = "vcc-pa-gmac-2v5";
+};
+
+&reg_rtc_ldo {
+	regulator-name = "vcc-rtc-vdd1v8-io";
 };
 
 &uart0 {
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1323952 — [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers

FromChen-Yu Tsai <wens@csie.org>
Date2016-02-02 11:30 +0100
Subject[PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers
Message-ID<qXGnF-1ad-39@gated-at.bofh.it>
In reply to#1323945
Add an entry for X-Powers AXP family PMIC drivers and list myself
as maintainer.

Cc: Carlo Caione <carlo@caione.org>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Cc: Todd Brandt <todd.e.brandt@linux.intel.com>
Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index f678c37107f5..7ea4e54f566a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11941,6 +11941,12 @@ F:	include/linux/workqueue.h
 F:	kernel/workqueue.c
 F:	Documentation/workqueue.txt
 
+X-POWERS MULTIFUNCTION PMIC DEVICE DRIVERS
+M:	Chen-Yu Tsai <wens@csie.org>
+L:	linux-kernel@vger.kernel.org
+S:	Maintained
+N:	axp[128]
+
 X.25 NETWORK LAYER
 M:	Andrew Hendry <andrew.hendry@gmail.com>
 L:	linux-x25@vger.kernel.org
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1324075 — Re: [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers

FromMaxime Ripard <maxime.ripard@free-electrons.com>
Date2016-02-02 14:30 +0100
SubjectRe: [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers
Message-ID<qXJbQ-3xo-9@gated-at.bofh.it>
In reply to#1323952

[Multipart message — attachments visible in raw view] — view raw

On Tue, Feb 02, 2016 at 06:27:34PM +0800, Chen-Yu Tsai wrote:
> Add an entry for X-Powers AXP family PMIC drivers and list myself
> as maintainer.
> 
> Cc: Carlo Caione <carlo@caione.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
> Cc: Todd Brandt <todd.e.brandt@linux.intel.com>
> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1324759 — Re: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers

FromJulian Calaby <julian.calaby@gmail.com>
Date2016-02-03 01:30 +0100
SubjectRe: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers
Message-ID<qXTuy-2P5-11@gated-at.bofh.it>
In reply to#1323952
Hi Chen-Yu,

On Tue, Feb 2, 2016 at 9:27 PM, Chen-Yu Tsai <wens@csie.org> wrote:
> Add an entry for X-Powers AXP family PMIC drivers and list myself
> as maintainer.
>
> Cc: Carlo Caione <carlo@caione.org>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
> Cc: Todd Brandt <todd.e.brandt@linux.intel.com>
> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
>  MAINTAINERS | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f678c37107f5..7ea4e54f566a 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -11941,6 +11941,12 @@ F:     include/linux/workqueue.h
>  F:     kernel/workqueue.c
>  F:     Documentation/workqueue.txt
>
> +X-POWERS MULTIFUNCTION PMIC DEVICE DRIVERS
> +M:     Chen-Yu Tsai <wens@csie.org>
> +L:     linux-kernel@vger.kernel.org
> +S:     Maintained
> +N:     axp[128]

Should you list the files maintained and this list also?

> +
>  X.25 NETWORK LAYER
>  M:     Andrew Hendry <andrew.hendry@gmail.com>
>  L:     linux-x25@vger.kernel.org

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

[toc] | [prev] | [next] | [standalone]


#1324803 — Re: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers

FromJoe Perches <joe@perches.com>
Date2016-02-03 02:30 +0100
SubjectRe: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers
Message-ID<qXUqB-3w4-7@gated-at.bofh.it>
In reply to#1324759
On Wed, 2016-02-03 at 11:19 +1100, Julian Calaby wrote:
> On Tue, Feb 2, 2016 at 9:27 PM, Chen-Yu Tsai <wens@csie.org> wrote:
> > Add an entry for X-Powers AXP family PMIC drivers and list myself
> > as maintainer.
[]
> > diff --git a/MAINTAINERS b/MAINTAINERS
[]
> > @@ -11941,6 +11941,12 @@ F:     include/linux/workqueue.h
> >  F:     kernel/workqueue.c
> >  F:     Documentation/workqueue.txt
> > 
> > +X-POWERS MULTIFUNCTION PMIC DEVICE DRIVERS
> > +M:     Chen-Yu Tsai <wens@csie.org>
> > +L:     linux-kernel@vger.kernel.org
> > +S:     Maintained
> > +N:     axp[128]
> 
> Should you list the files maintained and this list also?

This "N:" pattern is kind of a wildcard.

The difference between F: and N: is that git history
is also used by default for files that match.

There are no files in -next today that match "*axp8*"
Dunno if this patchset added any.

This matches:

    $ git ls-files | grep "axp[128]"
    Documentation/devicetree/bindings/mfd/axp20x.txt
    Documentation/devicetree/bindings/power_supply/axp20x_usb_power.txt
    arch/arm/boot/dts/axp152.dtsi
    arch/arm/boot/dts/axp209.dtsi
    arch/arm/boot/dts/axp22x.dtsi
    drivers/extcon/extcon-axp288.c
    drivers/iio/adc/axp288_adc.c
    drivers/input/misc/axp20x-pek.c
    drivers/mfd/axp20x.c
    drivers/power/axp20x_usb_power.c
    drivers/power/axp288_charger.c
    drivers/power/axp288_fuel_gauge.c
    drivers/regulator/axp20x-regulator.c
    include/linux/mfd/axp20x.h

Are all these files appropriate?

[toc] | [prev] | [next] | [standalone]


#1324806 — Re: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers

FromJulian Calaby <julian.calaby@gmail.com>
Date2016-02-03 02:40 +0100
SubjectRe: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers
Message-ID<qXUAh-3B6-1@gated-at.bofh.it>
In reply to#1324803
Hi Joe,

On Wed, Feb 3, 2016 at 12:28 PM, Joe Perches <joe@perches.com> wrote:
> On Wed, 2016-02-03 at 11:19 +1100, Julian Calaby wrote:
>> On Tue, Feb 2, 2016 at 9:27 PM, Chen-Yu Tsai <wens@csie.org> wrote:
>> > Add an entry for X-Powers AXP family PMIC drivers and list myself
>> > as maintainer.
> []
>> > diff --git a/MAINTAINERS b/MAINTAINERS
> []
>> > @@ -11941,6 +11941,12 @@ F:     include/linux/workqueue.h
>> >  F:     kernel/workqueue.c
>> >  F:     Documentation/workqueue.txt
>> >
>> > +X-POWERS MULTIFUNCTION PMIC DEVICE DRIVERS
>> > +M:     Chen-Yu Tsai <wens@csie.org>
>> > +L:     linux-kernel@vger.kernel.org
>> > +S:     Maintained
>> > +N:     axp[128]
>>
>> Should you list the files maintained and this list also?
>
> This "N:" pattern is kind of a wildcard.
>
> The difference between F: and N: is that git history
> is also used by default for files that match.
>
> There are no files in -next today that match "*axp8*"
> Dunno if this patchset added any.
>
> This matches:
>
>     $ git ls-files | grep "axp[128]"
>     Documentation/devicetree/bindings/mfd/axp20x.txt
>     Documentation/devicetree/bindings/power_supply/axp20x_usb_power.txt
>     arch/arm/boot/dts/axp152.dtsi
>     arch/arm/boot/dts/axp209.dtsi
>     arch/arm/boot/dts/axp22x.dtsi
>     drivers/extcon/extcon-axp288.c
>     drivers/iio/adc/axp288_adc.c
>     drivers/input/misc/axp20x-pek.c
>     drivers/mfd/axp20x.c
>     drivers/power/axp20x_usb_power.c
>     drivers/power/axp288_charger.c
>     drivers/power/axp288_fuel_gauge.c
>     drivers/regulator/axp20x-regulator.c
>     include/linux/mfd/axp20x.h
>
> Are all these files appropriate?
>

I didn't know about the "N:" tag, and consequently I retract my comment.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

[toc] | [prev] | [next] | [standalone]


#1324975 — Re: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers

FromChen-Yu Tsai <wens@csie.org>
Date2016-02-03 08:00 +0100
SubjectRe: [linux-sunxi] [PATCH 01/11] MAINTAINERS: Add entry for X-Powers AXP family PMIC drivers
Message-ID<qXZzZ-6PO-15@gated-at.bofh.it>
In reply to#1324803
On Wed, Feb 3, 2016 at 9:28 AM, Joe Perches <joe@perches.com> wrote:
> On Wed, 2016-02-03 at 11:19 +1100, Julian Calaby wrote:
>> On Tue, Feb 2, 2016 at 9:27 PM, Chen-Yu Tsai <wens@csie.org> wrote:
>> > Add an entry for X-Powers AXP family PMIC drivers and list myself
>> > as maintainer.
> []
>> > diff --git a/MAINTAINERS b/MAINTAINERS
> []
>> > @@ -11941,6 +11941,12 @@ F:     include/linux/workqueue.h
>> >  F:     kernel/workqueue.c
>> >  F:     Documentation/workqueue.txt
>> >
>> > +X-POWERS MULTIFUNCTION PMIC DEVICE DRIVERS
>> > +M:     Chen-Yu Tsai <wens@csie.org>
>> > +L:     linux-kernel@vger.kernel.org
>> > +S:     Maintained
>> > +N:     axp[128]
>>
>> Should you list the files maintained and this list also?
>
> This "N:" pattern is kind of a wildcard.
>
> The difference between F: and N: is that git history
> is also used by default for files that match.
>
> There are no files in -next today that match "*axp8*"
> Dunno if this patchset added any.

This set adds a "axp809.dtsi". A subsequent set will add "axp806.dtsi".

> This matches:
>
>     $ git ls-files | grep "axp[128]"
>     Documentation/devicetree/bindings/mfd/axp20x.txt
>     Documentation/devicetree/bindings/power_supply/axp20x_usb_power.txt
>     arch/arm/boot/dts/axp152.dtsi
>     arch/arm/boot/dts/axp209.dtsi
>     arch/arm/boot/dts/axp22x.dtsi
>     drivers/extcon/extcon-axp288.c
>     drivers/iio/adc/axp288_adc.c
>     drivers/input/misc/axp20x-pek.c
>     drivers/mfd/axp20x.c
>     drivers/power/axp20x_usb_power.c
>     drivers/power/axp288_charger.c
>     drivers/power/axp288_fuel_gauge.c
>     drivers/regulator/axp20x-regulator.c
>     include/linux/mfd/axp20x.h
>
> Are all these files appropriate?
>

Yes.

ChenYu

[toc] | [prev] | [next] | [standalone]


#1323953 — [PATCH 04/11] regulator: axp20x: Remove voltage readout support for switch regulators

FromChen-Yu Tsai <wens@csie.org>
Date2016-02-02 11:30 +0100
Subject[PATCH 04/11] regulator: axp20x: Remove voltage readout support for switch regulators
Message-ID<qXGnF-1ad-43@gated-at.bofh.it>
In reply to#1323945
Switch-type regulators, such as DC1SW on AXP22X, are a secondary output
from DCDC1. They are just an on/off switch, and the driver should not
try to read its voltage directly from the DCDC1 control registers.

Instead, the core will pass down the voltage from the regulator supply
chain.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/regulator/axp20x-regulator.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index e86d1fc2d80b..f31d238e85e8 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -78,8 +78,7 @@
 		.ops		= &axp20x_ops,					\
 	}
 
-#define AXP_DESC_SW(_family, _id, _match, _supply, _min, _max, _step, _vreg,	\
-		    _vmask, _ereg, _emask) 					\
+#define AXP_DESC_SW(_family, _id, _match, _supply, _ereg, _emask)		\
 	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
@@ -87,12 +86,7 @@
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
 		.id		= _family##_##_id,				\
-		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
 		.owner		= THIS_MODULE,					\
-		.min_uV		= (_min) * 1000,				\
-		.uV_step	= (_step) * 1000,				\
-		.vsel_reg	= (_vreg),					\
-		.vsel_mask	= (_vmask),					\
 		.enable_reg	= (_ereg),					\
 		.enable_mask	= (_emask),					\
 		.ops		= &axp20x_ops_sw,				\
@@ -160,8 +154,6 @@ static struct regulator_ops axp20x_ops = {
 };
 
 static struct regulator_ops axp20x_ops_sw = {
-	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
-	.list_voltage		= regulator_list_voltage_linear,
 	.enable			= regulator_enable_regmap,
 	.disable		= regulator_disable_regmap,
 	.is_enabled		= regulator_is_enabled_regmap,
@@ -196,8 +188,8 @@ static const struct regulator_desc axp22x_regulators[] = {
 	AXP_DESC(AXP22X, DCDC5, "dcdc5", "vin5", 1000, 2550, 50,
 		 AXP22X_DCDC5_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(5)),
 	/* secondary switchable output of DCDC1 */
-	AXP_DESC_SW(AXP22X, DC1SW, "dc1sw", NULL, 1600, 3400, 100,
-		    AXP22X_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(7)),
+	AXP_DESC_SW(AXP22X, DC1SW, "dc1sw", NULL, AXP22X_PWR_OUT_CTRL2,
+		    BIT(7)),
 	/* LDO regulator internally chained to DCDC5 */
 	AXP_DESC(AXP22X, DC5LDO, "dc5ldo", NULL, 700, 1400, 100,
 		 AXP22X_DC5LDO_V_OUT, 0x7, AXP22X_PWR_OUT_CTRL1, BIT(0)),
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1325788 — Applied "regulator: axp20x: Remove voltage readout support for switch regulators" to the regulator tree

FromMark Brown <broonie@kernel.org>
Date2016-02-03 19:20 +0100
SubjectApplied "regulator: axp20x: Remove voltage readout support for switch regulators" to the regulator tree
Message-ID<qYac2-5uj-19@gated-at.bofh.it>
In reply to#1323953
The patch

   regulator: axp20x: Remove voltage readout support for switch regulators

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 94c39041ae0c0e83d10bc1a56974a2eefd9386c8 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <wens@csie.org>
Date: Tue, 2 Feb 2016 18:27:37 +0800
Subject: [PATCH] regulator: axp20x: Remove voltage readout support for switch
 regulators

Switch-type regulators, such as DC1SW on AXP22X, are a secondary output
from DCDC1. They are just an on/off switch, and the driver should not
try to read its voltage directly from the DCDC1 control registers.

Instead, the core will pass down the voltage from the regulator supply
chain.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/regulator/axp20x-regulator.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index f2e1a39ce0f3..fafaaa8eb8b3 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -78,8 +78,7 @@
 		.ops		= &axp20x_ops,					\
 	}
 
-#define AXP_DESC_SW(_family, _id, _match, _supply, _min, _max, _step, _vreg,	\
-		    _vmask, _ereg, _emask) 					\
+#define AXP_DESC_SW(_family, _id, _match, _supply, _ereg, _emask)		\
 	[_family##_##_id] = {							\
 		.name		= #_id,						\
 		.supply_name	= (_supply),					\
@@ -87,12 +86,7 @@
 		.regulators_node = of_match_ptr("regulators"),			\
 		.type		= REGULATOR_VOLTAGE,				\
 		.id		= _family##_##_id,				\
-		.n_voltages	= (((_max) - (_min)) / (_step) + 1),		\
 		.owner		= THIS_MODULE,					\
-		.min_uV		= (_min) * 1000,				\
-		.uV_step	= (_step) * 1000,				\
-		.vsel_reg	= (_vreg),					\
-		.vsel_mask	= (_vmask),					\
 		.enable_reg	= (_ereg),					\
 		.enable_mask	= (_emask),					\
 		.ops		= &axp20x_ops_sw,				\
@@ -160,8 +154,6 @@ static struct regulator_ops axp20x_ops = {
 };
 
 static struct regulator_ops axp20x_ops_sw = {
-	.get_voltage_sel	= regulator_get_voltage_sel_regmap,
-	.list_voltage		= regulator_list_voltage_linear,
 	.enable			= regulator_enable_regmap,
 	.disable		= regulator_disable_regmap,
 	.is_enabled		= regulator_is_enabled_regmap,
@@ -196,8 +188,8 @@ static const struct regulator_desc axp22x_regulators[] = {
 	AXP_DESC(AXP22X, DCDC5, "dcdc5", "vin5", 1000, 2550, 50,
 		 AXP22X_DCDC5_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(5)),
 	/* secondary switchable output of DCDC1 */
-	AXP_DESC_SW(AXP22X, DC1SW, "dc1sw", NULL, 1600, 3400, 100,
-		    AXP22X_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(7)),
+	AXP_DESC_SW(AXP22X, DC1SW, "dc1sw", NULL, AXP22X_PWR_OUT_CTRL2,
+		    BIT(7)),
 	/* LDO regulator internally chained to DCDC5 */
 	AXP_DESC(AXP22X, DC5LDO, "dc5ldo", NULL, 700, 1400, 100,
 		 AXP22X_DC5LDO_V_OUT, 0x7, AXP22X_PWR_OUT_CTRL1, BIT(0)),
-- 
2.7.0.rc3

[toc] | [prev] | [next] | [standalone]


#1323955 — [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC

FromChen-Yu Tsai <wens@csie.org>
Date2016-02-02 11:40 +0100
Subject[PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC
Message-ID<qXGxj-1h1-1@gated-at.bofh.it>
In reply to#1323945
The AXP809 PMIC is used with the Allwinner A80 SoC, along with
an AXP806 PMIC as a slave.

This patch adds a dtsi file for all the common bindings and default
values unrelated to board design. Currently this is just listing all
the regulator nodes. The regulators are initialized based on their
device node names.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 arch/arm/boot/dts/axp809.dtsi | 138 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 138 insertions(+)
 create mode 100644 arch/arm/boot/dts/axp809.dtsi

diff --git a/arch/arm/boot/dts/axp809.dtsi b/arch/arm/boot/dts/axp809.dtsi
new file mode 100644
index 000000000000..17769923f9c3
--- /dev/null
+++ b/arch/arm/boot/dts/axp809.dtsi
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2015 Chen-Yu Tsai
+ *
+ * Chen-Yu Tsai <wens@csie.org>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file is free software; you can redistribute it and/or
+ *     modify it under the terms of the GNU General Public License as
+ *     published by the Free Software Foundation; either version 2 of the
+ *     License, or (at your option) any later version.
+ *
+ *     This file is distributed in the hope that it will be useful,
+ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *     GNU General Public License for more details.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * AXP809 Integrated Power Management Chip
+ */
+
+&axp809 {
+	compatible = "x-powers,axp809";
+	interrupt-controller;
+	#interrupt-cells = <1>;
+
+	regulators {
+		/* Default work frequency for buck regulators */
+		x-powers,dcdc-freq = <3000>;
+
+		reg_dcdc1: dcdc1 {
+			regulator-name = "dcdc1";
+		};
+
+		reg_dcdc2: dcdc2 {
+			regulator-name = "dcdc2";
+		};
+
+		reg_dcdc3: dcdc3 {
+			regulator-name = "dcdc3";
+		};
+
+		reg_dcdc4: dcdc4 {
+			regulator-name = "dcdc4";
+		};
+
+		reg_dcdc5: dcdc5 {
+			regulator-name = "dcdc5";
+		};
+
+		reg_dc1sw: dc1sw {
+			regulator-name = "dc1sw";
+		};
+
+		reg_dc5ldo: dc5ldo {
+			regulator-name = "dc5ldo";
+		};
+
+		reg_aldo1: aldo1 {
+			regulator-name = "aldo1";
+		};
+
+		reg_aldo2: aldo2 {
+			regulator-name = "aldo2";
+		};
+
+		reg_aldo3: aldo3 {
+			regulator-name = "aldo3";
+		};
+
+		reg_dldo1: dldo1 {
+			regulator-name = "dldo1";
+		};
+
+		reg_dldo2: dldo2 {
+			regulator-name = "dldo2";
+		};
+
+		reg_eldo1: eldo1 {
+			regulator-name = "eldo1";
+		};
+
+		reg_eldo2: eldo2 {
+			regulator-name = "eldo2";
+		};
+
+		reg_eldo3: eldo3 {
+			regulator-name = "eldo3";
+		};
+
+		reg_ldo_io0: ldo_io0 {
+			regulator-name = "ldo_io0";
+		};
+
+		reg_ldo_io1: ldo_io1 {
+			regulator-name = "ldo_io1";
+		};
+
+		reg_rtc_ldo: rtc_ldo {
+			/* RTC_LDO is a fixed, always-on regulator */
+			regulator-always-on;
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-name = "rtc_ldo";
+		};
+
+		reg_sw: sw {
+			regulator-name = "sw";
+		};
+	};
+};
-- 
2.7.0

[toc] | [prev] | [next] | [standalone]


#1324025 — Re: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC

FromMark Brown <broonie@kernel.org>
Date2016-02-02 13:20 +0100
SubjectRe: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC
Message-ID<qXI66-2I0-7@gated-at.bofh.it>
In reply to#1323955

[Multipart message — attachments visible in raw view] — view raw

On Tue, Feb 02, 2016 at 06:27:40PM +0800, Chen-Yu Tsai wrote:

> +		reg_dcdc1: dcdc1 {
> +			regulator-name = "dcdc1";
> +		};

Why is this generic DTS include specifying regulator names?

> +		reg_rtc_ldo: rtc_ldo {
> +			/* RTC_LDO is a fixed, always-on regulator */
> +			regulator-always-on;
> +			regulator-min-microvolt = <1800000>;
> +			regulator-max-microvolt = <1800000>;

If the regulator itself is limited in this way there is no need to
specify this in the DTS.

[toc] | [prev] | [next] | [standalone]


#1328294 — Re: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC

FromChen-Yu Tsai <wens@csie.org>
Date2016-02-06 13:50 +0100
SubjectRe: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC
Message-ID<qZatj-7lm-9@gated-at.bofh.it>
In reply to#1324025
On Tue, Feb 2, 2016 at 8:17 PM, Mark Brown <broonie@kernel.org> wrote:
> On Tue, Feb 02, 2016 at 06:27:40PM +0800, Chen-Yu Tsai wrote:
>
>> +             reg_dcdc1: dcdc1 {
>> +                     regulator-name = "dcdc1";
>> +             };
>
> Why is this generic DTS include specifying regulator names?

My intent is to provide better looking names by default.
I just realized I could do this in the driver by replacing
a few fields.

But I still might need to do this for the AXP806, which
is a slave PMIC also used with A80 SoCs. The names overlap
with the AXP809. Allwinner gets around this by adding a
"s_" prefix to them. I suppose that works too.

Mark, may I assume you are OK with this DTS include listing
the regulators, even if their sections are empty?

>
>> +             reg_rtc_ldo: rtc_ldo {
>> +                     /* RTC_LDO is a fixed, always-on regulator */
>> +                     regulator-always-on;
>> +                     regulator-min-microvolt = <1800000>;
>> +                     regulator-max-microvolt = <1800000>;
>
> If the regulator itself is limited in this way there is no need to
> specify this in the DTS.

Will remove.

Thanks
ChenYu

[toc] | [prev] | [next] | [standalone]


#1329141 — Re: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC

FromMark Brown <broonie@kernel.org>
Date2016-02-08 16:00 +0100
SubjectRe: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC
Message-ID<qZVse-6HZ-17@gated-at.bofh.it>
In reply to#1328294

[Multipart message — attachments visible in raw view] — view raw

On Sat, Feb 06, 2016 at 08:42:24PM +0800, Chen-Yu Tsai wrote:

> Mark, may I assume you are OK with this DTS include listing
> the regulators, even if their sections are empty?

If it has no content why have it?

[toc] | [prev] | [next] | [standalone]


#1329145 — Re: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC

FromChen-Yu Tsai <wens@csie.org>
Date2016-02-08 16:00 +0100
SubjectRe: [PATCH 07/11] ARM: dts: sunxi: Add dtsi file for AXP809 PMIC
Message-ID<qZVse-6HZ-25@gated-at.bofh.it>
In reply to#1329141
On Mon, Feb 8, 2016 at 10:53 PM, Mark Brown <broonie@kernel.org> wrote:
> On Sat, Feb 06, 2016 at 08:42:24PM +0800, Chen-Yu Tsai wrote:
>
>> Mark, may I assume you are OK with this DTS include listing
>> the regulators, even if their sections are empty?
>
> If it has no content why have it?

I'd like the regulator core to disable any unused ones. The core
considers regulators that don't have nodes as not having constraints,
and won't touch them.

Any other ways to do this? Or am I going about this the wrong way?

Thanks
ChenYu

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | linux.kernel


csiph-web