public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH]fsl_i2c: Add i2c_board_late_init
Date: Mon, 12 Apr 2010 21:28:11 +0200	[thread overview]
Message-ID: <20100412192811.99C9019F60@gemini.denx.de> (raw)
In-Reply-To: <20100412191703.GA30835@richardretanubun.eng.lan>

Dear richardretanubun at ruggedcom.com,

In message <20100412191703.GA30835@richardretanubun.eng.lan> you wrote:
> From d0d9e0df99ce9035db43ebcf9d48601fa6f096d4 Mon Sep 17 00:00:00 2001
> From: Richard Retanubun <RichardRetanubun@RuggedCom.com>
> Date: Mon, 12 Apr 2010 15:08:17 -0400
> Subject: [PATCH] fsl_i2c: Added a callpoint for i2c_board_late_init
> 
> This patch adds a callpoint in i2c_init that allows board specific
> i2c board initialization (typically for i2c bus reset) that is called
> after i2c_init operations, allowing the i2c_board_late_init function
> to use the pre-configured i2c bus speed and slave address.
> ---
> 
> Hi Wolfgang & Heiko,
> 
> This is the patch that adds another callpoint. Thanks for
> all the feedback.
> 
> - Richard
> 
>  drivers/i2c/fsl_i2c.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
> index 2241990..a1a62fa 100644
> --- a/drivers/i2c/fsl_i2c.c
> +++ b/drivers/i2c/fsl_i2c.c
> @@ -249,6 +249,14 @@ i2c_init(int speed, int slaveadd)
>  	writeb(0x0, &dev->sr);			/* clear status register */
>  	writeb(I2C_CR_MEN, &dev->cr);		/* start I2C controller */
>  #endif
> +
> +#ifdef CONFIG_SYS_I2C_BOARD_LATE_INIT
> +	/* Call board specific i2c bus reset routine after the bus has been   */
> +	/* initialized. Use either this callpoint or i2c_init_board; which is */
> +	/* called before i2c_init operations.                                 */
> +	/* For details about this problem see doc/I2C_Edge_Conditions.        */
> +	i2c_board_late_init();
> +#endif

Incorrect multiline comment style.

Instead of adding more #ifdef'ery we now tend to use weak symbols -
but I'm not sure about this here in this context, though. Heiko, what
do you think about this?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There's an old proverb that says just about whatever you want it to.

  reply	other threads:[~2010-04-12 19:28 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
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 [this message]
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=20100412192811.99C9019F60@gemini.denx.de \
    --to=wd@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