From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Date: Mon, 17 Sep 2012 22:57:40 +0200 Subject: [U-Boot] [PATCH 10/16] pmic:max8997: Function for calculating LDO internal register value In-Reply-To: <20120914172449.GC22028@bill-the-cat> References: <1347637215-4830-1-git-send-email-l.majewski@samsung.com> <1347637215-4830-11-git-send-email-l.majewski@samsung.com> <20120914172449.GC22028@bill-the-cat> Message-ID: <20120917225740.42b3a7d8@jawa> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 14 Sep 2012 10:24:49 -0700 Tom Rini 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 > > Signed-off-by: Kyungmin Park > > Cc: Stefano Babic > > --- > > 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