[U-Boot-Users] PATCH: Add command support for second I2Ccontroller
bwarren at qstreams.com
Tue May 16 18:58:54 CEST 2006
One sticky part is, how do we deal with the 'CFG_I2C_NOPROBE' stuff?
This is a list defined for each board of chips that the 'iprobe' command
should bypass. The current implementation has this list instantiated as
a static array within 'cmd_i2c.c', and is of course relevant only to the
first bus. As we add buses, it gets ugly. How about defining a
structure that includes all bus information:
typedef struct _i2c_bus
... /* whatever else might be useful */
On the other hand, maybe the NOPROBE list is rarely used and we
shouldn't be worrying too much about it.
On Tue, 2006-05-16 at 10:43 -0500, Menon, Nishanth wrote:
> > This approach sounds good. The only down-side that I can see is that
> > the driver needs to keep track of context. Personally, I prefer
> Yes and no, yes- if the driver has multiple busses to support, and no-
> if they don't have multiple busses to support.
> > In order to do this properly, we should add to the base API in
> > include/i2c.h something like:
> > void i2c_set_bus(uchar dev);
> > uchar i2c_get_bus(void);
> > void i2c_set_bus_speed(int speed);
> > int i2c_get_bus_speed(void);
> > or merge the index and speed as you have in your code.
> For controllers allowing me to switch between standard/full speed/HS
> mode or standard/fullspeed: Two commands to run
> For controllers having a single speed:
> One command..
> Interesting call.. Being biased towards my platform I'd suggest merged
> code.. but I leave it to the common wisdom to decide :)
> > The drivers can then either choose to implement or not implement this
> > feature, and we can add a parallel command tree based on 'i2c' as
> > Wolfgang has suggested.
> Don't know if a parallel cmd tree is required, as far as I see, it is an
> additional command to extend the reach of i2c driver, and since the
> changes wont affect other drivers, I hope it can be patched in to the
> mainline tree..
> Nishanth Menon
More information about the U-Boot