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

Heiko Schocher
2014-09-24T05:19:08Z

Hello Fabio,

Am 23.09.2014 17:16, schrieb Fabio Estevam:
> 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.

If Marek convert this driver to the CONFIG_SYS_I2C framework, he can
drop this function complete ...

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany