[U-Boot] [PATCH 10/16] pmic:max8997: Function for calculating LDO internal register value

Lukasz Majewski
2012-09-17T20:57:40Z

On Fri, 14 Sep 2012 10:24:49 -0700
Tom Rini <trini@ti.com> wrote:

> On Fri, Sep 14, 2012 at 05:40:09PM +0200, Lukasz Majewski wrote:
>
> > Function for calculating LDO internal register value from passed
> > micro Volt.
> >
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > Cc: Stefano Babic <sbabic@denx.de>
> > ---
> > drivers/misc/pmic_max8997.c | 17 +++++++++++++++++
> > 1 files changed, 17 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/misc/pmic_max8997.c
> > b/drivers/misc/pmic_max8997.c index 4e8283a..a4158e2 100644
> > --- a/drivers/misc/pmic_max8997.c
> > +++ b/drivers/misc/pmic_max8997.c
> > @@ -42,3 +42,20 @@ int pmic_init(unsigned char bus)
> >
> > return 0;
> > }
> > +
> > +unsigned char max8997_reg_ldo(int uV)
> > +{
> > + unsigned char ret;
> > + if (uV <= 800000)
> > + return 0;
> > + if (uV >= 3950000)
> > + return 0x3f;
> > + ret = (uV - 800000) / 50000;
> > + if (ret > 0x3f) {
> > + printf("MAX8997 LDO SETTING ERROR (%duV) -> %u\n",
> > uV, ret);
> > + ret = 0x3f;
> > + }
>
> Can we get a comment to point at the doc that says what these values
> are? Maybe even a #define for the return values.
>

Yes, explanation will be provided.

Regards,
Lukasz Majewski