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

Fabio Estevam
2014-09-23T15:16:44Z

Hi Marek,

On Tue, Sep 23, 2014 at 8:15 AM, Marek Vasut <marex@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.