public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] Moving i2c_board_init to after i2c_init operations
Date: Mon, 12 Apr 2010 08:11:49 +0200	[thread overview]
Message-ID: <4BC2B9A5.70001@denx.de> (raw)
In-Reply-To: <4BBF6266.8040508@RuggedCom.com>

Hello Richard,

Richard Retanubun wrote:
> I am trying to do something similar to what you did in this commit:
> 
> http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=commit;h=39df00d9aecfb465b9eec9af593f9b763fb5209a
> 
> 
> and I have a question, must i2c_board_init for fsl_i2c.c be called before
> the actual controller initialization? (i.e. setting the bus speed and
> the controller's slave address)
> 
> if we call it at the end of i2c_init, we can take advantage of the
> setups done before, no?

Yes, you are right.

> Most of the other implementation does it in the beginning because they
> can change the
> i2c pins to GPIO and 'bit-bang' the reset pattern, and then change it
> back to i2c pins.

Yep.

> The alternative is of course to assume nothing in i2c_board_init, and
> configure everything
> (I kinda liked to use set_i2c_bus_speed, rather than hardcoding something).
> 
> Since the kmeter1 board is the only user of i2c_board_init in fsl_i2c.c,
> would you be
> opposed if I submit a patch that moves the call for i2c_board_init to
> the end of i2c_init?

No, this is OK, and looks cleaner to me. Thanks!

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2010-04-12  6:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 17:22 [U-Boot] Moving i2c_board_init to after i2c_init operations Richard Retanubun
2010-04-12  6:11 ` Heiko Schocher [this message]
2010-04-12 18:02   ` [U-Boot] [PATCH]fsl_i2c: Move " richardretanubun at ruggedcom.com
2010-04-12 18:17     ` Wolfgang Denk
2010-04-12 18:22       ` Richard Retanubun
2010-04-12 18:38         ` Wolfgang Denk
2010-04-12 19:17           ` [U-Boot] [PATCH]fsl_i2c: Add i2c_board_late_init richardretanubun at ruggedcom.com
2010-04-12 19:28             ` Wolfgang Denk
2010-04-14  7:02               ` Heiko Schocher
2010-04-14 15:48                 ` [U-Boot] [PATCH v3]fsl_i2c: " richardretanubun at ruggedcom.com
2010-04-12 19:32             ` [U-Boot] [PATCH v2]fsl_i2c: " richardretanubun at ruggedcom.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BC2B9A5.70001@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox