From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 24 Jun 2012 22:08:51 +0200 Subject: [U-Boot] [PATCH 16/24] mxc_i2c: prep work for multiple busses support In-Reply-To: <4FE6D413.60201@denx.de> References: <1340338339-11626-1-git-send-email-troy.kisky@boundarydevices.com> <1340338339-11626-16-git-send-email-troy.kisky@boundarydevices.com> <4FE6D413.60201@denx.de> Message-ID: <201206242208.51305.marek.vasut@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Heiko Schocher, > Hello Troy, > > On 22.06.2012 06:12, Troy Kisky wrote: > > Signed-off-by: Troy Kisky > > --- > > > > drivers/i2c/mxc_i2c.c | 121 > > ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 100 > > insertions(+), 21 deletions(-) > > > > diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c > > index cb061f7..ec05798 100644 > > --- a/drivers/i2c/mxc_i2c.c > > +++ b/drivers/i2c/mxc_i2c.c > > [...] > > > @@ -359,10 +351,97 @@ int i2c_write(uchar chip, uint addr, int alen, > > uchar *buf, int len) > > > > return ret; > > > > } > > > > +typedef void (*toggle_i2c_fn)(void *p); > > + > > +#ifdef CONFIG_I2C_MULTI_BUS > > +static unsigned g_bus; > > This is only valid after relocation ... and i2c is maybe used before > relocation. > > Try something (not tested) like that: > > static unsigned int __attribute__((section (".data"))) g_bus = 0; This is a good knowledge to have, adding it amongst important emails :) > > > +#else > > +#define g_bus 0 > > +#endif > > + > > +struct i2c_parms { > > + void *base; > > + void *toggle_data; > > + toggle_i2c_fn toggle_fn; > > For what is this toggle_* needed? > > bye, > Heiko Best regards, Marek Vasut