summaryrefslogtreecommitdiff
path: root/stub
diff options
context:
space:
mode:
authorkhali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0>2007-11-01 19:27:37 +0000
committerkhali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0>2007-11-01 19:27:37 +0000
commit57d5f8a98118254ad03d4cf5b1beb0867cd73cd8 (patch)
tree3f1c42d435edb9a3155769a62e88c6b0f0ccbcc4 /stub
parent552bc2c1472907e030345abea007efa7679590e1 (diff)
downloadi2c-tools-57d5f8a98118254ad03d4cf5b1beb0867cd73cd8.tar.gz
Add a manual page for i2c-stub-from-dump.
git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5005 7894878c-1315-0410-8ee3-d5d059ff63e0
Diffstat (limited to 'stub')
-rw-r--r--stub/Module.mk2
-rw-r--r--stub/i2c-stub-from-dump.853
2 files changed, 55 insertions, 0 deletions
diff --git a/stub/Module.mk b/stub/Module.mk
index 4bfd036..27ba190 100644
--- a/stub/Module.mk
+++ b/stub/Module.mk
@@ -13,9 +13,11 @@ STUB_DIR := stub
install-stub: $(STUB_DIR)/i2c-stub-from-dump
$(INSTALL_DIR) $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) $(STUB_DIR)/i2c-stub-from-dump $(DESTDIR)$(sbindir)
+ $(INSTALL_DATA) $(STUB_DIR)/i2c-stub-from-dump.8 $(DESTDIR)$(man8dir)
uninstall-stub:
$(RM) $(DESTDIR)$(sbindir)/i2c-stub-from-dump
+ $(RM) $(DESTDIR)$(man8dir)/i2c-stub-from-dump.8
install: install-stub
diff --git a/stub/i2c-stub-from-dump.8 b/stub/i2c-stub-from-dump.8
new file mode 100644
index 0000000..fc63f62
--- /dev/null
+++ b/stub/i2c-stub-from-dump.8
@@ -0,0 +1,53 @@
+.TH I2C-STUB-FROM-DUMP 8 "November 2007"
+.SH NAME
+i2c-stub-from-dump \- feed i2c-stub with a dump file
+
+.SH SYNOPSIS
+.B i2c-stub-from-dump
+.I address
+.I dump-file
+
+.SH DESCRIPTION
+i2c-stub-from-dump is a small helper script for the i2c-stub kernel driver.
+It lets you setup a fake I2C chip on the i2c-stub bus based on a dump of
+the chip you want to emulate generated by i2cdump.
+
+i2c-stub-from-dump requires i2cdetect and i2cset to be installed and
+reachable through the user's PATH. The former is used to find out the i2c-stub
+bus number, while the latter is used to write to the fake I2C chip.
+
+.SH EXAMPLE
+You have an I2C chip on system A. You would like to do some development on its
+driver on system B. Here are the few steps you have to follow.
+
+On system A, use i2cdump to capture a dump from the chip. Assuming that the
+chip in question lives at address 0x4c on I2C bus 0, you would run:
+
+ i2cdump -y 0 0x4c b > chip.dump
+
+Adjust the bus number and chip address for your case. i2cdetect can help
+you find out their values.
+
+Copy the dump file to system B.
+
+On system B, run:
+
+ i2c-stub-from-dump 0x4c chip.dump
+
+This will load the required i2c-dev and i2c-stub kernel drivers if needed,
+then write all the register values to the emulated I2C chip at address 0x4c.
+Again, adjust the address as needed.
+
+.SH LIMITATIONS
+There are some limitations to the kind of devices that can be handled:
+.IP \(bu "\w'\(bu'u+1n"
+Device must only use byte register access. i2c-stub supports word
+access but i2c-stub-from-dump doesn't (yet).
+.IP \(bu
+Device must not have banks (as most Winbond devices do).
+
+.SH SEE ALSO
+ i2cdump(8), i2cdetect(8), i2cset(8)
+
+.SH AUTHOR
+Jean Delvare