From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Wed, 11 Jan 2012 07:52:41 +0100 Subject: [U-Boot] [RFC] [PATCH] DaVinci/i2c: allow multiple buses In-Reply-To: References: <20111222003652.69df8888@zougloub.eu> Message-ID: <4F0D31B9.6040305@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 Tom, J?r?me, Sorry for the late reply, but I just starting to look through my backlog, after my vacation ... Tom Rini wrote: > On Wed, Dec 21, 2011 at 10:36 PM, J?r?me Carretero wrote: >> Hi Tom, >> >> I'm requesting comments on the following (untested) patch. >> It adds support for multiple i2c buses on davinci_i2c, without altering one line of code. >> What I don't like is that I'm doing a bit of macro black magic to transform constants into variables. >> But I don't know whether refactoring the code would be accepted, so this is a first shot. > > So, this follows the example of other i2c drivers, but as Wolfgang > likes to point out, following another bad example isn't a valid reason > to do something. So, is this the right way or a bad example to > follow, Wolfgang or Heiko? Thanks! Yes, that is the actual (not really nice) state to implement the "multibus" feature for i2c. The better way would be to go this way: http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=shortlog;h=refs/heads/multibus_v2_20111112 but this branch is not up to date, some test on at last powerpc and arm architectures should be done, and there are a lof of checkpatch errors in this branch (any help is welcome ;-) ... so there is some work to do, before this can go to mainline ... bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany