regulator: axp20x: support AXP803/AXP813 variants
Subsystems (4)
PATCH v3 1/4 regulator: axp20x: move device independant parts to new files
In reply to Jean-Francois MoineThe axp20x driver contains device specific and device independant parts. This patch moves the independant parts to new .c/.h files.
--- drivers/regulator/Makefile | 2 +- drivers/regulator/axp-regulator.c | 308 ++++++++++++++++++++++++++ drivers/regulator/axp-regulator.h | 127 +++++++++++ drivers/regulator/axp20x-regulator.c | 415 +++-------------------------------- 4 files changed, 464 insertions(+), 388 deletions(-) create mode 100644 drivers/regulator/axp-regulator.c create mode 100644 drivers/regulator/axp-regulator.h
drivers/regulator/Makefile +1 -1
@@ -21,7 +21,7 @@ obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o obj-$(CONFIG_REGULATOR_ARIZONA) += arizona-micsupp.o arizona-ldo1.o obj-$(CONFIG_REGULATOR_AS3711) += as3711-regulator.o obj-$(CONFIG_REGULATOR_AS3722) += as3722-regulator.o -obj-$(CONFIG_REGULATOR_AXP20X) += axp20x-regulator.o +obj-$(CONFIG_REGULATOR_AXP20X) += axp20x-regulator.o axp-regulator.o obj-$(CONFIG_REGULATOR_BCM590XX) += bcm590xx-regulator.o obj-$(CONFIG_REGULATOR_DA903X) += da903x.o obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o
drivers/regulator/axp-regulator.c new file +308 -0
308 lines not on this page · raw message
drivers/regulator/axp-regulator.h new file +127 -0
127 lines not on this page · raw message
drivers/regulator/axp20x-regulator.c +28 -387
464 lines not on this page · raw message
Signature · 1 line
2.10.0
PATCH v3 2/4 regulator: axp20x: duplicate the MFD axp20x-rsb code
In reply to Jean-Francois MoineThe axp20x rsb driver handles many different devices. Duplicating its code in a generic regulator driver permits to probe/remove individual devices.
--- drivers/regulator/axp-regulator.c | 39 +++++++++++++++++++++++++++++++++++++++ drivers/regulator/axp-regulator.h | 6 ++++++ 2 files changed, 45 insertions(+)
drivers/regulator/axp-regulator.c +39 -0
@@ -303,6 +303,45 @@ int axp_regulator_create(struct device *dev, }EXPORT_SYMBOL_GPL (axp_regulator_create); +/* probe/remove RSB devices */ +int axp_rsb_probe (struct sunxi_rsb_device *rdev, +struct axp20x_dev *axp20x, +const struct axp_cfg *axp_cfg) +{ +int ret; + + axp20x->dev = &rdev->dev; + axp20x->irq = rdev->irq; +dev_set_drvdata (&rdev->dev, axp20x); + + ret =axp20x_match_device (axp20x); +if (ret) +return ret; + + axp20x->regmap =devm_regmap_init_sunxi_rsb (rdev, + axp20x->regmap_cfg); +if (IS_ERR (axp20x->regmap)) { + ret =PTR_ERR (axp20x->regmap); +dev_err (&rdev->dev,"regmap init failed: %d\n" , ret); +return ret; + } + + ret =axp20x_device_probe (axp20x); +if (ret <0 ) +return ret; + +return axp_regulator_create (&rdev->dev, axp_cfg); +} +EXPORT_SYMBOL_GPL (axp_rsb_probe); + +int axp_rsb_remove (struct sunxi_rsb_device *rdev) +{ +struct axp20x_dev *axp20x =sunxi_rsb_device_get_drvdata (rdev); + +return axp20x_device_remove (axp20x); +} +EXPORT_SYMBOL_GPL (axp_rsb_remove); +MODULE_AUTHOR ("Carlo Caione <[email protected]>" );MODULE_DESCRIPTION ("Regulator Module for AXP PMIC" );MODULE_LICENSE ("GPL v2" );
drivers/regulator/axp-regulator.h +6 -0
@@ -124,4 +124,10 @@ struct axp_cfg {int axp_regulator_create (struct device *dev,const struct axp_cfg *axp_cfg); +struct sunxi_rsb_device ; +int axp_rsb_probe (struct sunxi_rsb_device *rdev, +struct axp20x_dev *axp20x, +const struct axp_cfg *axp_cfg); +int axp_rsb_remove (struct sunxi_rsb_device *rdev); +#endif /* __AXP_REGULATOR_H__ */
Signature · 1 line
2.10.0
PATCH v3 3/4 regulator: axp20x: add the AXP803
In reply to Jean-Francois MoineThe X-Powers AXP803 PMIC is close to the AXP809 with more outputs. It is used in some Allwinner boards as the Sinovoip BananaPi M64 and the Pine A64.
---
not tested
--- Documentation/devicetree/bindings/mfd/axp20x.txt | 32 +++- drivers/mfd/axp20x.c | 13 ++ drivers/regulator/Makefile | 3 +- drivers/regulator/axp803.c | 225 +++++++++++++++++++++++ include/linux/mfd/axp20x.h | 1 + 5 files changed, 271 insertions(+), 3 deletions(-) create mode 100644 drivers/regulator/axp803.c
Documentation/devicetree/bindings/mfd/axp20x.txt +30 -2
@@ -6,12 +6,13 @@ axp202 (X-Powers) axp209 (X-Powers) axp221 (X-Powers) axp223 (X-Powers) +axp803 (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,axp806", - "x-powers,axp809" + "x-powers,axp221", "x-powers,axp223", "x-powers,axp803", + "x-powers,axp806", "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
@@ -86,6 +87,33 @@ LDO_IO1 : LDO : ips-supply : GPIO 1 RTC_LDO : LDO : ips-supply : always on DRIVEVBUS : Enable output : drivevbus-supply : external regulator +AXP803 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 +DCDC6 : DC-DC buck : vin6-supply +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 +DLDO3 : LDO : dldoin-supply : shared supply +DLDO4 : LDO : dldoin-supply : shared supply +ELDO1 : LDO : eldoin-supply : shared supply +ELDO2 : LDO : eldoin-supply : shared supply +ELDO3 : LDO : eldoin-supply : shared supply +FLDO1 : LDO : fldoin-supply : shared supply +FLDO2 : LDO : fldoin-supply : shared supply +RTC_LDO : LDO : ips-supply : always on +LDO_IO0 : LDO : ips-supply : GPIO 0 +LDO_IO1 : LDO : ips-supply : GPIO 1 +DC1SW : On/Off Switch : : DCDC1 secondary output + AXP806 regulators, type, and corresponding input supply names: Regulator Type Supply Name Notes
drivers/mfd/axp20x.c +13 -0
@@ -38,6 +38,7 @@ static const char * const axp20x_model_names[] = {"AXP221" ,"AXP223" ,"AXP288" , +"AXP803" ,"AXP806" , "AXP809", };
@@ -739,6 +740,14 @@ static struct mfd_cell axp809_cells[] = { }, }; +static struct mfd_cell axp803_cells[] = { + { + .name ="axp20x-pek" , + .num_resources =ARRAY_SIZE (axp809_pek_resources), + .resources = axp809_pek_resources, + }, +}; +static struct axp20x_dev *axp20x_pm_power_off;static void axp20x_power_off (void ) {
@@ -801,6 +810,10 @@ int axp20x_match_device(struct axp20x_dev *axp20x) axp20x->regmap_cfg = &axp288_regmap_config; axp20x->regmap_irq_chip = &axp288_regmap_irq_chip;break ; +case AXP803_ID : + axp20x->cells = axp803_cells; + axp20x->nr_cells =ARRAY_SIZE (axp803_cells); +break ;case AXP806_ID : axp20x->nr_cells =ARRAY_SIZE (axp806_cells); axp20x->cells = axp806_cells;
drivers/regulator/Makefile +2 -1
@@ -21,7 +21,8 @@ obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o obj-$(CONFIG_REGULATOR_ARIZONA) += arizona-micsupp.o arizona-ldo1.o obj-$(CONFIG_REGULATOR_AS3711) += as3711-regulator.o obj-$(CONFIG_REGULATOR_AS3722) += as3722-regulator.o -obj-$(CONFIG_REGULATOR_AXP20X) += axp20x-regulator.o axp-regulator.o +obj-$(CONFIG_REGULATOR_AXP20X) += axp20x-regulator.o axp-regulator.o \ + axp803.o obj-$(CONFIG_REGULATOR_BCM590XX) += bcm590xx-regulator.o obj-$(CONFIG_REGULATOR_DA903X) += da903x.o obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o
drivers/regulator/axp803.c new file +225 -0
225 lines not on this page · raw message
include/linux/mfd/axp20x.h +1 -0
@@ -20,6 +20,7 @@ enum {AXP221_ID ,AXP223_ID ,AXP288_ID , +AXP803_ID ,AXP806_ID ,AXP809_ID , NR_AXP20X_VARIANTS,
Signature · 1 line
2.10.0
PATCH v3 4/4 regulator: axp20x: add the AXP813
In reply to Jean-Francois MoineThe X-Powers AXP813 PMIC is close to the AXP803.
It is used in some Allwinner boards as the Sinovoip BananaPi M3+.
--- Documentation/devicetree/bindings/mfd/axp20x.txt | 9 +- drivers/mfd/axp20x.c | 2 + drivers/regulator/Makefile | 2 +- drivers/regulator/axp813.c | 229 +++++++++++++++++++++++ include/linux/mfd/axp20x.h | 1 + 5 files changed, 239 insertions(+), 4 deletions(-) create mode 100644 drivers/regulator/axp813.c
Documentation/devicetree/bindings/mfd/axp20x.txt +6 -3
@@ -8,11 +8,12 @@ axp221 (X-Powers) axp223 (X-Powers) axp803 (X-Powers) axp809 (X-Powers) +axp813 (X-Powers) Required properties: - compatible: "x-powers,axp152", "x-powers,axp202", "x-powers,axp209", "x-powers,axp221", "x-powers,axp223", "x-powers,axp803", - "x-powers,axp806", "x-powers,axp809" + "x-powers,axp806", "x-powers,axp809", "x-powers,axp813" - 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
@@ -87,7 +88,7 @@ LDO_IO1 : LDO : ips-supply : GPIO 1 RTC_LDO : LDO : ips-supply : always on DRIVEVBUS : Enable output : drivevbus-supply : external regulator -AXP803 regulators, type, and corresponding input supply names: +AXP803/AXP813 regulators, type, and corresponding input supply names: Regulator Type Supply Name Notes --------- ---- ----------- -----
@@ -97,6 +98,7 @@ DCDC3 : DC-DC buck : vin3-supply DCDC4 : DC-DC buck : vin4-supply DCDC5 : DC-DC buck : vin5-supply DCDC6 : DC-DC buck : vin6-supply +DCDC7 : DC-DC buck : vin7-supply : (813 only) ALDO1 : LDO : aldoin-supply : shared supply ALDO2 : LDO : aldoin-supply : shared supply ALDO3 : LDO : aldoin-supply : shared supply
@@ -109,10 +111,11 @@ ELDO2 : LDO : eldoin-supply : shared supply ELDO3 : LDO : eldoin-supply : shared supply FLDO1 : LDO : fldoin-supply : shared supply FLDO2 : LDO : fldoin-supply : shared supply +FLDO3 : LDO : fldoin-supply : shared supply (813 only) RTC_LDO : LDO : ips-supply : always on LDO_IO0 : LDO : ips-supply : GPIO 0 LDO_IO1 : LDO : ips-supply : GPIO 1 -DC1SW : On/Off Switch : : DCDC1 secondary output +DC1SW : On/Off Switch : : DCDC1 secondary output (803 only) AXP806 regulators, type, and corresponding input supply names:
drivers/mfd/axp20x.c +2 -0
@@ -41,6 +41,7 @@ static const char * const axp20x_model_names[] = {"AXP803" ,"AXP806" ,"AXP809" , + "AXP813", }; static const struct regmap_range axp152_writeable_ranges[] = {
@@ -811,6 +812,7 @@ int axp20x_match_device(struct axp20x_dev *axp20x) axp20x->regmap_irq_chip = &axp288_regmap_irq_chip;break ;case AXP803_ID : +case AXP813_ID : axp20x->cells = axp803_cells; axp20x->nr_cells =ARRAY_SIZE (axp803_cells);break ;
drivers/regulator/Makefile +1 -1
@@ -22,7 +22,7 @@ obj-$(CONFIG_REGULATOR_ARIZONA) += arizona-micsupp.o arizona-ldo1.o obj-$(CONFIG_REGULATOR_AS3711) += as3711-regulator.o obj-$(CONFIG_REGULATOR_AS3722) += as3722-regulator.o obj-$(CONFIG_REGULATOR_AXP20X) += axp20x-regulator.o axp-regulator.o \ - axp803.o + axp803.o axp813.o obj-$(CONFIG_REGULATOR_BCM590XX) += bcm590xx-regulator.o obj-$(CONFIG_REGULATOR_DA903X) += da903x.o obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o
drivers/regulator/axp813.c new file +229 -0
229 lines not on this page · raw message
include/linux/mfd/axp20x.h +1 -0
@@ -23,6 +23,7 @@ enum {AXP803_ID ,AXP806_ID ,AXP809_ID , +AXP813_ID , NR_AXP20X_VARIANTS, };
Signature · 1 line
2.10.0
v3 cover regulator: axp20x: support AXP803/AXP813 variants
This patch series adds support for the X-Powers AXP803 and AXP813 PMICs. It is based on the previous patch series
regulator: axp20x: Simplify various code
v3:
- put the code of the new devices in new files instead of in the common axp20x file.
- fix errors about the regulators and interrupts
v2:
- fix lack of support of dcdc frequency
- notice that the AXP803 is also handled
- send the patch to the DT maintainers
Jean-Francois Moine (4):
regulator: axp20x: move device independant parts to new files
regulator: axp20x: duplicate the MFD axp20x-rsb code
regulator: axp20x: add the AXP803
regulator: axp20x: add the AXP813
Documentation/devicetree/bindings/mfd/axp20x.txt | 29 ++- drivers/mfd/axp20x.c | 15 + drivers/regulator/Makefile | 3 +- drivers/regulator/axp-regulator.c | 347 +++++++++++++++++++ drivers/regulator/axp-regulator.h | 133 ++++++++ drivers/regulator/axp20x-regulator.c | 415 ++--------------------- drivers/regulator/axp803.c | 225 ++++++++++++ drivers/regulator/axp813.c | 229 +++++++++++++ include/linux/mfd/axp20x.h | 2 + 9 files changed, 1012 insertions(+), 388 deletions(-) create mode 100644 drivers/regulator/axp-regulator.c create mode 100644 drivers/regulator/axp-regulator.h create mode 100644 drivers/regulator/axp803.c create mode 100644 drivers/regulator/axp813.c
Signature · 1 line
2.10.0
Re: [PATCH v3 3/4] regulator: axp20x: add the AXP803
In reply to Jean-Francois MoineQuoted 23 lines · Jean-Francois Moine
The X-Powers AXP803 PMIC is close to the AXP809 with more outputs. It is used in some Allwinner boards as the Sinovoip BananaPi M64 and the Pine A64.
Signed-off-by Jean-Francois Moine <[email protected]>---
not tested--- Documentation/devicetree/bindings/mfd/axp20x.txt | 32 +++- drivers/mfd/axp20x.c | 13 ++ drivers/regulator/Makefile | 3 +- drivers/regulator/axp803.c | 225 +++++++++++++++++++++++ include/linux/mfd/axp20x.h | 1 + 5 files changed, 271 insertions(+), 3 deletions(-) create mode 100644 drivers/regulator/axp803.cDocumentation/devicetree/bindings/mfd/axp20x.txt +0
-0@@ -6,12 +6,13 @@ axp202 (X-Powers) axp209 (X-Powers) axp221 (X-Powers)
Documentation/devicetree/bindings/mfd/axp20x.txt axp202 (X-Powers) · line 15
Quoted 10 lines
Documentation/devicetree/bindings/mfd/axp20x.txt +3
-2axp223 (X-Powers) +axp803 (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,axp806", - "x-powers,axp809" + "x-powers,axp221", "x-powers,axp223", "x-powers,axp803", + "x-powers,axp806", "x-powers,axp809"
If you respin this, please reformat this to one per line.
Quoted 37 lines
Documentation/devicetree/bindings/mfd/axp20x.txt +27
-0- 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@@ -86,6 +87,33 @@ LDO_IO1 : LDO : ips-supply : GPIO 1 RTC_LDO : LDO : ips-supply : always on DRIVEVBUS : Enable output : drivevbus-supply : external regulator +AXP803 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 +DCDC6 : DC-DC buck : vin6-supply +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 +DLDO3 : LDO : dldoin-supply : shared supply +DLDO4 : LDO : dldoin-supply : shared supply +ELDO1 : LDO : eldoin-supply : shared supply +ELDO2 : LDO : eldoin-supply : shared supply +ELDO3 : LDO : eldoin-supply : shared supply +FLDO1 : LDO : fldoin-supply : shared supply +FLDO2 : LDO : fldoin-supply : shared supply +RTC_LDO : LDO : ips-supply : always on +LDO_IO0 : LDO : ips-supply : GPIO 0 +LDO_IO1 : LDO : ips-supply : GPIO 1 +DC1SW : On/Off Switch : : DCDC1 secondary output + AXP806 regulators, type, and corresponding input supply names: Regulator Type Supply Name Notes
Re: [PATCH v3 4/4] regulator: axp20x: add the AXP813
In reply to Jean-Francois MoineQuoted 18 lines · Jean-Francois Moine
The X-Powers AXP813 PMIC is close to the AXP803.
It is used in some Allwinner boards as the Sinovoip BananaPi M3+.Signed-off-by Jean-Francois Moine <[email protected]>--- Documentation/devicetree/bindings/mfd/axp20x.txt | 9 +- drivers/mfd/axp20x.c | 2 + drivers/regulator/Makefile | 2 +- drivers/regulator/axp813.c | 229 +++++++++++++++++++++++ include/linux/mfd/axp20x.h | 1 + 5 files changed, 239 insertions(+), 4 deletions(-) create mode 100644 drivers/regulator/axp813.cDocumentation/devicetree/bindings/mfd/axp20x.txt +0
-0
Documentation/devicetree/bindings/mfd/axp20x.txt axp221 (X-Powers) · line 16
Quoted 10 lines
Documentation/devicetree/bindings/mfd/axp20x.txt +2
-1@@ -8,11 +8,12 @@ axp221 (X-Powers) axp223 (X-Powers) axp803 (X-Powers) axp809 (X-Powers) +axp813 (X-Powers) Required properties: - compatible: "x-powers,axp152", "x-powers,axp202", "x-powers,axp209", "x-powers,axp221", "x-powers,axp223", "x-powers,axp803", - "x-powers,axp806", "x-powers,axp809" + "x-powers,axp806", "x-powers,axp809", "x-powers,axp813"
Same comment here.
Quoted 13 lines · Jean-Francois Moine
This patch series adds support for the X-Powers AXP803 and AXP813 PMICs. It is based on the previous patch series
regulator: axp20x: Simplify various codev3:
- put the code of the new devices in new files instead of in the common axp20x file.
- fix errors about the regulators and interrupts
v2:
- fix lack of support of dcdc frequency
- notice that the AXP803 is also handled
- send the patch to the DT maintainers
Quoted 5 lines
Jean-Francois Moine (4):
regulator: axp20x: move device independant parts to new files
regulator: axp20x: duplicate the MFD axp20x-rsb code
regulator: axp20x: add the AXP803
regulator: axp20x: add the AXP813
NAK. Please follow the axp20x mfd and sub-device driver design we already have.
ChenYu
Quoted 18 lines
Documentation/devicetree/bindings/mfd/axp20x.txt | 29 ++- drivers/mfd/axp20x.c | 15 + drivers/regulator/Makefile | 3 +- drivers/regulator/axp-regulator.c | 347 +++++++++++++++++++ drivers/regulator/axp-regulator.h | 133 ++++++++ drivers/regulator/axp20x-regulator.c | 415 ++--------------------- drivers/regulator/axp803.c | 225 ++++++++++++ drivers/regulator/axp813.c | 229 +++++++++++++ include/linux/mfd/axp20x.h | 2 + 9 files changed, 1012 insertions(+), 388 deletions(-) create mode 100644 drivers/regulator/axp-regulator.c create mode 100644 drivers/regulator/axp-regulator.h create mode 100644 drivers/regulator/axp803.c create mode 100644 drivers/regulator/axp813.c--
2.10.0
Quoted 14 lines · On Sat, 24 Sep 2016 16:35:05 +0800 Chen-Yu Tsai <[email protected]> wrote:
Quoted 13 lines · Jean-Francois Moine
This patch series adds support for the X-Powers AXP803 and AXP813 PMICs. It is based on the previous patch series
regulator: axp20x: Simplify various codev3:
- put the code of the new devices in new files instead of in the common axp20x file.
- fix errors about the regulators and interrupts
v2:
- fix lack of support of dcdc frequency
- notice that the AXP803 is also handled
- send the patch to the DT maintainers
Quoted 8 lines
Quoted 5 lines
Jean-Francois Moine (4):
regulator: axp20x: move device independant parts to new files
regulator: axp20x: duplicate the MFD axp20x-rsb code
regulator: axp20x: add the AXP803
regulator: axp20x: add the AXP813NAK. Please follow the axp20x mfd and sub-device driver design we already have.
Sorry, I will not: installing a lot of useless code and tables in permanent system memory for just one regulator is not the way I think about a good kernel.
Signature · 2 lines
Ken ar c'henta? | ** Breizh ha Linux atav! ** Jef | http://moinejf.free.fr/