[U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-10-22 Thread Heiko Schocher
This Patch introduce the new i2c_core file, which holds the I2C core functions, for the rework of the multibus/ multiadapter support. Also adds changes in i2c.h for the new I2C multibus/multiadapter support. This new support can be activated with the CONFIG_SYS_I2C define. Signed-off-by: Heiko Sch

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-19 Thread Heiko Schocher
Hello Timur, Timur Tabi wrote: > Wolfgang Denk wrote: >> As mentioned before, this is what we currently have as "device model" >> in U-Boot - not only I2C: we have the same "current device" concept >> with IDE, USB, ... > > The difference is that I2C operations are typically done internally by >

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-19 Thread Timur Tabi
Wolfgang Denk wrote: > As mentioned before, this is what we currently have as "device model" > in U-Boot - not only I2C: we have the same "current device" concept > with IDE, USB, ... The difference is that I2C operations are typically done internally by other code, whereas IDE, USB, etc are done

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-19 Thread Simon Glass
Hi Wolfgang, On Thu, Jan 19, 2012 at 3:20 AM, Wolfgang Denk wrote: > Dear Simon Glass, > > In message > you > wrote: >> >> Perhaps reword this slightly. U-Boot can have knowledge of a current >> adaptor, mux settings and so on, and use this internally within the >> i2c layer to optimise perfor

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-19 Thread Simon Glass
Hi Heiko, On Wed, Jan 18, 2012 at 11:53 PM, Heiko Schocher wrote: > Hello Simon, > > Simon Glass wrote: >> Hi Heiko, >> >> On Wed, Jan 18, 2012 at 10:35 PM, Heiko Schocher wrote: >>> Hello Wolfgang, Timur, Simon, >>> >>> Wolfgang Denk wrote: Dear Simon Glass, In message you

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-19 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > Perhaps reword this slightly. U-Boot can have knowledge of a current > adaptor, mux settings and so on, and use this internally within the > i2c layer to optimise performance and redundant i2c traffic. But the > pain is when the concept of a 'current

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-18 Thread Heiko Schocher
Hello Simon, Simon Glass wrote: > Hi Heiko, > > On Wed, Jan 18, 2012 at 10:35 PM, Heiko Schocher wrote: >> Hello Wolfgang, Timur, Simon, >> >> Wolfgang Denk wrote: >>> Dear Simon Glass, >>> >>> In message >>> you >>> wrote: > I was really hoping we could get rid of the concept of a "curre

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-18 Thread Simon Glass
Hi Heiko, On Wed, Jan 18, 2012 at 10:35 PM, Heiko Schocher wrote: > Hello Wolfgang, Timur, Simon, > > Wolfgang Denk wrote: >> Dear Simon Glass, >> >> In message >> you >> wrote: I was really hoping we could get rid of the concept of a "current" i2c adapter, and just force all drivers

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-18 Thread Heiko Schocher
Hello Wolfgang, Timur, Simon, Wolfgang Denk wrote: > Dear Simon Glass, > > In message > you > wrote: >>> I was really hoping we could get rid of the concept of a "current" i2c >>> adapter, and just force all drivers to specify the I2C adapter they >>> want to use for a given I2C operation. =A0

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-18 Thread Wolfgang Denk
Dear Simon Glass, In message you wrote: > > > I was really hoping we could get rid of the concept of a "current" i2c > > adapter, and just force all drivers to specify the I2C adapter they > > want to use for a given I2C operation. =A0That's how Linux operates, and > > it will prevent stuff lik

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-18 Thread Timur Tabi
Simon Glass wrote: > I agree. Do you know of such a patch? :-) No, but it wouldn't be heard to create -- mostly a global search-and-replace. I wouldn't even attempt it without getting pre-approved by Wolfgang first, though. -- Timur Tabi Linux kernel developer at Freescale

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-18 Thread Simon Glass
Hi Timur, On Wed, Jan 18, 2012 at 1:39 PM, Timur Tabi wrote: > Simon Glass wrote: >> I agree completely, it was one of the things I was going to ask for. >> We should add a new parameter to calls instead IMO. > > I would be in favor of a patch that replaces all of the I2C calls.  It > would be a

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-18 Thread Timur Tabi
Simon Glass wrote: > I agree completely, it was one of the things I was going to ask for. > We should add a new parameter to calls instead IMO. I would be in favor of a patch that replaces all of the I2C calls. It would be a massive patch, but it solve a lot of problems in one shot. -- Timur Ta

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-18 Thread Simon Glass
Hi Tabi, On Wed, Jan 18, 2012 at 12:11 PM, Tabi Timur-B04825 wrote: > On Tue, Jan 17, 2012 at 1:12 AM, Simon Glass wrote: >> From: Heiko Schocher >> >> This Patch introduce the new i2c_core file, which holds >> the I2C core functions, for the rework of the multibus/ >> multiadapter support. >>

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-18 Thread Timur Tabi
Mike Frysinger wrote: > that's only needed if you expect the pointer to stay valid across calls. i > don't think it does for most (all?) drivers. True, but it's hard to know sometimes when it's needed. I do it in my code just to be sure. Regardless, I still think the idea of a "current" i2c bu

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-18 Thread Mike Frysinger
On Wednesday 18 January 2012 15:11:56 Tabi Timur-B04825 wrote: > On Tue, Jan 17, 2012 at 1:12 AM, Simon Glass wrote: > > --- a/arch/arm/include/asm/global_data.h > > +++ b/arch/arm/include/asm/global_data.h > > @@ -87,6 +87,9 @@ typedef struct global_data { > >unsigned long post_lo

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-18 Thread Tabi Timur-B04825
On Tue, Jan 17, 2012 at 1:12 AM, Simon Glass wrote: > From: Heiko Schocher > > This Patch introduce the new i2c_core file, which holds > the I2C core functions, for the rework of the multibus/ > multiadapter support. > Also adds changes in i2c.h for the new I2C multibus/multiadapter > support. Th

Re: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-17 Thread Mike Frysinger
On Tuesday 17 January 2012 02:12:23 Simon Glass wrote: > +#if defined(CONFIG_SYS_I2C) > + void*cur_adap; /* current used i2c adapter */ > +#endif let's have "i2c" in the variable name somewhere. "curr_i2c" ? > --- /dev/null > +++ b/drivers/i2c/i2c_core.c > > +#ifdef CONFIG_T

[U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support

2012-01-16 Thread Simon Glass
From: Heiko Schocher This Patch introduce the new i2c_core file, which holds the I2C core functions, for the rework of the multibus/ multiadapter support. Also adds changes in i2c.h for the new I2C multibus/multiadapter support. This new support can be activated with the CONFIG_SYS_I2C define. S