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 capnjgz1royguaascoqiw8poqkzvp5rim7kj6zzhlnpwubyk...@mail.gmail.com 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

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 h...@denx.de wrote: Hello Simon, Simon Glass wrote: Hi Heiko, On Wed, Jan 18, 2012 at 10:35 PM, Heiko Schocher h...@denx.de wrote: Hello Wolfgang, Timur, Simon, Wolfgang Denk wrote: Dear Simon Glass, In message

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 w...@denx.de wrote: Dear Simon Glass, In message capnjgz1royguaascoqiw8poqkzvp5rim7kj6zzhlnpwubyk...@mail.gmail.com you wrote: Perhaps reword this slightly. U-Boot can have knowledge of a current adaptor, mux settings and so

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 by the

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 other code,

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 s...@chromium.org wrote: From: Heiko Schocher h...@denx.de 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

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_log_res;

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 bus

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 b04...@freescale.com wrote: On Tue, Jan 17, 2012 at 1:12 AM, Simon Glass s...@chromium.org wrote: From: Heiko Schocher h...@denx.de This Patch introduce the new i2c_core file, which holds the I2C core functions, for the rework of

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

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 ti...@freescale.com 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

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 Wolfgang Denk
Dear Simon Glass, In message capnjgz2klpfmzzwghkdj4el+wixqlv89+cvdvp7pccy+xfa...@mail.gmail.com 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.

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 capnjgz2klpfmzzwghkdj4el+wixqlv89+cvdvp7pccy+xfa...@mail.gmail.com 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

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 h...@denx.de wrote: Hello Wolfgang, Timur, Simon, Wolfgang Denk wrote: Dear Simon Glass, In message capnjgz2klpfmzzwghkdj4el+wixqlv89+cvdvp7pccy+xfa...@mail.gmail.com you wrote: I was really hoping we could get rid of the

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 h...@denx.de wrote: Hello Wolfgang, Timur, Simon, Wolfgang Denk wrote: Dear Simon Glass, In message capnjgz2klpfmzzwghkdj4el+wixqlv89+cvdvp7pccy+xfa...@mail.gmail.com you wrote: I was really

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_TEGRA2_I2C