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

Tom Rini trini at ti.com
Fri Sep 14 19:24:49 CEST 2012


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 at samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
> Cc: Stefano Babic <sbabic at 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.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120914/a9a5251a/attachment.pgp>


More information about the U-Boot mailing list