<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.8.1">
</HEAD>
<BODY>
Wolfgang,<BR>
<BR>
This sounds like a sensible approach. This should clean the code up nicely (as you'll notice, the patch that I submitted yesterday adds quite a bit of noisy code). Let's look at what Richard Woodruff submits, and we can take it from there.<BR>
<BR>
Too bad I didn't get your input until this morning, even though your message went out on Friday...<BR>
<BR>
regards,<BR>
Ben<BR>
<BR>
On Fri, 2006-05-12 at 21:01 +0200, Wolfgang Denk wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hello,</FONT>
<FONT COLOR="#000000">in message <<A HREF="mailto:E541A453-EC07-4597-8D60-2EE3919C1A18@kernel.crashing.org">E541A453-EC07-4597-8D60-2EE3919C1A18@kernel.crashing.org</A>> you wrote:</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> > The CPU I'm using (MPC8349) has two hardware I2C interfaces, and </FONT>
<FONT COLOR="#000000">> > I'd like to access the second one in U-boot. Implementing this </FONT>
<FONT COLOR="#000000">> > looks easy to me, but I don't want to reinvent the wheel if it's </FONT>
<FONT COLOR="#000000">> > already been done elsewhere. Has anyone done this? If not, I'll </FONT>
<FONT COLOR="#000000">> > follow up with a proposal.</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Depending on what you want to do, you can cheat and just change the </FONT>
<FONT COLOR="#000000">> pointer to the 2nd interface. If you want something more full </FONT>
<FONT COLOR="#000000">> featured up to the command level then I think some discussion would </FONT>
<FONT COLOR="#000000">> be required on how the commands should work for specifying which </FONT>
<FONT COLOR="#000000">> controller to use.</FONT>
<FONT COLOR="#000000">A clean design should allow to switch I2C busses usign a command;</FONT>
<FONT COLOR="#000000">additionally, I think we should try to stay backward-compatible with</FONT>
<FONT COLOR="#000000">the existing code. Eventually this is not too difficult: similar to</FONT>
<FONT COLOR="#000000">the "ide" or "usb" commands we could create a new command "i2c</FONT>
<FONT COLOR="#000000">device" which takes as argument the number of the I2C bus which shal</FONT>
<FONT COLOR="#000000">become the current (= active) bus. Then all existing I2C related</FONT>
<FONT COLOR="#000000">commands can be left unchanged (and "i2c device" without arguments</FONT>
<FONT COLOR="#000000">should of course print the ID of the current bus).</FONT>
<FONT COLOR="#000000">In parallel, existing I2C commands could be changed to migrate to a</FONT>
<FONT COLOR="#000000">new "i2c" group of commands: "imd" would become "i2c md", "imw"</FONT>
<FONT COLOR="#000000">becomes "i2c mw", "iprobe" becomes "i2c probe", etc. For some (long)</FONT>
<FONT COLOR="#000000">transition period old and new commands could be provided in parallel</FONT>
<FONT COLOR="#000000">(at least optionally). Later, the old syntax could be dropped.</FONT>
<FONT COLOR="#000000">Best regards,</FONT>
<FONT COLOR="#000000">Wolfgang Denk</FONT>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>