diff mbox

[v5,8/8] ARM: sun7i/sun4i: dt: Add AXP209 support to various boards

Message ID 1398947374-3115-9-git-send-email-carlo@caione.org (mailing list archive)
State New, archived
Headers show

Commit Message

Carlo Caione May 1, 2014, 12:29 p.m. UTC
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Carlo Caione <carlo@caione.org>
---
 arch/arm/boot/dts/sun4i-a10-a1000.dts           | 58 ++++++++++++++++++++++
 arch/arm/boot/dts/sun4i-a10-cubieboard.dts      | 58 ++++++++++++++++++++++
 arch/arm/boot/dts/sun4i-a10-hackberry.dts       | 64 ++++++++++++++++++++++++
 arch/arm/boot/dts/sun4i-a10-inet97fv2.dts       | 58 ++++++++++++++++++++++
 arch/arm/boot/dts/sun4i-a10-mini-xplus.dts      | 65 +++++++++++++++++++++++++
 arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts  | 64 ++++++++++++++++++++++++
 arch/arm/boot/dts/sun4i-a10-pcduino.dts         | 58 ++++++++++++++++++++++
 arch/arm/boot/dts/sun7i-a20-cubieboard2.dts     | 59 ++++++++++++++++++++++
 arch/arm/boot/dts/sun7i-a20-cubietruck.dts      | 59 ++++++++++++++++++++++
 arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 59 ++++++++++++++++++++++
 10 files changed, 602 insertions(+)

Comments

Maxime Ripard May 3, 2014, 1:09 a.m. UTC | #1
Hi,

