[U-Boot] [PATCH] i2c: mxs: Add I2C multibus support

Fabio Estevam festevam at gmail.com
Tue Sep 23 17:16:44 CEST 2014


Hi Marek,

On Tue, Sep 23, 2014 at 8:15 AM, Marek Vasut <marex at denx.de> wrote:

> -void i2c_init(int speed, int slaveadd)
> +int i2c_set_bus_num(unsigned int bus)
>  {
> +       uint32_t mxs_i2c_regs;
> +
> +       switch (bus) {
> +       case 0:
> +               mxs_i2c_regs = MXS_I2C0_BASE;
> +               break;
> +#ifdef CONFIG_MX28
> +       case 1:
> +               mxs_i2c_regs = MXS_I2C1_BASE;
> +               break;
> +#endif
> +       default:
> +               printf("Bad bus: %d\n", bus);

Something like "Invalid I2C bus" would be a clearer error message here.


More information about the U-Boot mailing list