[U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

Mike Frysinger vapier at gentoo.org
Tue Jan 17 20:23:04 CET 2012


On Tuesday 17 January 2012 02:12:23 Simon Glass wrote:
> +#if defined(CONFIG_SYS_I2C)
> +	void		*cur_adap;	/* current used i2c adapter */
> +#endif

let's have "i2c" in the variable name somewhere.  "curr_i2c" ?

> --- /dev/null
> +++ b/drivers/i2c/i2c_core.c
>
> +#ifdef CONFIG_TEGRA2_I2C
> +extern struct i2c_adapter tegra_i2c_adap[];
> +#endif

i feel like if your initial run includes i2c bus specific defines, the end 
result is a failure

> +struct i2c_adapter *i2c_adap[CONFIG_SYS_NUM_I2C_ADAPTERS] =
> +			CONFIG_SYS_I2C_ADAPTERS;
> +#ifndef CONFIG_SYS_I2C_DIRECT_BUS
> +struct i2c_bus	i2c_bus[CONFIG_SYS_NUM_I2C_BUSSES] = CONFIG_SYS_I2C_BUSSES;
> +#endif

the nand layer is moving away from this style ...

> + * mux_id is the multiplexer chip type from defined in i2c.h. So far only
> + * NXP (Philips) PCA954x multiplexers are supported. Switches are NOT
> + * supported (anybody uses them?)

does part-specific stuff belong in the core ?  seems like it should be in a 
part-specific driver ...

> +int i2c_probe(u_int8_t chip)

use uintx_t types.  the u_intx_t types are deprecated.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120117/35443437/attachment.pgp>


More information about the U-Boot mailing list