On Thu, May 01, 2014 at 02:29:34PM +0200, Carlo Caione wrote:
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> Signed-off-by: Carlo Caione <carlo@caione.org>
> ---
>  arch/arm/boot/dts/sun4i-a10-a1000.dts           | 58 ++++++++++++++++++++++
>  arch/arm/boot/dts/sun4i-a10-cubieboard.dts      | 58 ++++++++++++++++++++++
>  arch/arm/boot/dts/sun4i-a10-hackberry.dts       | 64 ++++++++++++++++++++++++
>  arch/arm/boot/dts/sun4i-a10-inet97fv2.dts       | 58 ++++++++++++++++++++++
>  arch/arm/boot/dts/sun4i-a10-mini-xplus.dts      | 65 +++++++++++++++++++++++++
>  arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts  | 64 ++++++++++++++++++++++++
>  arch/arm/boot/dts/sun4i-a10-pcduino.dts         | 58 ++++++++++++++++++++++
>  arch/arm/boot/dts/sun7i-a20-cubieboard2.dts     | 59 ++++++++++++++++++++++
>  arch/arm/boot/dts/sun7i-a20-cubietruck.dts      | 59 ++++++++++++++++++++++
>  arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 59 ++++++++++++++++++++++
>  10 files changed, 602 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/sun4i-a10-a1000.dts b/arch/arm/boot/dts/sun4i-a10-a1000.dts
> index fa746aea..57d3fb4 100644
> --- a/arch/arm/boot/dts/sun4i-a10-a1000.dts
> +++ b/arch/arm/boot/dts/sun4i-a10-a1000.dts
> @@ -88,6 +88,56 @@
>  			pinctrl-names = "default";
>  			pinctrl-0 = <&i2c0_pins_a>;
>  			status = "okay";
> +
> +			axp209: pmic@34 {
> +				compatible = "x-powers,axp209";
> +				reg = <0x34>;
> +				interrupts = <0>;
> +
> +				interrupt-controller;
> +				#interrupt-cells = <1>;
> +
> +				acin-supply = <&reg_axp_ipsout>;
> +				vin2-supply = <&reg_axp_ipsout>;
> +				vin3-supply = <&reg_axp_ipsout>;
> +				ldo24in-supply = <&reg_axp_ipsout>;
> +				ldo3in-supply = <&reg_axp_ipsout>;
> +				ldo5in-supply = <&reg_axp_ipsout>;
> +
> +				regulators {
> +					x-powers,dcdc-freq = <1500>;
> +
> +					axp_vcore_reg: dcdc2 {
> +						regulator-min-microvolt = <700000>;
> +						regulator-max-microvolt = <2275000>;
> +						regulator-always-on;
> +					};
> +
> +					axp_ddr_reg: dcdc3 {
> +						regulator-always-on;
> +					};
> +
> +					axp_rtc_reg: ldo1 {
> +						regulator-always-on;
> +					};
> +
> +					axp_analog_reg: ldo2 {
> +						regulator-always-on;
> +					};
> +
> +					axp_pll_reg: ldo3 {
> +						regulator-always-on;
> +					};
> +
> +					axp_hdmi_reg: ldo4 {
> +						regulator-always-on;
> +					};
> +
> +					axp_mic_reg: ldo5 {
> +						regulator-always-on;

Do all these regulators need to be always on? It makes sense for the
pll and vcore, but I don't get why the mic and hdmi regulators need
this.

Maxime
Carlo Caione May 3, 2014, 12:21 p.m. UTC | #2
On Sat, May 3, 2014 at 3:09 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,
>
> On Thu, May 01, 2014 at 02:29:34PM +0200, Carlo Caione wrote:
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> Signed-off-by: Carlo Caione <carlo@caione.org>
>> ---
>>  arch/arm/boot/dts/sun4i-a10-a1000.dts           | 58 ++++++++++++++++++++++
>>  arch/arm/boot/dts/sun4i-a10-cubieboard.dts      | 58 ++++++++++++++++++++++
>>  arch/arm/boot/dts/sun4i-a10-hackberry.dts       | 64 ++++++++++++++++++++++++
>>  arch/arm/boot/dts/sun4i-a10-inet97fv2.dts       | 58 ++++++++++++++++++++++
>>  arch/arm/boot/dts/sun4i-a10-mini-xplus.dts      | 65 +++++++++++++++++++++++++
>>  arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts  | 64 ++++++++++++++++++++++++
>>  arch/arm/boot/dts/sun4i-a10-pcduino.dts         | 58 ++++++++++++++++++++++
>>  arch/arm/boot/dts/sun7i-a20-cubieboard2.dts     | 59 ++++++++++++++++++++++
>>  arch/arm/boot/dts/sun7i-a20-cubietruck.dts      | 59 ++++++++++++++++++++++
>>  arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 59 ++++++++++++++++++++++
>>  10 files changed, 602 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun4i-a10-a1000.dts b/arch/arm/boot/dts/sun4i-a10-a1000.dts
>> index fa746aea..57d3fb4 100644
>> --- a/arch/arm/boot/dts/sun4i-a10-a1000.dts
>> +++ b/arch/arm/boot/dts/sun4i-a10-a1000.dts
>> @@ -88,6 +88,56 @@
>>                       pinctrl-names = "default";
>>                       pinctrl-0 = <&i2c0_pins_a>;
>>                       status = "okay";
>> +
>> +                     axp209: pmic@34 {
>> +                             compatible = "x-powers,axp209";
>> +                             reg = <0x34>;
>> +                             interrupts = <0>;
>> +
>> +                             interrupt-controller;
>> +                             #interrupt-cells = <1>;
>> +
>> +                             acin-supply = <&reg_axp_ipsout>;
>> +                             vin2-supply = <&reg_axp_ipsout>;
>> +                             vin3-supply = <&reg_axp_ipsout>;
>> +                             ldo24in-supply = <&reg_axp_ipsout>;
>> +                             ldo3in-supply = <&reg_axp_ipsout>;
>> +                             ldo5in-supply = <&reg_axp_ipsout>;
>> +
>> +                             regulators {
>> +                                     x-powers,dcdc-freq = <1500>;
>> +
>> +                                     axp_vcore_reg: dcdc2 {
>> +                                             regulator-min-microvolt = <700000>;
>> +                                             regulator-max-microvolt = <2275000>;
>> +                                             regulator-always-on;
>> +                                     };
>> +
>> +                                     axp_ddr_reg: dcdc3 {
>> +                                             regulator-always-on;
>> +                                     };
>> +
>> +                                     axp_rtc_reg: ldo1 {
>> +                                             regulator-always-on;
>> +                                     };
>> +
>> +                                     axp_analog_reg: ldo2 {
>> +                                             regulator-always-on;
>> +                                     };
>> +
>> +                                     axp_pll_reg: ldo3 {
>> +                                             regulator-always-on;
>> +                                     };
>> +
>> +                                     axp_hdmi_reg: ldo4 {
>> +                                             regulator-always-on;
>> +                                     };
>> +
>> +                                     axp_mic_reg: ldo5 {
>> +                                             regulator-always-on;
>
> Do all these regulators need to be always on? It makes sense for the
> pll and vcore, but I don't get why the mic and hdmi regulators need
> this.

I did this way because I don't have the schematics for all the board
so I thought it was safer to leave all the regulators enabled
Maxime Ripard May 5, 2014, 10:51 p.m. UTC | #3
On Sat, May 03, 2014 at 02:21:06PM +0200, Carlo Caione wrote:
> On Sat, May 3, 2014 at 3:09 AM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > Hi,
> >
> > On Thu, May 01, 2014 at 02:29:34PM +0200, Carlo Caione wrote:
> >> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> >> Signed-off-by: Carlo Caione <carlo@caione.org>
> >> ---
> >>  arch/arm/boot/dts/sun4i-a10-a1000.dts           | 58 ++++++++++++++++++++++
> >>  arch/arm/boot/dts/sun4i-a10-cubieboard.dts      | 58 ++++++++++++++++++++++
> >>  arch/arm/boot/dts/sun4i-a10-hackberry.dts       | 64 ++++++++++++++++++++++++
> >>  arch/arm/boot/dts/sun4i-a10-inet97fv2.dts       | 58 ++++++++++++++++++++++
> >>  arch/arm/boot/dts/sun4i-a10-mini-xplus.dts      | 65 +++++++++++++++++++++++++
> >>  arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts  | 64 ++++++++++++++++++++++++
> >>  arch/arm/boot/dts/sun4i-a10-pcduino.dts         | 58 ++++++++++++++++++++++
> >>  arch/arm/boot/dts/sun7i-a20-cubieboard2.dts     | 59 ++++++++++++++++++++++
> >>  arch/arm/boot/dts/sun7i-a20-cubietruck.dts      | 59 ++++++++++++++++++++++
> >>  arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 59 ++++++++++++++++++++++
> >>  10 files changed, 602 insertions(+)
> >>
> >> diff --git a/arch/arm/boot/dts/sun4i-a10-a1000.dts b/arch/arm/boot/dts/sun4i-a10-a1000.dts
> >> index fa746aea..57d3fb4 100644
> >> --- a/arch/arm/boot/dts/sun4i-a10-a1000.dts
> >> +++ b/arch/arm/boot/dts/sun4i-a10-a1000.dts
> >> @@ -88,6 +88,56 @@
> >>                       pinctrl-names = "default";
> >>                       pinctrl-0 = <&i2c0_pins_a>;
> >>                       status = "okay";
> >> +
> >> +                     axp209: pmic@34 {
> >> +                             compatible = "x-powers,axp209";
> >> +                             reg = <0x34>;
> >> +                             interrupts = <0>;
> >> +
> >> +                             interrupt-controller;
> >> +                             #interrupt-cells = <1>;
> >> +
> >> +                             acin-supply = <&reg_axp_ipsout>;
> >> +                             vin2-supply = <&reg_axp_ipsout>;
> >> +                             vin3-supply = <&reg_axp_ipsout>;
> >> +                             ldo24in-supply = <&reg_axp_ipsout>;
> >> +                             ldo3in-supply = <&reg_axp_ipsout>;
> >> +                             ldo5in-supply = <&reg_axp_ipsout>;
> >> +
> >> +                             regulators {
> >> +                                     x-powers,dcdc-freq = <1500>;
> >> +
> >> +                                     axp_vcore_reg: dcdc2 {
> >> +                                             regulator-min-microvolt = <700000>;
> >> +                                             regulator-max-microvolt = <2275000>;
> >> +                                             regulator-always-on;
> >> +                                     };
> >> +
> >> +                                     axp_ddr_reg: dcdc3 {
> >> +                                             regulator-always-on;
> >> +                                     };
> >> +
> >> +                                     axp_rtc_reg: ldo1 {
> >> +                                             regulator-always-on;
> >> +                                     };
> >> +
> >> +                                     axp_analog_reg: ldo2 {
> >> +                                             regulator-always-on;
> >> +                                     };
> >> +
> >> +                                     axp_pll_reg: ldo3 {
> >> +                                             regulator-always-on;
> >> +                                     };
> >> +
> >> +                                     axp_hdmi_reg: ldo4 {
> >> +                                             regulator-always-on;
> >> +                                     };
> >> +
> >> +                                     axp_mic_reg: ldo5 {
> >> +                                             regulator-always-on;
> >
> > Do all these regulators need to be always on? It makes sense for the
> > pll and vcore, but I don't get why the mic and hdmi regulators need
> > this.
> 
> I did this way because I don't have the schematics for all the board
> so I thought it was safer to leave all the regulators enabled

Well, we have the schematics for most of these boards (at least all
the cubie and olinuxinos).

As far as the other boards are concerned, if we don't have that
information, I'd say leave them alone until someone has access to
these informations.

Maxime
Carlo Caione May 6, 2014, 7:38 a.m. UTC | #4
On Tue, May 6, 2014 at 12:51 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Sat, May 03, 2014 at 02:21:06PM +0200, Carlo Caione wrote:
>> On Sat, May 3, 2014 at 3:09 AM, Maxime Ripard
>> <maxime.ripard@free-electrons.com> wrote:
>> > Hi,
>> >
>> > On Thu, May 01, 2014 at 02:29:34PM +0200, Carlo Caione wrote:
>> >> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> >> Signed-off-by: Carlo Caione <carlo@caione.org>
>> >> ---
>> >>  arch/arm/boot/dts/sun4i-a10-a1000.dts           | 58 ++++++++++++++++++++++
>> >>  arch/arm/boot/dts/sun4i-a10-cubieboard.dts      | 58 ++++++++++++++++++++++
>> >>  arch/arm/boot/dts/sun4i-a10-hackberry.dts       | 64 ++++++++++++++++++++++++
>> >>  arch/arm/boot/dts/sun4i-a10-inet97fv2.dts       | 58 ++++++++++++++++++++++
>> >>  arch/arm/boot/dts/sun4i-a10-mini-xplus.dts      | 65 +++++++++++++++++++++++++
>> >>  arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts  | 64 ++++++++++++++++++++++++
>> >>  arch/arm/boot/dts/sun4i-a10-pcduino.dts         | 58 ++++++++++++++++++++++
>> >>  arch/arm/boot/dts/sun7i-a20-cubieboard2.dts     | 59 ++++++++++++++++++++++
>> >>  arch/arm/boot/dts/sun7i-a20-cubietruck.dts      | 59 ++++++++++++++++++++++
>> >>  arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 59 ++++++++++++++++++++++
>> >>  10 files changed, 602 insertions(+)
>> >>
>> >> diff --git a/arch/arm/boot/dts/sun4i-a10-a1000.dts b/arch/arm/boot/dts/sun4i-a10-a1000.dts
>> >> index fa746aea..57d3fb4 100644
>> >> --- a/arch/arm/boot/dts/sun4i-a10-a1000.dts
>> >> +++ b/arch/arm/boot/dts/sun4i-a10-a1000.dts
>> >> @@ -88,6 +88,56 @@
>> >>                       pinctrl-names = "default";
>> >>                       pinctrl-0 = <&i2c0_pins_a>;
>> >>                       status = "okay";
>> >> +
>> >> +                     axp209: pmic@34 {
>> >> +                             compatible = "x-powers,axp209";
>> >> +                             reg = <0x34>;
>> >> +                             interrupts = <0>;
>> >> +
>> >> +                             interrupt-controller;
>> >> +                             #interrupt-cells = <1>;
>> >> +
>> >> +                             acin-supply = <&reg_axp_ipsout>;
>> >> +                             vin2-supply = <&reg_axp_ipsout>;
>> >> +                             vin3-supply = <&reg_axp_ipsout>;
>> >> +                             ldo24in-supply = <&reg_axp_ipsout>;
>> >> +                             ldo3in-supply = <&reg_axp_ipsout>;
>> >> +                             ldo5in-supply = <&reg_axp_ipsout>;
>> >> +
>> >> +                             regulators {
>> >> +                                     x-powers,dcdc-freq = <1500>;
>> >> +
>> >> +                                     axp_vcore_reg: dcdc2 {
>> >> +                                             regulator-min-microvolt = <700000>;
>> >> +                                             regulator-max-microvolt = <2275000>;
>> >> +                                             regulator-always-on;
>> >> +                                     };
>> >> +
>> >> +                                     axp_ddr_reg: dcdc3 {
>> >> +                                             regulator-always-on;
>> >> +                                     };
>> >> +
>> >> +                                     axp_rtc_reg: ldo1 {
>> >> +                                             regulator-always-on;
>> >> +                                     };
>> >> +
>> >> +                                     axp_analog_reg: ldo2 {
>> >> +                                             regulator-always-on;
>> >> +                                     };
>> >> +
>> >> +                                     axp_pll_reg: ldo3 {
>> >> +                                             regulator-always-on;
>> >> +                                     };
>> >> +
>> >> +                                     axp_hdmi_reg: ldo4 {
>> >> +                                             regulator-always-on;
>> >> +                                     };
>> >> +
>> >> +                                     axp_mic_reg: ldo5 {
>> >> +                                             regulator-always-on;
>> >
>> > Do all these regulators need to be always on? It makes sense for the
>> > pll and vcore, but I don't get why the mic and hdmi regulators need
>> > this.
>>
>> I did this way because I don't have the schematics for all the board
>> so I thought it was safer to leave all the regulators enabled
>
> Well, we have the schematics for most of these boards (at least all
> the cubie and olinuxinos).
>
> As far as the other boards are concerned, if we don't have that
> information, I'd say leave them alone until someone has access to
> these informations.

What do you mean exactly with "leave them alone". The problem is that
if the regulator is not explicitly marked as always-on, it is disabled
at boot time, so I think that the most safe thing to do is leave them
on to avoid turning off something at boot time that could be
important.
Maxime Ripard May 8, 2014, 2:53 a.m. UTC | #5
On Tue, May 06, 2014 at 09:38:23AM +0200, Carlo Caione wrote:
> On Tue, May 6, 2014 at 12:51 AM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > On Sat, May 03, 2014 at 02:21:06PM +0200, Carlo Caione wrote:
> >> On Sat, May 3, 2014 at 3:09 AM, Maxime Ripard
> >> <maxime.ripard@free-electrons.com> wrote:
> >> > Hi,
> >> >
> >> > On Thu, May 01, 2014 at 02:29:34PM +0200, Carlo Caione wrote:
> >> >> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> >> >> Signed-off-by: Carlo Caione <carlo@caione.org>
> >> >> ---
> >> >>  arch/arm/boot/dts/sun4i-a10-a1000.dts           | 58 ++++++++++++++++++++++
> >> >>  arch/arm/boot/dts/sun4i-a10-cubieboard.dts      | 58 ++++++++++++++++++++++
> >> >>  arch/arm/boot/dts/sun4i-a10-hackberry.dts       | 64 ++++++++++++++++++++++++
> >> >>  arch/arm/boot/dts/sun4i-a10-inet97fv2.dts       | 58 ++++++++++++++++++++++
> >> >>  arch/arm/boot/dts/sun4i-a10-mini-xplus.dts      | 65 +++++++++++++++++++++++++
> >> >>  arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts  | 64 ++++++++++++++++++++++++
> >> >>  arch/arm/boot/dts/sun4i-a10-pcduino.dts         | 58 ++++++++++++++++++++++
> >> >>  arch/arm/boot/dts/sun7i-a20-cubieboard2.dts     | 59 ++++++++++++++++++++++
> >> >>  arch/arm/boot/dts/sun7i-a20-cubietruck.dts      | 59 ++++++++++++++++++++++
> >> >>  arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | 59 ++++++++++++++++++++++
> >> >>  10 files changed, 602 insertions(+)
> >> >>
> >> >> diff --git a/arch/arm/boot/dts/sun4i-a10-a1000.dts b/arch/arm/boot/dts/sun4i-a10-a1000.dts
> >> >> index fa746aea..57d3fb4 100644
> >> >> --- a/arch/arm/boot/dts/sun4i-a10-a1000.dts
> >> >> +++ b/arch/arm/boot/dts/sun4i-a10-a1000.dts
> >> >> @@ -88,6 +88,56 @@
> >> >>                       pinctrl-names = "default";
> >> >>                       pinctrl-0 = <&i2c0_pins_a>;
> >> >>                       status = "okay";
> >> >> +
> >> >> +                     axp209: pmic@34 {
> >> >> +                             compatible = "x-powers,axp209";
> >> >> +                             reg = <0x34>;
> >> >> +                             interrupts = <0>;
> >> >> +
> >> >> +                             interrupt-controller;
> >> >> +                             #interrupt-cells = <1>;
> >> >> +
> >> >> +                             acin-supply = <&reg_axp_ipsout>;
> >> >> +                             vin2-supply = <&reg_axp_ipsout>;
> >> >> +                             vin3-supply = <&reg_axp_ipsout>;
> >> >> +                             ldo24in-supply = <&reg_axp_ipsout>;
> >> >> +                             ldo3in-supply = <&reg_axp_ipsout>;
> >> >> +                             ldo5in-supply = <&reg_axp_ipsout>;
> >> >> +
> >> >> +                             regulators {
> >> >> +                                     x-powers,dcdc-freq = <1500>;
> >> >> +
> >> >> +                                     axp_vcore_reg: dcdc2 {
> >> >> +                                             regulator-min-microvolt = <700000>;
> >> >> +                                             regulator-max-microvolt = <2275000>;
> >> >> +                                             regulator-always-on;
> >> >> +                                     };
> >> >> +
> >> >> +                                     axp_ddr_reg: dcdc3 {
> >> >> +                                             regulator-always-on;
> >> >> +                                     };
> >> >> +
> >> >> +                                     axp_rtc_reg: ldo1 {
> >> >> +                                             regulator-always-on;
> >> >> +                                     };
> >> >> +
> >> >> +                                     axp_analog_reg: ldo2 {
> >> >> +                                             regulator-always-on;
> >> >> +                                     };
> >> >> +
> >> >> +                                     axp_pll_reg: ldo3 {
> >> >> +                                             regulator-always-on;
> >> >> +                                     };
> >> >> +
> >> >> +                                     axp_hdmi_reg: ldo4 {
> >> >> +                                             regulator-always-on;
> >> >> +                                     };
> >> >> +
> >> >> +                                     axp_mic_reg: ldo5 {
> >> >> +                                             regulator-always-on;
> >> >
> >> > Do all these regulators need to be always on? It makes sense for the
> >> > pll and vcore, but I don't get why the mic and hdmi regulators need
> >> > this.
> >>
> >> I did this way because I don't have the schematics for all the board
> >> so I thought it was safer to leave all the regulators enabled
> >
> > Well, we have the schematics for most of these boards (at least all
> > the cubie and olinuxinos).
> >
> > As far as the other boards are concerned, if we don't have that
> > information, I'd say leave them alone until someone has access to
> > these informations.
> 
> What do you mean exactly with "leave them alone". The problem is that
> if the regulator is not explicitly marked as always-on, it is disabled
> at boot time, so I think that the most safe thing to do is leave them
> on to avoid turning off something at boot time that could be
> important.

What I mean is that no information is still better than wrong
informations. If you don't have the schematics, then don't do anything
on this boards. Hopefully, someone with more infos on this will know
what to do.

Moreover, I have the feeling that you just copy pasted all the
informations on this patch. The first example I'm seeing is the
cubieboard, for which we do have the schematics, and this patch says
that ldo4 is used for HDMI, and that is required to stays always on,
while LDO4 doesn't seem to be used at all, and that HDMI takes
directly its input source from DC-5V.

I guess you need some more refining on this patch.

Maxime
Carlo Caione May 8, 2014, 8:17 a.m. UTC | #6
On Thu, May 8, 2014 at 4:53 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:

<snip>

> What I mean is that no information is still better than wrong
> informations. If you don't have the schematics, then don't do anything
> on this boards. Hopefully, someone with more infos on this will know
> what to do.

I partially agree here. Not specifying the voltage range for the
regulators but only keeping them always-on from a practical point of
view means that we do nothing with those regulators (see also
https://www.mail-archive.com/linux-input@vger.kernel.org/msg09532.html
)

> Moreover, I have the feeling that you just copy pasted all the
> informations on this patch. The first example I'm seeing is the
> cubieboard, for which we do have the schematics, and this patch says
> that ldo4 is used for HDMI, and that is required to stays always on,
> while LDO4 doesn't seem to be used at all, and that HDMI takes
> directly its input source from DC-5V.

The names for the regulators are taken from the original Allwinner
driver and (of course) they can have nothing to do with the function
they have in the board. I agree that this could be misleading so I'll
change them with more general names. Concerning LDO4 that is always
on, it was off until this v4, but I changed it back to have one common
DT representation among all the boards.

> I guess you need some more refining on this patch.

Ok, I'll submit a v6 only for this patch.

Thanks,
Maxime Ripard May 10, 2014, 1:06 a.m. UTC | #7
On Thu, May 08, 2014 at 10:17:16AM +0200, Carlo Caione wrote:
> On Thu, May 8, 2014 at 4:53 AM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> 
> <snip>
> 
> > What I mean is that no information is still better than wrong
> > informations. If you don't have the schematics, then don't do anything
> > on this boards. Hopefully, someone with more infos on this will know
> > what to do.
> 
> I partially agree here. Not specifying the voltage range for the
> regulators but only keeping them always-on from a practical point of
> view means that we do nothing with those regulators (see also
> https://www.mail-archive.com/linux-input@vger.kernel.org/msg09532.html
> )

But we don't even know if they are used on these boards or not in the
first place..

> > Moreover, I have the feeling that you just copy pasted all the
> > informations on this patch. The first example I'm seeing is the
> > cubieboard, for which we do have the schematics, and this patch says
> > that ldo4 is used for HDMI, and that is required to stays always on,
> > while LDO4 doesn't seem to be used at all, and that HDMI takes
> > directly its input source from DC-5V.
> 
> The names for the regulators are taken from the original Allwinner
> driver and (of course) they can have nothing to do with the function
> they have in the board. I agree that this could be misleading so I'll
> change them with more general names. Concerning LDO4 that is always
> on, it was off until this v4, but I changed it back to have one common
> DT representation among all the boards.

I'm sorry, you did a great job on this PMIC driver, but this is just
wrong. I'm completely fine with the names. What I'm not fine with is
all this "one common DT representation across all boards". Pretty much
all the boards are wired differently when it comes to regulators. Why
do you want to just do some copy pasting without any checking on the
schematics side if not just for the joy of duplicating code?

> > I guess you need some more refining on this patch.
> 
> Ok, I'll submit a v6 only for this patch.

Please, please, *please* make sure that the informations you put in
there are actually accurate.

Maxime
diff mbox

Patch

diff --git a/arch/arm/boot/dts/sun4i-a10-a1000.dts b/arch/arm/boot/dts/sun4i-a10-a1000.dts
index fa746aea..57d3fb4 100644
--- a/arch/arm/boot/dts/sun4i-a10-a1000.dts
+++ b/arch/arm/boot/dts/sun4i-a10-a1000.dts
@@ -88,6 +88,56 @@ 
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c0_pins_a>;
 			status = "okay";
+
+			axp209: pmic@34 {
+				compatible = "x-powers,axp209";
+				reg = <0x34>;
+				interrupts = <0>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+
+				acin-supply = <&reg_axp_ipsout>;
+				vin2-supply = <&reg_axp_ipsout>;
+				vin3-supply = <&reg_axp_ipsout>;
+				ldo24in-supply = <&reg_axp_ipsout>;
+				ldo3in-supply = <&reg_axp_ipsout>;
+				ldo5in-supply = <&reg_axp_ipsout>;
+
+				regulators {
+					x-powers,dcdc-freq = <1500>;
+
+					axp_vcore_reg: dcdc2 {
+						regulator-min-microvolt = <700000>;
+						regulator-max-microvolt = <2275000>;
+						regulator-always-on;
+					};
+
+					axp_ddr_reg: dcdc3 {
+						regulator-always-on;
+					};
+
+					axp_rtc_reg: ldo1 {
+						regulator-always-on;
+					};
+
+					axp_analog_reg: ldo2 {
+						regulator-always-on;
+					};
+
+					axp_pll_reg: ldo3 {
+						regulator-always-on;
+					};
+
+					axp_hdmi_reg: ldo4 {
+						regulator-always-on;
+					};
+
+					axp_mic_reg: ldo5 {
+						regulator-always-on;
+					};
+				};
+			};
 		};
 	};
 
@@ -125,4 +175,12 @@ 
 	reg_usb2_vbus: usb2-vbus {
 		status = "okay";
 	};
+
+	reg_axp_ipsout: axp_ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "axp-ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
diff --git a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
index 4684cbe..0aed114 100644
--- a/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
+++ b/arch/arm/boot/dts/sun4i-a10-cubieboard.dts
@@ -80,6 +80,56 @@ 
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c0_pins_a>;
 			status = "okay";
+
+			axp209: pmic@34 {
+				compatible = "x-powers,axp209";
+				reg = <0x34>;
+				interrupts = <0>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+
+				acin-supply = <&reg_axp_ipsout>;
+				vin2-supply = <&reg_axp_ipsout>;
+				vin3-supply = <&reg_axp_ipsout>;
+				ldo24in-supply = <&reg_axp_ipsout>;
+				ldo3in-supply = <&reg_axp_ipsout>;
+				ldo5in-supply = <&reg_axp_ipsout>;
+
+				regulators {
+					x-powers,dcdc-freq = <1500>;
+
+					axp_vcore_reg: dcdc2 {
+						regulator-min-microvolt = <700000>;
+						regulator-max-microvolt = <2275000>;
+						regulator-always-on;
+					};
+
+					axp_ddr_reg: dcdc3 {
+						regulator-always-on;
+					};
+
+					axp_rtc_reg: ldo1 {
+						regulator-always-on;
+					};
+
+					axp_analog_reg: ldo2 {
+						regulator-always-on;
+					};
+
+					axp_pll_reg: ldo3 {
+						regulator-always-on;
+					};
+
+					axp_hdmi_reg: ldo4 {
+						regulator-always-on;
+					};
+
+					axp_mic_reg: ldo5 {
+						regulator-always-on;
+					};
+				};
+			};
 		};
 
 		i2c1: i2c@01c2b000 {
@@ -117,4 +167,12 @@ 
 	reg_usb2_vbus: usb2-vbus {
 		status = "okay";
 	};
+
+	reg_axp_ipsout: axp_ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "axp-ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
diff --git a/arch/arm/boot/dts/sun4i-a10-hackberry.dts b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
index d7c17e4..c81db47 100644
--- a/arch/arm/boot/dts/sun4i-a10-hackberry.dts
+++ b/arch/arm/boot/dts/sun4i-a10-hackberry.dts
@@ -82,6 +82,62 @@ 
 			pinctrl-0 = <&uart0_pins_a>;
 			status = "okay";
 		};
+
+		i2c0: i2c@01c2ac00 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c0_pins_a>;
+			status = "okay";
+
+			axp209: pmic@34 {
+				compatible = "x-powers,axp209";
+				reg = <0x34>;
+				interrupts = <0>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+
+				acin-supply = <&reg_axp_ipsout>;
+				vin2-supply = <&reg_axp_ipsout>;
+				vin3-supply = <&reg_axp_ipsout>;
+				ldo24in-supply = <&reg_axp_ipsout>;
+				ldo3in-supply = <&reg_axp_ipsout>;
+				ldo5in-supply = <&reg_axp_ipsout>;
+
+				regulators {
+					x-powers,dcdc-freq = <1500>;
+
+					axp_vcore_reg: dcdc2 {
+						regulator-min-microvolt = <700000>;
+						regulator-max-microvolt = <2275000>;
+						regulator-always-on;
+					};
+
+					axp_ddr_reg: dcdc3 {
+						regulator-always-on;
+					};
+
+					axp_rtc_reg: ldo1 {
+						regulator-always-on;
+					};
+
+					axp_analog_reg: ldo2 {
+						regulator-always-on;
+					};
+
+					axp_pll_reg: ldo3 {
+						regulator-always-on;
+					};
+
+					axp_hdmi_reg: ldo4 {
+						regulator-always-on;
+					};
+
+					axp_mic_reg: ldo5 {
+						regulator-always-on;
+					};
+				};
+			};
+		};
 	};
 
 	reg_emac_3v3: emac-3v3 {
@@ -102,4 +158,12 @@ 
 		gpio = <&pio 7 12 0>;
 		status = "okay";
 	};
+
+	reg_axp_ipsout: axp_ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "axp-ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
diff --git a/arch/arm/boot/dts/sun4i-a10-inet97fv2.dts b/arch/arm/boot/dts/sun4i-a10-inet97fv2.dts
index fe9272e..5d0d3c2 100644
--- a/arch/arm/boot/dts/sun4i-a10-inet97fv2.dts
+++ b/arch/arm/boot/dts/sun4i-a10-inet97fv2.dts
@@ -34,6 +34,56 @@ 
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c0_pins_a>;
 			status = "okay";
+
+			axp209: pmic@34 {
+				compatible = "x-powers,axp209";
+				reg = <0x34>;
+				interrupts = <0>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+
+				acin-supply = <&reg_axp_ipsout>;
+				vin2-supply = <&reg_axp_ipsout>;
+				vin3-supply = <&reg_axp_ipsout>;
+				ldo24in-supply = <&reg_axp_ipsout>;
+				ldo3in-supply = <&reg_axp_ipsout>;
+				ldo5in-supply = <&reg_axp_ipsout>;
+
+				regulators {
+					x-powers,dcdc-freq = <1500>;
+
+					axp_vcore_reg: dcdc2 {
+						regulator-min-microvolt = <700000>;
+						regulator-max-microvolt = <2275000>;
+						regulator-always-on;
+					};
+
+					axp_ddr_reg: dcdc3 {
+						regulator-always-on;
+					};
+
+					axp_rtc_reg: ldo1 {
+						regulator-always-on;
+					};
+
+					axp_analog_reg: ldo2 {
+						regulator-always-on;
+					};
+
+					axp_pll_reg: ldo3 {
+						regulator-always-on;
+					};
+
+					axp_hdmi_reg: ldo4 {
+						regulator-always-on;
+					};
+
+					axp_mic_reg: ldo5 {
+						regulator-always-on;
+					};
+				};
+			};
 		};
 
 		usbphy: phy@01c13400 {
@@ -66,4 +116,12 @@ 
 	reg_usb2_vbus: usb2-vbus {
 		status = "okay";
 	};
+
+	reg_axp_ipsout: axp_ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "axp-ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
diff --git a/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts b/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts
index dd84a9e..b23989d 100644
--- a/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts
+++ b/arch/arm/boot/dts/sun4i-a10-mini-xplus.dts
@@ -47,6 +47,62 @@ 
 			pinctrl-0 = <&uart0_pins_a>;
 			status = "okay";
 		};
+
+		i2c0: i2c@01c2ac00 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c0_pins_a>;
+			status = "okay";
+
+			axp209: pmic@34 {
+				compatible = "x-powers,axp209";
+				reg = <0x34>;
+				interrupts = <0>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+
+				acin-supply = <&reg_axp_ipsout>;
+				vin2-supply = <&reg_axp_ipsout>;
+				vin3-supply = <&reg_axp_ipsout>;
+				ldo24in-supply = <&reg_axp_ipsout>;
+				ldo3in-supply = <&reg_axp_ipsout>;
+				ldo5in-supply = <&reg_axp_ipsout>;
+
+				regulators {
+					x-powers,dcdc-freq = <1500>;
+
+					axp_vcore_reg: dcdc2 {
+						regulator-min-microvolt = <700000>;
+						regulator-max-microvolt = <2275000>;
+						regulator-always-on;
+					};
+
+					axp_ddr_reg: dcdc3 {
+						regulator-always-on;
+					};
+
+					axp_rtc_reg: ldo1 {
+						regulator-always-on;
+					};
+
+					axp_analog_reg: ldo2 {
+						regulator-always-on;
+					};
+
+					axp_pll_reg: ldo3 {
+						regulator-always-on;
+					};
+
+					axp_hdmi_reg: ldo4 {
+						regulator-always-on;
+					};
+
+					axp_mic_reg: ldo5 {
+						regulator-always-on;
+					};
+				};
+			};
+		};
 	};
 
 	reg_usb1_vbus: usb1-vbus {
@@ -56,4 +112,13 @@ 
 	reg_usb2_vbus: usb2-vbus {
 		status = "okay";
 	};
+
+
+	reg_axp_ipsout: axp_ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "axp-ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
diff --git a/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
index 66cf0c7..004a6f0 100644
--- a/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
+++ b/arch/arm/boot/dts/sun4i-a10-olinuxino-lime.dts
@@ -81,6 +81,62 @@ 
 			pinctrl-0 = <&uart0_pins_a>;
 			status = "okay";
 		};
+
+		i2c0: i2c@01c2ac00 {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c0_pins_a>;
+			status = "okay";
+
+			axp209: pmic@34 {
+				compatible = "x-powers,axp209";
+				reg = <0x34>;
+				interrupts = <0>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+
+				acin-supply = <&reg_axp_ipsout>;
+				vin2-supply = <&reg_axp_ipsout>;
+				vin3-supply = <&reg_axp_ipsout>;
+				ldo24in-supply = <&reg_axp_ipsout>;
+				ldo3in-supply = <&reg_axp_ipsout>;
+				ldo5in-supply = <&reg_axp_ipsout>;
+
+				regulators {
+					x-powers,dcdc-freq = <1500>;
+
+					axp_vcore_reg: dcdc2 {
+						regulator-min-microvolt = <700000>;
+						regulator-max-microvolt = <2275000>;
+						regulator-always-on;
+					};
+
+					axp_ddr_reg: dcdc3 {
+						regulator-always-on;
+					};
+
+					axp_rtc_reg: ldo1 {
+						regulator-always-on;
+					};
+
+					axp_analog_reg: ldo2 {
+						regulator-always-on;
+					};
+
+					axp_pll_reg: ldo3 {
+						regulator-always-on;
+					};
+
+					axp_hdmi_reg: ldo4 {
+						regulator-always-on;
+					};
+
+					axp_mic_reg: ldo5 {
+						regulator-always-on;
+					};
+				};
+			};
+		};
 	};
 
 	leds {
@@ -108,4 +164,12 @@ 
 	reg_usb2_vbus: usb2-vbus {
 		status = "okay";
 	};
+
+	reg_axp_ipsout: axp_ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "axp-ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
diff --git a/arch/arm/boot/dts/sun4i-a10-pcduino.dts b/arch/arm/boot/dts/sun4i-a10-pcduino.dts
index 255b47e..fcd7c86 100644
--- a/arch/arm/boot/dts/sun4i-a10-pcduino.dts
+++ b/arch/arm/boot/dts/sun4i-a10-pcduino.dts
@@ -66,6 +66,56 @@ 
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c0_pins_a>;
 			status = "okay";
+
+			axp209: pmic@34 {
+				compatible = "x-powers,axp209";
+				reg = <0x34>;
+				interrupts = <0>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+
+				acin-supply = <&reg_axp_ipsout>;
+				vin2-supply = <&reg_axp_ipsout>;
+				vin3-supply = <&reg_axp_ipsout>;
+				ldo24in-supply = <&reg_axp_ipsout>;
+				ldo3in-supply = <&reg_axp_ipsout>;
+				ldo5in-supply = <&reg_axp_ipsout>;
+
+				regulators {
+					x-powers,dcdc-freq = <1500>;
+
+					axp_vcore_reg: dcdc2 {
+						regulator-min-microvolt = <700000>;
+						regulator-max-microvolt = <2275000>;
+						regulator-always-on;
+					};
+
+					axp_ddr_reg: dcdc3 {
+						regulator-always-on;
+					};
+
+					axp_rtc_reg: ldo1 {
+						regulator-always-on;
+					};
+
+					axp_analog_reg: ldo2 {
+						regulator-always-on;
+					};
+
+					axp_pll_reg: ldo3 {
+						regulator-always-on;
+					};
+
+					axp_hdmi_reg: ldo4 {
+						regulator-always-on;
+					};
+
+					axp_mic_reg: ldo5 {
+						regulator-always-on;
+					};
+				};
+			};
 		};
 	};
 
@@ -76,4 +126,12 @@ 
 	reg_usb2_vbus: usb2-vbus {
 		status = "okay";
 	};
+
+	reg_axp_ipsout: axp_ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "axp-ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
diff --git a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
index 68de89f..3e748ed 100644
--- a/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
+++ b/arch/arm/boot/dts/sun7i-a20-cubieboard2.dts
@@ -66,6 +66,57 @@ 
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c0_pins_a>;
 			status = "okay";
+
+			axp209: pmic@34 {
+				compatible = "x-powers,axp209";
+				reg = <0x34>;
+				interrupt-parent = <&nmi_intc>;
+				interrupts = <0 8>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+
+				acin-supply = <&reg_axp_ipsout>;
+				vin2-supply = <&reg_axp_ipsout>;
+				vin3-supply = <&reg_axp_ipsout>;
+				ldo24in-supply = <&reg_axp_ipsout>;
+				ldo3in-supply = <&reg_axp_ipsout>;
+				ldo5in-supply = <&reg_axp_ipsout>;
+
+				regulators {
+					x-powers,dcdc-freq = <1500>;
+
+					axp_vcore_reg: dcdc2 {
+						regulator-min-microvolt = <700000>;
+						regulator-max-microvolt = <2275000>;
+						regulator-always-on;
+					};
+
+					axp_ddr_reg: dcdc3 {
+						regulator-always-on;
+					};
+
+					axp_rtc_reg: ldo1 {
+						regulator-always-on;
+					};
+
+					axp_analog_reg: ldo2 {
+						regulator-always-on;
+					};
+
+					axp_pll_reg: ldo3 {
+						regulator-always-on;
+					};
+
+					axp_hdmi_reg: ldo4 {
+						regulator-always-on;
+					};
+
+					axp_mic_reg: ldo5 {
+						regulator-always-on;
+					};
+				};
+			};
 		};
 
 		i2c1: i2c@01c2b000 {
@@ -114,4 +165,12 @@ 
 	reg_usb2_vbus: usb2-vbus {
 		status = "okay";
 	};
+
+	reg_axp_ipsout: axp_ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "axp-ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
diff --git a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
index cb25d3c..d863469 100644
--- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
+++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts
@@ -73,6 +73,57 @@ 
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c0_pins_a>;
 			status = "okay";
+
+			axp209: pmic@34 {
+				compatible = "x-powers,axp209";
+				reg = <0x34>;
+				interrupt-parent = <&nmi_intc>;
+				interrupts = <0 8>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+
+				acin-supply = <&reg_axp_ipsout>;
+				vin2-supply = <&reg_axp_ipsout>;
+				vin3-supply = <&reg_axp_ipsout>;
+				ldo24in-supply = <&reg_axp_ipsout>;
+				ldo3in-supply = <&reg_axp_ipsout>;
+				ldo5in-supply = <&reg_axp_ipsout>;
+
+				regulators {
+					x-powers,dcdc-freq = <1500>;
+
+					axp_vcore_reg: dcdc2 {
+						regulator-min-microvolt = <700000>;
+						regulator-max-microvolt = <2275000>;
+						regulator-always-on;
+					};
+
+					axp_ddr_reg: dcdc3 {
+						regulator-always-on;
+					};
+
+					axp_rtc_reg: ldo1 {
+						regulator-always-on;
+					};
+
+					axp_analog_reg: ldo2 {
+						regulator-always-on;
+					};
+
+					axp_pll_reg: ldo3 {
+						regulator-always-on;
+					};
+
+					axp_hdmi_reg: ldo4 {
+						regulator-always-on;
+					};
+
+					axp_mic_reg: ldo5 {
+						regulator-always-on;
+					};
+				};
+			};
 		};
 
 		i2c1: i2c@01c2b000 {
@@ -139,4 +190,12 @@ 
 	reg_usb2_vbus: usb2-vbus {
 		status = "okay";
 	};
+
+	reg_axp_ipsout: axp_ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "axp-ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
index eeadf76..047340a 100644
--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts
@@ -95,6 +95,57 @@ 
 			pinctrl-names = "default";
 			pinctrl-0 = <&i2c0_pins_a>;
 			status = "okay";
+
+			axp209: pmic@34 {
+				compatible = "x-powers,axp209";
+				reg = <0x34>;
+				interrupt-parent = <&nmi_intc>;
+				interrupts = <0 8>;
+
+				interrupt-controller;
+				#interrupt-cells = <1>;
+
+				acin-supply = <&reg_axp_ipsout>;
+				vin2-supply = <&reg_axp_ipsout>;
+				vin3-supply = <&reg_axp_ipsout>;
+				ldo24in-supply = <&reg_axp_ipsout>;
+				ldo3in-supply = <&reg_axp_ipsout>;
+				ldo5in-supply = <&reg_axp_ipsout>;
+
+				regulators {
+					x-powers,dcdc-freq = <1500>;
+
+					axp_vcore_reg: dcdc2 {
+						regulator-min-microvolt = <700000>;
+						regulator-max-microvolt = <2275000>;
+						regulator-always-on;
+					};
+
+					axp_ddr_reg: dcdc3 {
+						regulator-always-on;
+					};
+
+					axp_rtc_reg: ldo1 {
+						regulator-always-on;
+					};
+
+					axp_analog_reg: ldo2 {
+						regulator-always-on;
+					};
+
+					axp_pll_reg: ldo3 {
+						regulator-always-on;
+					};
+
+					axp_hdmi_reg: ldo4 {
+						regulator-always-on;
+					};
+
+					axp_mic_reg: ldo5 {
+						regulator-always-on;
+					};
+				};
+			};
 		};
 
 		i2c1: i2c@01c2b000 {
@@ -145,4 +196,12 @@ 
 	reg_usb2_vbus: usb2-vbus {
 		status = "okay";
 	};
+
+	reg_axp_ipsout: axp_ipsout {
+		compatible = "regulator-fixed";
+		regulator-name = "axp-ipsout";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
 };