public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 6/8] fsl_pmic: add I2C interface support
Date: Thu, 30 Dec 2010 17:49:06 +0100	[thread overview]
Message-ID: <4D1CB802.6060202@denx.de> (raw)
In-Reply-To: <1293626331-18644-9-git-send-email-r64343@freescale.com>

On 12/29/2010 01:38 PM, Jason Liu wrote:
> This patch add I2C interface for fsl_pmic driver support
> 
> Signed-off-by: Jason Liu <r64343@freescale.com>
> 
> ---
> Changes for v2:
> - Address the comments from Stefano,
>   - factor out the param_check in pmic_reg for both spi/i2c
> ---
>  drivers/misc/fsl_pmic.c |   52 ++++++++++++++++++++++++++++++++++++++++++----
>  1 files changed, 47 insertions(+), 5 deletions(-)
> 

Hi Jason,

> +
> +	if (init_done == 0) {
> +		i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
> +		init_done = 1;
> +	}

As I can see, i2c_init is called during initialization in
arch/arm/lib/board.c. Why do we need to call it again ?

> +	if (write) {
> +		buf[0] = (val >> 16) & 0xff;
> +		buf[1] = (val >> 8) & 0xff;
> +		buf[2] = (val) & 0xff;
> +		if (i2c_write(CONFIG_SYS_FSL_PMIC_I2C_ADDR, reg, 1, buf, 3))
> +			return -1;
> +	} else {
> +		if (i2c_read(CONFIG_SYS_FSL_PMIC_I2C_ADDR, reg, 1, buf, 3)) {
> +			return -1;
> +		ret_val = buf[0] << 16 | buf[1] << 8 | buf[2];
> +		}

I am wondering if it works. The line with ret_val is never reached. Do
you tested it ?

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

  reply	other threads:[~2010-12-30 16:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-29 12:38 [U-Boot] [PATCH v3 1/3] fsl_pmic: add I2C interface support Jason Liu
2010-12-29 12:38 ` [U-Boot] [PATCH v3 1/8] MX5: Add initial support for MX53 processor Jason Liu
2010-12-30 12:09   ` Stefano Babic
2010-12-31  3:00     ` Jason Liu
2010-12-29 12:38 ` [U-Boot] [PATCH v3 2/8] fec_mxc: add " Jason Liu
2010-12-29 12:38 ` [U-Boot] [PATCH v3 2/3] imximage: Add MX53 boot image support Jason Liu
2010-12-29 12:49   ` Jason Liu
2010-12-29 12:38 ` [U-Boot] [PATCH v3 3/3] MX5:MX53: add initial support for MX53EVK board Jason Liu
2010-12-29 12:48   ` Jason Liu
2010-12-30 11:51   ` Stefano Babic
2010-12-31  2:57     ` Jason Liu
2010-12-29 12:38 ` [U-Boot] [PATCH v3 3/8] serial_mxc: add support for MX53 processor Jason Liu
2010-12-29 12:38 ` [U-Boot] [PATCH v3 4/8] mxc_gpio: " Jason Liu
2010-12-29 12:38 ` [U-Boot] [PATCH v3 5/8] mxc_i2c: " Jason Liu
2010-12-29 12:38 ` [U-Boot] [PATCH v3 6/8] fsl_pmic: add I2C interface support Jason Liu
2010-12-30 16:49   ` Stefano Babic [this message]
2010-12-31  3:54     ` Jason Liu
2010-12-29 12:47 ` [U-Boot] [PATCH v3 1/3] " Jason Liu

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=4D1CB802.6060202@denx.de \
    --to=sbabic@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