From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Fri, 20 Feb 2009 08:06:55 +0100 Subject: [U-Boot] [PATCH] 7/12 Multiadapter/multibus I2C, drivers part 4 In-Reply-To: References: <499548C2.7060305@denx.de> <49967FAC.6090905@denx.de> <20090216221151.08966832E893@gemini.denx.de> <20090217224940.02BC6832E893@gemini.denx.de> <20090218001322.4A43C832E893@gemini.denx.de> <499BBD25.4070907@denx.de> <20090218182625.22E71832E43F@gemini.denx.de> <20090218220935.13639832E43F@gemini.denx.de> <499D118E.4070404@denx.de> Message-ID: <499E568F.4010602@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello ksi, ksi at koi8.net wrote: > On Thu, 19 Feb 2009, Heiko Schocher wrote: >> ksi at koi8.net wrote: >>> On Wed, 18 Feb 2009, Wolfgang Denk wrote: >>>> In message you wrote: [...] >>> I'm open to any alternative possibilities but I can not see anything better. >>> That _EXISTING_ soft_i2c.c we have in the current tree is a little miracle >>> that was there since the start of times so I can't see any reason to throw >>> it away and reinvent the wheel. >> Nobody wants to throw it away! > > You want... No, we don;t want to throw away soft-i2c.c and make it new. Nobody said this. We just discus your multibus support for it. >>>>> The former does not require additional adapter struct member, hwadap_no. >>>>> And, unlike the latter, it is self-contained, it doesn't require any >>>>> external global variable to decide what to do. One can initialize all >>>>> adapters by: >>>>> >>>>> for (i = 0; i < NUM_I2C_ADAPTERS; i++) >>>>> i2c_adap[i]->init(...); >>>> Most probably we never *want* to initialize all adapters... >>> It is easier that way and wouldn't do any harm in most cases... >> But it is not needed when doing this in i2c_set_bus_num() !! >> It is sufficent to init a hardwareadapter, when switching to it. > > That means you'll have to rewrite the entire U-Boot. 99% of the boards have > only one bus so they did not switch busses. That means they never called > that i2c_set_bus_num() relying on i2c_init() in libxxx/board.c instead. But we can call i2c_set_bus_num instead of i2c_init() right? > Sorry guys, I do not have THAT much free time that my employer would let me > to spend on this. Hey, this is "my" free time. I don;t get money for this discussion. bye Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany