Commit 3df60e41 authored by Albert Cranford's avatar Albert Cranford Committed by Linus Torvalds

[PATCH] i2c updates 4/4

Please apply the four of four tested patches that update
2.5.31 with these I2C changes:
 o Support for SMBus 2.0 PEC Packet Error Checking
 o New adapter-i2c-frodo for SA 1110 board
 o New adapter-i2c-rpx for embeded MPC8XX
 o Replace depreciated cli()&sti() with spin_{un}lock_irq()
 o Updated documentation
parent 9bc9da2d
...@@ -87,7 +87,12 @@ ioctl(file,I2C_SLAVE,long addr) ...@@ -87,7 +87,12 @@ ioctl(file,I2C_SLAVE,long addr)
ioctl(file,I2C_TENBIT,long select) ioctl(file,I2C_TENBIT,long select)
Selects ten bit addresses if select not equals 0, selects normal 7 bit Selects ten bit addresses if select not equals 0, selects normal 7 bit
addresses if select equals 0. addresses if select equals 0. Default 0.
ioctl(file,I2C_PEC,long select)
Selects SMBus PEC (packet error checking) generation and verification
if select not equals 0, disables if select equals 0. Default 0.
Used only for SMBus transactions.
ioctl(file,I2C_FUNCS,unsigned long *funcs) ioctl(file,I2C_FUNCS,unsigned long *funcs)
Gets the adapter functionality and puts it in *funcs. Gets the adapter functionality and puts it in *funcs.
......
This diff is collapsed.
Primitive parallel port is driver for i2c bus, which exploits
features of modern bidirectional parallel ports.
Bidirectional ports have particular bits connected in following way:
|
/-----| R
--o| |-----|
read \-----| /------- Out pin
|/
- -|\
write V
|
---
It means when output is set to 1 we can read the port. Therefore
we can use 2 pins of parallel port as SDA and SCL for i2c bus. It
is not necessary to add any external - additional parts, we can
read and write the same port simultaneously.
I only use register base+2 so it is possible to use all
8 data bits of parallel port for other applications (I have
connected EEPROM and LCD display). I do not use bit Enable Bi-directional
Port. The only disadvantage is we can only support 5V chips.
Layout:
Cannon 25 pin
SDA - connect to pin 14 (Auto Linefeed)
SCL - connect to pin 16 (Initialize Printer)
GND - connect to pin 18-25
+5V - use external supply (I use 5V from 3.5" floppy connector)
no pullups requied
Module parameters:
base = 0xXXX
XXX - 278 or 378
That's all.
Daniel Smolik
marvin@sitour.cz
i2c-velleman driver
-------------------
This is a driver for i2c-hw access for Velleman K9000 and other adapters.
Useful links
------------
Velleman:
http://www.velleman.be/
Velleman K8000 Howto:
http://howto.htlw16.ac.at/k8000-howto.html
K8000 and K8005 libraries
-------------------------
The project has lead to new libs for the Velleman K8000 and K8005..
LIBK8000 v1.99.1 and LIBK8005 v0.21
With these libs you can control the K8000 and K8005 with the original
simple commands which are in the original Velleman software.
Like SetIOchannel, ReadADchannel, SendStepCCWFull and many more.
Via i2c kernel device /dev/velleman
The libs can be found on http://groups.yahoo.com/group/k8000/files/linux/
The Velleman K8000 interface card on http://www.velleman.be/kits/k8000.htm
The Velleman K8005 steppermotorcard on http://www.velleman.be/kits/k8005.htm
SMBus Protocol Summary
======================
The following is a summary of the SMBus protocol. It applies to
all revisions of the protocol (1.0, 1.1, and 2.0).
Certain protocol features which are not supported by
this package are briefly described at the end of this document.
Some adapters understand only the SMBus (System Management Bus) protocol, Some adapters understand only the SMBus (System Management Bus) protocol,
which is a subset from the I2C protocol. Fortunately, many devices use which is a subset from the I2C protocol. Fortunately, many devices use
only the same subset, which makes it possible to put them on an SMBus. only the same subset, which makes it possible to put them on an SMBus.
...@@ -6,7 +13,7 @@ commands if at all possible (if the device uses only that subset of the ...@@ -6,7 +13,7 @@ commands if at all possible (if the device uses only that subset of the
I2C protocol). This makes it possible to use the device driver on both I2C protocol). This makes it possible to use the device driver on both
SMBus adapters and I2C adapters (the SMBus command set is automatically SMBus adapters and I2C adapters (the SMBus command set is automatically
translated to I2C on I2C adapters, but plain I2C commands can not be translated to I2C on I2C adapters, but plain I2C commands can not be
handled at all on a pure SMBus adapter). handled at all on most pure SMBus adapters).
Below is a list of SMBus commands. Below is a list of SMBus commands.
...@@ -109,7 +116,7 @@ S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] ...@@ -109,7 +116,7 @@ S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A]
SMBus Block Read SMBus Block Read
================ ================
This command reads a block of upto 32 bytes from a device, from a This command reads a block of up to 32 bytes from a device, from a
designated register that is specified through the Comm byte. The amount designated register that is specified through the Comm byte. The amount
of data is specified by the device in the Count byte. of data is specified by the device in the Count byte.
...@@ -120,8 +127,90 @@ S Addr Wr [A] Comm [A] ...@@ -120,8 +127,90 @@ S Addr Wr [A] Comm [A]
SMBus Block Write SMBus Block Write
================= =================
The opposite of the Block Read command, this writes upto 32 bytes to The opposite of the Block Read command, this writes up to 32 bytes to
a device, to a designated register that is specified through the a device, to a designated register that is specified through the
Comm byte. The amount of data is specified in the Count byte. Comm byte. The amount of data is specified in the Count byte.
S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P
SMBus Block Process Call
========================
SMBus Block Process Call was introduced in Revision 2.0 of the specification.
This command selects a device register (through the Comm byte), sends
1 to 31 bytes of data to it, and reads 1 to 31 bytes of data in return.
S Addr Wr [A] Comm [A] Count [A] Data [A] ...
S Addr Rd [A] [Count] A [Data] ... A P
SMBus Host Notify
=================
This command is sent from a SMBus device acting as a master to the
SMBus host acting as a slave.
It is the same form as Write Word, with the command code replaced by the
alerting device's address.
[S] [HostAddr] [Wr] A [DevAddr] A [DataLow] A [DataHigh] A [P]
Packet Error Checking (PEC)
===========================
Packet Error Checking was introduced in Revision 1.1 of the specification.
PEC adds a CRC-8 error-checking byte to all transfers.
Address Resolution Protocol (ARP)
=================================
The Address Resolution Protocol was introduced in Revision 2.0 of
the specification. It is a higher-layer protocol which uses the
messages above.
ARP adds device enumeration and dynamic address assignment to
the protocol. All ARP communications use slave address 0x61 and
require PEC checksums.
I2C Block Transactions
======================
The following I2C block transactions are supported by the
SMBus layer and are described here for completeness.
I2C block transactions do not limit the number of bytes transferred
but the SMBus layer places a limit of 32 bytes.
I2C Block Read
==============
This command reads a block of bytes from a device, from a
designated register that is specified through the Comm byte.
S Addr Wr [A] Comm [A]
S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P
I2C Block Read (2 Comm bytes)
=============================
This command reads a block of bytes from a device, from a
designated register that is specified through the two Comm bytes.
S Addr Wr [A] Comm1 [A] Comm2 [A]
S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P
I2C Block Write
===============
The opposite of the Block Read command, this writes bytes to
a device, to a designated register that is specified through the
Comm byte. Note that command lengths of 0, 2, or more bytes are
supported as they are indistinguishable from data.
S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P
...@@ -59,16 +59,16 @@ Algorithm drivers ...@@ -59,16 +59,16 @@ Algorithm drivers
i2c-algo-8xx: An algorithm for CPM's I2C device in Motorola 8xx processors (NOT BUILT BY DEFAULT) i2c-algo-8xx: An algorithm for CPM's I2C device in Motorola 8xx processors (NOT BUILT BY DEFAULT)
i2c-algo-bit: A bit-banging algorithm i2c-algo-bit: A bit-banging algorithm
i2c-algo-pcf: A PCF 8584 style algorithm i2c-algo-pcf: A PCF 8584 style algorithm
i2c-algo-ppc405: An algorithm for the I2C device in IBM 405xx processors (NOT BUILT BY DEFAULT) i2c-algo-ibmocp: An algorithm for the I2C device in IBM 4xx processors (NOT BUILT BY DEFAULT)
Adapter drivers Adapter drivers
--------------- ---------------
i2c-elektor: Elektor ISA card (uses i2c-algo-pcf) i2c-elektor: Elektor ISA card (uses i2c-algo-pcf)
i2c-elv: ELV parallel port adapter (uses i2c-algo-bit) i2c-elv: ELV parallel port adapter (uses i2c-algo-bit)
i2c-pcf-epp: PCF8584 on a EPP parallel port (uses i2c-algo-pcf) (BROKEN - missing i2c-pcf-epp.h) i2c-pcf-epp: PCF8584 on a EPP parallel port (uses i2c-algo-pcf) (NOT mkpatched)
i2c-philips-par: Philips style parallel port adapter (uses i2c-algo-bit) i2c-philips-par: Philips style parallel port adapter (uses i2c-algo-bit)
i2c-ppc405: IBM 405xx processor I2C device (uses i2c-algo-ppc405) (NOT BUILT BY DEFAULT) i2c-adap_ibmocp: IBM 4xx processor I2C device (uses i2c-algo-ibmocp) (NOT BUILT BY DEFAULT)
i2c-pport: Primitive parallel port adapter (uses i2c-algo-bit) i2c-pport: Primitive parallel port adapter (uses i2c-algo-bit)
i2c-rpx: RPX board Motorola 8xx I2C device (uses i2c-algo-8xx) (NOT BUILT BY DEFAULT) i2c-rpx: RPX board Motorola 8xx I2C device (uses i2c-algo-8xx) (NOT BUILT BY DEFAULT)
i2c-velleman: Velleman K9000 parallel port adapter (uses i2c-algo-bit) i2c-velleman: Velleman K9000 parallel port adapter (uses i2c-algo-bit)
......
...@@ -365,7 +365,7 @@ The detect client function ...@@ -365,7 +365,7 @@ The detect client function
The detect client function is called by i2c_probe or i2c_detect. The detect client function is called by i2c_probe or i2c_detect.
The `kind' parameter contains 0 if this call is due to a `force' The `kind' parameter contains 0 if this call is due to a `force'
parameter, and 0 otherwise (for i2c_detect, it contains 0 if parameter, and -1 otherwise (for i2c_detect, it contains 0 if
this call is due to the generic `force' parameter, and the chip type this call is due to the generic `force' parameter, and the chip type
number if it is due to a specific `force' parameter). number if it is due to a specific `force' parameter).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment