All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd_i2c.c: added i2c read to memory function
Date: Thu, 25 Feb 2010 09:03:25 +0100	[thread overview]
Message-ID: <4B862ECD.7020707@denx.de> (raw)
In-Reply-To: <1267037733-3375-5-git-send-email-fransmeulenbroeks@gmail.com>

Hello Frans,

Frans Meulenbroeks wrote:
> Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
> ---
>  common/cmd_i2c.c |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 60 insertions(+), 0 deletions(-)
> 
> diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
> index 1dd4df3..552b4e5 100644
> --- a/common/cmd_i2c.c
> +++ b/common/cmd_i2c.c
> @@ -154,6 +154,64 @@ int i2c_set_bus_speed(unsigned int)
[...]
> +	/*
> +	 * memaddr is the address where to store things in memory
> +	 */
> +	memaddr = (u_char *)simple_strtoul(argv[4], NULL, 16);
> +
> +	if (i2c_read(chip, devaddr, alen, memaddr, length) != 0)
> +	{

as Wolfgang suggested to your first post, incorrect brace style,
please fix.

> +		puts ("Error reading the chip.\n");
> +		return 1;
> +	}
> +	return 0;
> +}
> +
>  int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
>  {
>  	u_char	chip;
> @@ -1272,6 +1330,7 @@ static cmd_tbl_t cmd_i2c_sub[] = {
>  	U_BOOT_CMD_MKENT(mw, 3, 1, do_i2c_mw, "", ""),
>  	U_BOOT_CMD_MKENT(nm, 2, 1, do_i2c_nm, "", ""),
>  	U_BOOT_CMD_MKENT(probe, 0, 1, do_i2c_probe, "", ""),
> +	U_BOOT_CMD_MKENT(read, 5, 1, do_i2c_read, "", ""),
>  	U_BOOT_CMD_MKENT(reset, 0, 1, do_i2c_reset, "", ""),
>  #if defined(CONFIG_CMD_SDRAM)
>  	U_BOOT_CMD_MKENT(sdram, 1, 1, do_i2c_sdram, "", ""),
> @@ -1316,6 +1375,7 @@ U_BOOT_CMD(
>  	"i2c nm chip address[.0, .1, .2] - write to I2C device (constant address)\n"
>  	"i2c crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n"
>  	"i2c probe - show devices on the I2C bus\n"
> +	"i2c read chip address[.0, .1, .2] length memaddress - read to memory \n"
>  	"i2c reset - re-init the I2C Controller\n"
>  #if defined(CONFIG_CMD_SDRAM)
>  	"i2c sdram chip - print SDRAM configuration information\n"

Rest looks good, 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-02-25  8:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24 18:55 [U-Boot] [PATCH] cmd_i2c.c: reduced subaddress length to 3 bytes Frans Meulenbroeks
2010-02-24 18:55 ` [U-Boot] [PATCH] cmd_bootm.c: made subcommand array static Frans Meulenbroeks
2010-02-24 18:55   ` [U-Boot] [PATCH] cmd_i2c.c: reworked subcommand handling Frans Meulenbroeks
2010-02-24 18:55     ` [U-Boot] [PATCH] cmd_i2c.c: sorted commands alphabetically Frans Meulenbroeks
2010-02-24 18:55       ` [U-Boot] [PATCH] cmd_i2c.c: added i2c read to memory function Frans Meulenbroeks
2010-02-25  8:03         ` Heiko Schocher [this message]
2010-02-25  8:02       ` [U-Boot] [PATCH] cmd_i2c.c: sorted commands alphabetically Heiko Schocher

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=4B862ECD.7020707@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.