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] i2c: add i2c reset command.
Date: Mon, 29 Sep 2008 09:52:45 +0200	[thread overview]
Message-ID: <48E0894D.2010101@denx.de> (raw)

Signed-off-by: Heiko Schocher <hs@denx.de>
---
 common/cmd_i2c.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index ef3928e..414c888 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -1182,6 +1182,12 @@ int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 #endif

 #if defined(CONFIG_I2C_CMD_TREE)
+int do_i2c_res(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+	i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE);
+	return 0;
+}
+
 #if defined(CONFIG_I2C_MULTI_BUS)
 int do_i2c_bus_num(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 {
@@ -1240,6 +1246,8 @@ int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
 		return do_i2c_probe(cmdtp, flag, --argc, ++argv);
 	if (!strncmp(argv[1], "lo", 2))
 		return do_i2c_loop(cmdtp, flag, --argc, ++argv);
+	if (!strncmp(argv[1], "re", 2))
+		return do_i2c_res(cmdtp, flag, --argc, ++argv);
 #if defined(CONFIG_CMD_SDRAM)
 	if (!strncmp(argv[1], "sd", 2))
 		return do_sdram(cmdtp, flag, --argc, ++argv);
@@ -1267,6 +1275,7 @@ U_BOOT_CMD(
 	"i2c crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n"
 	"i2c probe - show devices on the I2C bus\n"
 	"i2c loop chip address[.0, .1, .2] [# of objects] - looping read of device\n"
+	"i2c res - resets the I2C Controller\n"
 #if defined(CONFIG_CMD_SDRAM)
 	"i2c sdram chip - print SDRAM configuration information\n"
 #endif
-- 
1.5.6.1

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

             reply	other threads:[~2008-09-29  7:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-29  7:52 Heiko Schocher [this message]
2008-09-29  8:45 ` [U-Boot] [PATCH] i2c: add i2c reset command Wolfgang Denk
2008-10-14 16:27 ` Wolfgang Denk

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=48E0894D.2010101@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.