[U-Boot-Users] PATCH: Add command support for multiple I2C controllers

Ben Warren bwarren at qstreams.com
Thu May 18 19:04:24 CEST 2006


Dear Wolfgang,

> Can you please  stop  top-posting  and  delete  irrelevant  parts  of
> previous messages? Thanks.
OK

> 
> Yes, me too. But I don't see how adding a new "i2c dev" would disturb
> backward compatibility?
If you'd prefer, I can certainly rename 'ibus' to 'i2c dev', while
keeping everything else intact.
> 

> I'm not convinced that the new sheme will  be  significantly  bigger.
> Yes,  for the transition period (when we support both the old and the
> new sytax) code  will  be  bigger.  But  me  might  even  #ifdef  the
> compatibility calls out....
How about something like:

#ifndef(CONFIG_I2C_COMMAND_TREE)
existing U_BOOT_CMD stuff
#else
new I2C command tree
#endif

> 
> Macros may be evil.
Amen
> 
> > #define I2C_DELIM  /* or something like that */
> > #define CFG_I2C_MULTI_NOPROBES {0x11, 0x22, I2C_DELIM, 0x33, 0x44 ...}
> 
> That doesn't make it more readable. Also, how often are you going  to
> use that macro in your code?
> 
This macro (I forgot to assign a value, by the way) is only used in two
commands - the probing function and the one that changes buses (it moves
a pointer to the correct point in the list).  You'll notice that I have
both compile time and run time checks in place that verify that the list
is properly formed, and hopefully enough comments to show how to create
the list.  I'm very open to alternative suggestions, other than 'no'.
> Best regards,
> 
> Wolfgang Denk
> 
I've spent a fair amount of time writing and testing code that I hope
will benefit others.  I'm afraid if you feel a complete re-write is
necessary, somebody else will have to do it.  On the other hand, if you
feel that this is at least an incremental improvement over the existing
code, and are willing to entertain the notion of adding it to U-boot,
I'll gladly continue.  Please advise.

regards,
Ben





More information about the U-Boot mailing list