From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Wed, 18 Jan 2012 15:41:41 -0500 Subject: [U-Boot] [PATCH 1/3] i2c: add i2c_core and prepare for new multibus support In-Reply-To: References: <1326784345-19953-1-git-send-email-sjg@chromium.org> <1326784345-19953-2-git-send-email-sjg@chromium.org> Message-ID: <201201181541.42710.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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; /* success of POST test */ > > unsigned long post_init_f_time; /* When post_init_f started */ > > #endif > > +#if defined(CONFIG_SYS_I2C) > > + void *cur_adap; /* current used i2c adapter */ > > +#endif > > 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. That's how Linux operates, and > it will prevent stuff like this: > > void *old; > void *new; > > old = get_current_i2c_adapter(); > set_i2c_adapter(new); > // do I2C stuff > set_i2c_adapter(old); that's only needed if you expect the pointer to stay valid across calls. i don't think it does for most (all?) drivers. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. URL: