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

Masahiro Yamada
2014-11-18T12:32:42Z

Hi Simon,

On Tue, 11 Nov 2014 10:46:24 -0700
Simon Glass <sjg@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@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