[U-Boot] [PATCH v2 08/17] dm: i2c: Add a uclass for I2C

Masahiro Yamada yamada.m at jp.panasonic.com
Tue Nov 18 13:32:42 CET 2014


Hi Simon,


On Tue, 11 Nov 2014 10:46:24 -0700
Simon Glass <sjg at chromium.org> wrote:

> The uclass implements the same operations as the current I2C framework but
> makes some changes to make it fit driver model better:
> 
> - Remove the chip address from API calls
> - Remove the address length from API calls
> - Remove concept of 'current' I2C bus
> - Drop all existing init functions
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 

> +static int i2c_post_probe(struct udevice *dev)
> +{
> +	struct dm_i2c_bus *i2c = dev->uclass_priv;
> +
> +	i2c->speed_hz = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
> +				     "clock-frequency", 100000);
> +
> +	return i2c_set_bus_speed(dev, i2c->speed_hz);
> +}

This code in drivers/i2c/i2c-uclass.c seems to highly depends on Device Tree.

I am not sure if I understood correctly, but
does this work on non Device Tree SoCs?





Best Regards
Masahiro Yamada



More information about the U-Boot mailing list