Re: [U-Boot] [PATCH 3/7] sunxi: power: Unify axp pmic function names

2015-10-11 Thread Ian Campbell
On Sat, 2015-10-03 at 16:26 +0200, Hans de Goede wrote:
> Stop prefixing the axp functions for setting voltages, etc. with the
> model number, there ever is only one pmic driver built into u-boot,
> this allows simplifying the callers.
> 
> Signed-off-by: Hans de Goede 

Acked-by: Ian Campbell 

@@ -1217,10 +1217,10 @@ static void sunxi_mode_set(const struct
> ctfb_res_modes *mode,
>  >>   > if 
> (IS_ENABLED(CONFIG_VIDEO_LCD_PANEL_EDP_4_LANE_1620M_VIA_ANX9804)) {
>  >>   >   > /*
>  >>   >   >  * The anx9804 needs 1.8V from eldo3, we do this here
> ->>   >   >  * and not via CONFIG_AXP221_ELDO3 from board_init()
> +>>   >   >  * and not via CONFIG_AXP_ELDO3_VOLT from board_init()

I think strictly speaking that hunk belonged in a previous patch, but
nevermind (or feel to retain acks on both if you want to move it).

Ian.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] sunxi: power: Unify axp pmic function names

2015-10-09 Thread Ian Campbell
On Sat, 2015-10-03 at 22:16 +0200, Hans de Goede wrote:
> Hi,
> 
> On 03-10-15 16:32, Chen-Yu Tsai wrote:
> > On Sat, Oct 3, 2015 at 10:26 PM, Hans de Goede 
> > wrote:
> > > Stop prefixing the axp functions for setting voltages, etc. with the
> > > model number, there ever is only one pmic driver built into u-boot,
> > > this allows simplifying the callers.
> > 
> > Hmm... What's going to happen with the A80, which has 2 PMICs? IIRC
> > a subset of their LDOs share the same name, which would be a problem.
> 
> My plan for that is to use a different function name for the ldo-s
> on the secondary pmic, e.g. something like axp2_set_xldo1(...), or
> somesuch. Actually this patch should help adding support for the
> other pmics since it will make it less of an #ifdef fest.

Is it going to be (or very likely to be) the case that a given AXPxxx
device will only ever be a primary or a secondary,  but never used as both
(perhaps on different boards)?

Is there some property of these devices which causes them to be only usable
as one or the other?

If there is some possibility of this not being the case then this
unification + my comments on patch #1 might be seen in a different light.

Having a board which uses two of the same AXPxxx device looks like it would
be even more problematic, if such a thing is possible.

Or is the plan to just cross that bridge if/when we get there? (I think I'm
 OK with that).

Ian.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] sunxi: power: Unify axp pmic function names

2015-10-09 Thread Ian Campbell
On Fri, 2015-10-09 at 15:44 +0200, Hans de Goede wrote:

> > In which case what we would want is a set of choice options for primary and
> > a separate set choice options for secondary (with a none option too in this
> > case) and there would be no duplication of any specific AXPxxx option
> > between both the primary and secondary sets.
> 
> Ah Yes, from what we now know / expect about how things will work on
> boards with 2 pmics that is correct. I'll respin the first patch to change
> things into a choice including a none option.

Do we need a "none" option for the primary case?

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] sunxi: power: Unify axp pmic function names

2015-10-09 Thread Hans de Goede

Hi,

On 09-10-15 10:31, Ian Campbell wrote:

On Sat, 2015-10-03 at 22:16 +0200, Hans de Goede wrote:

Hi,

On 03-10-15 16:32, Chen-Yu Tsai wrote:

On Sat, Oct 3, 2015 at 10:26 PM, Hans de Goede 
wrote:

Stop prefixing the axp functions for setting voltages, etc. with the
model number, there ever is only one pmic driver built into u-boot,
this allows simplifying the callers.


Hmm... What's going to happen with the A80, which has 2 PMICs? IIRC
a subset of their LDOs share the same name, which would be a problem.


My plan for that is to use a different function name for the ldo-s
on the secondary pmic, e.g. something like axp2_set_xldo1(...), or
somesuch. Actually this patch should help adding support for the
other pmics since it will make it less of an #ifdef fest.


Is it going to be (or very likely to be) the case that a given AXPxxx
device will only ever be a primary or a secondary,  but never used as both
(perhaps on different boards)?


AFAIK that is correct, there are different axp models for primary / secondary
pmics. Some a80 / a83 boards may only use the primary pmic, but using only
the secondary is not really expected.


Is there some property of these devices which causes them to be only usable
as one or the other?


No, not really (unless you count things like power-on / power-button handling
which only the primary has AFAIK).


If there is some possibility of this not being the case then this
unification + my comments on patch #1 might be seen in a different light.

Having a board which uses two of the same AXPxxx device looks like it would
be even more problematic, if such a thing is possible.


AFAIK there are no boards which use the same pmic twice.


Or is the plan to just cross that bridge if/when we get there? (I think I'm
  OK with that).


Yes that is pretty much the plan :)

Regards,

Hans
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] sunxi: power: Unify axp pmic function names

2015-10-09 Thread Ian Campbell
On Fri, 2015-10-09 at 13:24 +0200, Hans de Goede wrote:
> Hi,
> 
> On 09-10-15 10:31, Ian Campbell wrote:
> > On Sat, 2015-10-03 at 22:16 +0200, Hans de Goede wrote:
> > > Hi,
> > > 
> > > On 03-10-15 16:32, Chen-Yu Tsai wrote:
> > > > On Sat, Oct 3, 2015 at 10:26 PM, Hans de Goede  > > > >
> > > > wrote:
> > > > > Stop prefixing the axp functions for setting voltages, etc. with
> > > > > the
> > > > > model number, there ever is only one pmic driver built into u
> > > > > -boot,
> > > > > this allows simplifying the callers.
> > > > 
> > > > Hmm... What's going to happen with the A80, which has 2 PMICs? IIRC
> > > > a subset of their LDOs share the same name, which would be a
> > > > problem.
> > > 
> > > My plan for that is to use a different function name for the ldo-s
> > > on the secondary pmic, e.g. something like axp2_set_xldo1(...), or
> > > somesuch. Actually this patch should help adding support for the
> > > other pmics since it will make it less of an #ifdef fest.
> > 
> > Is it going to be (or very likely to be) the case that a given AXPxxx
> > device will only ever be a primary or a secondary,  but never used as
> > both
> > (perhaps on different boards)?
> 
> AFAIK that is correct, there are different axp models for primary / secondary
> pmics.

OK, that makes sense, but then this:

>  Some a80 / a83 boards may only use the primary pmic, but using only
> the secondary is not really expected.

... makes me want to clarify, since I understand that having a secondary
but not a primary would be rather strange and wasn't what I was getting at.

What I meant was for a given AXPxxx is that model only ever either used as
a primary _or_ used as a secondary (with some other AXPabc as the primary).
I think your answer further above is telling me that yes, a given AXPxxx is
either designed (and used) as a primary or a secondary.

>From the patch #1 discussion (since it is predicated on the above and
splitting the conversation in two will probably just get confusing):

> > ... these three ought to be inside a choice?
> 
> I was thinking the same, but on A80 boards there are 2
> different axp chips, so if we make this a choice now we
> just end up needing to revert this when we get full A80 support.

But one of those would be a primary and the other a secondary, and as
discussed above (as I currently understand it at least) each
CONFIG_AXPxxx_POWER can be a primary XOR a secondary.

In which case what we would want is a set of choice options for primary and
a separate set choice options for secondary (with a none option too in this
case) and there would be no duplication of any specific AXPxxx option
between both the primary and secondary sets.

Ian.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] sunxi: power: Unify axp pmic function names

2015-10-09 Thread Hans de Goede

Hi,

On 09-10-15 14:41, Ian Campbell wrote:

On Fri, 2015-10-09 at 13:24 +0200, Hans de Goede wrote:

Hi,

On 09-10-15 10:31, Ian Campbell wrote:

On Sat, 2015-10-03 at 22:16 +0200, Hans de Goede wrote:

Hi,

On 03-10-15 16:32, Chen-Yu Tsai wrote:

On Sat, Oct 3, 2015 at 10:26 PM, Hans de Goede 

Re: [U-Boot] [PATCH 3/7] sunxi: power: Unify axp pmic function names

2015-10-09 Thread Chen-Yu Tsai
Hi,

On Fri, Oct 9, 2015 at 8:41 PM, Ian Campbell  wrote:
> On Fri, 2015-10-09 at 13:24 +0200, Hans de Goede wrote:
>> Hi,
>>
>> On 09-10-15 10:31, Ian Campbell wrote:
>> > On Sat, 2015-10-03 at 22:16 +0200, Hans de Goede wrote:
>> > > Hi,
>> > >
>> > > On 03-10-15 16:32, Chen-Yu Tsai wrote:
>> > > > On Sat, Oct 3, 2015 at 10:26 PM, Hans de Goede > > > > >
>> > > > wrote:
>> > > > > Stop prefixing the axp functions for setting voltages, etc. with
>> > > > > the
>> > > > > model number, there ever is only one pmic driver built into u
>> > > > > -boot,
>> > > > > this allows simplifying the callers.
>> > > >
>> > > > Hmm... What's going to happen with the A80, which has 2 PMICs? IIRC
>> > > > a subset of their LDOs share the same name, which would be a
>> > > > problem.
>> > >
>> > > My plan for that is to use a different function name for the ldo-s
>> > > on the secondary pmic, e.g. something like axp2_set_xldo1(...), or
>> > > somesuch. Actually this patch should help adding support for the
>> > > other pmics since it will make it less of an #ifdef fest.
>> >
>> > Is it going to be (or very likely to be) the case that a given AXPxxx
>> > device will only ever be a primary or a secondary,  but never used as
>> > both
>> > (perhaps on different boards)?
>>
>> AFAIK that is correct, there are different axp models for primary / secondary
>> pmics.
>
> OK, that makes sense, but then this:
>
>>  Some a80 / a83 boards may only use the primary pmic, but using only
>> the secondary is not really expected.
>
> ... makes me want to clarify, since I understand that having a secondary
> but not a primary would be rather strange and wasn't what I was getting at.
>
> What I meant was for a given AXPxxx is that model only ever either used as
> a primary _or_ used as a secondary (with some other AXPabc as the primary).
> I think your answer further above is telling me that yes, a given AXPxxx is
> either designed (and used) as a primary or a secondary.

Only the AXP806 is multi-role, i.e. can be primary or secondary. All the
others that we know of, excluding the AXP818 for which we have no docs,
are standalone PMICs.

And a system can also have multiple AXP806s, even on the same bus. This
is supported by some address extension register.

Having said the above, I really don't expect to see these kinds of designs
in the wild.

> From the patch #1 discussion (since it is predicated on the above and
> splitting the conversation in two will probably just get confusing):
>
>> > ... these three ought to be inside a choice?
>>
>> I was thinking the same, but on A80 boards there are 2
>> different axp chips, so if we make this a choice now we
>> just end up needing to revert this when we get full A80 support.
>
> But one of those would be a primary and the other a secondary, and as
> discussed above (as I currently understand it at least) each
> CONFIG_AXPxxx_POWER can be a primary XOR a secondary.
>
> In which case what we would want is a set of choice options for primary and
> a separate set choice options for secondary (with a none option too in this
> case) and there would be no duplication of any specific AXPxxx option
> between both the primary and secondary sets.

AFAIK, all the AXPs except AXP806 belong in the primary list. The secondary
set should only have AXP806, at least until Allwinner delivers some Cortex-A57
or Cortex-A72 design that needs the extra power of a secondary PMIC.

Regards
ChenYu
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] sunxi: power: Unify axp pmic function names

2015-10-03 Thread Chen-Yu Tsai
On Sat, Oct 3, 2015 at 10:26 PM, Hans de Goede  wrote:
> Stop prefixing the axp functions for setting voltages, etc. with the
> model number, there ever is only one pmic driver built into u-boot,
> this allows simplifying the callers.

Hmm... What's going to happen with the A80, which has 2 PMICs? IIRC
a subset of their LDOs share the same name, which would be a problem.

ChenYu

> Signed-off-by: Hans de Goede 
> ---
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] sunxi: power: Unify axp pmic function names

2015-10-03 Thread Hans de Goede

Hi,

On 03-10-15 16:32, Chen-Yu Tsai wrote:

On Sat, Oct 3, 2015 at 10:26 PM, Hans de Goede  wrote:

Stop prefixing the axp functions for setting voltages, etc. with the
model number, there ever is only one pmic driver built into u-boot,
this allows simplifying the callers.


Hmm... What's going to happen with the A80, which has 2 PMICs? IIRC
a subset of their LDOs share the same name, which would be a problem.


My plan for that is to use a different function name for the ldo-s
on the secondary pmic, e.g. something like axp2_set_xldo1(...), or
somesuch. Actually this patch should help adding support for the
other pmics since it will make it less of an #ifdef fest.

Regards,

Hans
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot