[U-Boot] [PATCH 1/3] misc:pmic New generic pmic driver

stefano babic sbabic at denx.de
Sun Oct 2 18:12:07 CEST 2011


Am 26/09/2011 17:10, schrieb Lukasz Majewski:
> This commit adds new PMIC core driver.
> 
> PMIC IC devices connected via I2C or SPI can be used.
> Separate files: pmic_i2c.c and pmic_spi.c are responsible
> for handling transmission specific files for I2C or SPI busses.
> 
> pmic_fsl.c and pmic_max8998.c are PMIC specific files. They define
> pmic_init() method for early init.
> 
> New flags added:
> CONFIG_PMIC - enable PMIC general device.
> CONFIG_PMIC_I2C/SPI - specify the interface to be used.
> CONFIG_PMIC_MAX8998/FSL - add routines specific for PMIC chip.
> 
> 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>

Hi Lukasz,

> +
> +		if (!(i % 8))
> +			printf("\n0x%02x: ", i);
> +
> +		printf("%08x ", val);
> +	}
> +	puts("\n");
> +}
> +
> +

Drop the second newline-


> +int pmic_init(void)
> +{
> +	struct pmic *p = get_pmic();
> +	static const char name[] = "FSL_PMIC";
> +
> +	puts("Board PMIC init\n");

This contains no info - you can drop or replace puts with debug().

> +	p->hw.spi.bitlen = CONFIG_FSL_PMIC_BITLEN;
> +	p->hw.spi.flags = SPI_XFER_BEGIN | SPI_XFER_END;
> +	p->hw.spi.prepare_tx = pmic_spi_prepare_tx;
> +
> +	return 0;
> +}

Ok - I do not know if CONFIG_FSL_PMIC_BITLEN is really needed, but we
can leave it.



> +int pmic_probe(struct pmic *p)
> +{
> +	i2c_set_bus_num(p->bus);
> +	printf("PMIC:%s probed!\n", p->name);

Probably this comes from your testing - you can drop it or use debug()

> +	if (i2c_probe(pmic_i2c_addr)) {
> +		puts("Can't find max8998\n");

...and we have not always a max8998 !

> +int pmic_init(void)
> +{
> +	struct pmic *p = get_pmic();
> +	static const char name[] = "MAX8998_PMIC";
> +
> +	puts("Board PMIC init\n");

Replace with debug()

> diff --git a/drivers/misc/pmic_spi.c b/drivers/misc/pmic_spi.c
> diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
> index 7d05dc8..bbc54f0 100644
> --- a/include/configs/mx51evk.h
> +++ b/include/configs/mx51evk.h

You can leave away the MX boards (and we have to change all of them or
none of them - there are also MX3 boards that can use the new code).

>   * MMC Configs
> diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
> index 886c8be..aa51114 100644

Put changes to board configuration in a separate patch.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the U-Boot mailing list