On Fri, Aug 22, 2014 at 07:47:36PM -0600, Simon Glass wrote: > Hi Thierry, > > On 22 August 2014 16:03, Thierry Reding <[email protected]> wrote: > > On Fri, Aug 22, 2014 at 02:12:19PM -0600, Simon Glass wrote: > >> On 22 August 2014 13:40, Thierry Reding <[email protected]> wrote: > > [...] > >> > I've opted instead to provide an somewhat higher-level API that users > >> > can call to set voltages on the regulators and enable them. > >> > >> But then this should use/extend the pmic interface I think, and not > >> create a parallel one. > > > > It's not a parallel framework. And it's not anything out of the ordinary > > either. There's a whole bunch of drivers in drivers/power that do the > > very same thing. > > > > And I'm not sure something like Linux' regulator framework is something > > that we really need in U-Boot. The code in question is usually run in > > some board-specific initialization file, not from some generic driver > > that would need to be used in conjunction with potentially very many > > PMICs. > > OK, well I suggest first take a look at pmic_tps65090.c and convince > yourself that you can't plumb your pmic in in a similar way. It's up > to you.
It's very similar to that driver except that it doesn't go through the
trouble of "registering" the PMIC. Instead it works roughly like this:
struct as3722_pmic *pmic;
err = as3722_init(&pmic, fdt);
if (err < 0)
return err;
err = as3722_sd_set_voltage(pmic, ...);
if (err < 0)
return err;
err = as3722_sd_enable(pmic, ...);
if (err < 0)
return err;
That saves the public API from having to repeatedly go and look up the
PMIC in the registry.
Thierry
pgpDtahx7Fuz5.pgp
Description: PGP signature
_______________________________________________ U-Boot mailing list [email protected] http://lists.denx.de/mailman/listinfo/u-boot

