Skip to content

Commit

Permalink
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare…
Browse files Browse the repository at this point in the history
…-2.6

* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (26 commits)
  i2c-rpx: Remove
  i2c-mpc: work around missing-9th-clock-pulse bug
  i2c: New PMC MSP71xx TWI bus driver
  i2c-savage4: Delete many unused defines
  i2c/tsl2550: Speed up initialization
  i2c: New bus driver for the TAOS evaluation modules
  i2c-i801: Use the internal 32-byte buffer on ICH4+
  i2c-i801: Various cleanups
  i2c: Add support for the TSL2550
  i2c-pxa: Support new-style I2C drivers
  i2c-gpio: Make some internal functions static
  i2c-gpio: Add support for new-style clients
  i2c-iop3xx: Switch to static adapter numbering
  i2c-sis5595: Resolve resource conflict with sis5595
  matroxfb: Clean-up i2c header inclusions
  i2c-nforce2: Add support for SMBus block transactions
  i2c-mpc: Use i2c_add_numbered_adapter
  i2c-mv64xxx: Use i2c_add_numbered_adapter
  i2c-piix4: Add support for the ATI SB700
  i2c: New DS1682 chip driver
  ...
  • Loading branch information
Linus Torvalds committed Jul 12, 2007
2 parents c397368 + 0a85e9a commit 068345f
Show file tree
Hide file tree
Showing 42 changed files with 2,222 additions and 330 deletions.
55 changes: 55 additions & 0 deletions Documentation/DocBook/kernel-api.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,60 @@ X!Idrivers/video/console/fonts.c
!Edrivers/spi/spi.c
</chapter>

<chapter id="i2c">
<title>I<superscript>2</superscript>C and SMBus Subsystem</title>

<para>
I<superscript>2</superscript>C (or without fancy typography, "I2C")
is an acronym for the "Inter-IC" bus, a simple bus protocol which is
widely used where low data rate communications suffice.
Since it's also a licensed trademark, some vendors use another
name (such as "Two-Wire Interface", TWI) for the same bus.
I2C only needs two signals (SCL for clock, SDA for data), conserving
board real estate and minimizing signal quality issues.
Most I2C devices use seven bit addresses, and bus speeds of up
to 400 kHz; there's a high speed extension (3.4 MHz) that's not yet
found wide use.
I2C is a multi-master bus; open drain signaling is used to
arbitrate between masters, as well as to handshake and to
synchronize clocks from slower clients.
</para>

<para>
The Linux I2C programming interfaces support only the master
side of bus interactions, not the slave side.
The programming interface is structured around two kinds of driver,
and two kinds of device.
An I2C "Adapter Driver" abstracts the controller hardware; it binds
to a physical device (perhaps a PCI device or platform_device) and
exposes a <structname>struct i2c_adapter</structname> representing
each I2C bus segment it manages.
On each I2C bus segment will be I2C devices represented by a
<structname>struct i2c_client</structname>. Those devices will
be bound to a <structname>struct i2c_driver</structname>,
which should follow the standard Linux driver model.
(At this writing, a legacy model is more widely used.)
There are functions to perform various I2C protocol operations; at
this writing all such functions are usable only from task context.
</para>

<para>
The System Management Bus (SMBus) is a sibling protocol. Most SMBus
systems are also I2C conformant. The electrical constraints are
tighter for SMBus, and it standardizes particular protocol messages
and idioms. Controllers that support I2C can also support most
SMBus operations, but SMBus controllers don't support all the protocol
options that an I2C controller will.
There are functions to perform various SMBus protocol operations,
either using I2C primitives or by issuing SMBus commands to
i2c_adapter devices which don't support those I2C operations.
</para>

!Iinclude/linux/i2c.h
!Fdrivers/i2c/i2c-boardinfo.c i2c_register_board_info
!Edrivers/i2c/i2c-core.c
</chapter>

<chapter id="splice">
<title>splice API</title>
<para>)
Expand All @@ -654,4 +708,5 @@ X!Idrivers/video/console/fonts.c
!Ffs/splice.c
</chapter>


</book>
7 changes: 7 additions & 0 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,10 @@ Who: Tejun Heo <htejun@gmail.com>

---------------------------

What: Legacy RTC drivers (under drivers/i2c/chips)
When: November 2007
Why: Obsolete. We have a RTC subsystem with better drivers.
Who: Jean Delvare <khali@linux-fr.org>

---------------------------

4 changes: 2 additions & 2 deletions Documentation/i2c/busses/i2c-i801
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Supported adapters:
'810' and '810E' chipsets)
* Intel 82801BA (ICH2 - part of the '815E' chipset)
* Intel 82801CA/CAM (ICH3)
* Intel 82801DB (ICH4) (HW PEC supported, 32 byte buffer not supported)
* Intel 82801EB/ER (ICH5) (HW PEC supported, 32 byte buffer not supported)
* Intel 82801DB (ICH4) (HW PEC supported)
* Intel 82801EB/ER (ICH5) (HW PEC supported)
* Intel 6300ESB
* Intel 82801FB/FR/FW/FRW (ICH6)
* Intel 82801G (ICH7)
Expand Down
2 changes: 1 addition & 1 deletion Documentation/i2c/busses/i2c-piix4
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Supported adapters:
Datasheet: Publicly available at the Intel website
* ServerWorks OSB4, CSB5, CSB6 and HT-1000 southbridges
Datasheet: Only available via NDA from ServerWorks
* ATI IXP200, IXP300, IXP400 and SB600 southbridges
* ATI IXP200, IXP300, IXP400, SB600 and SB700 southbridges
Datasheet: Not publicly available
* Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge
Datasheet: Publicly available at the SMSC website http://www.smsc.com
Expand Down
46 changes: 46 additions & 0 deletions Documentation/i2c/busses/i2c-taos-evm
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Kernel driver i2c-taos-evm

Author: Jean Delvare <khali@linux-fr.org>

This is a driver for the evaluation modules for TAOS I2C/SMBus chips.
The modules include an SMBus master with limited capabilities, which can
be controlled over the serial port. Virtually all evaluation modules
are supported, but a few lines of code need to be added for each new
module to instantiate the right I2C chip on the bus. Obviously, a driver
for the chip in question is also needed.

Currently supported devices are:

* TAOS TSL2550 EVM

For addtional information on TAOS products, please see
http://www.taosinc.com/


Using this driver
-----------------

In order to use this driver, you'll need the serport driver, and the
inputattach tool, which is part of the input-utils package. The following
commands will tell the kernel that you have a TAOS EVM on the first
serial port:

# modprobe serport
# inputattach --taos-evm /dev/ttyS0


Technical details
-----------------

Only 4 SMBus transaction types are supported by the TAOS evaluation
modules:
* Receive Byte
* Send Byte
* Read Byte
* Write Byte

The communication protocol is text-based and pretty simple. It is
described in a PDF document on the CD which comes with the evaluation
module. The communication is rather slow, because the serial port has
to operate at 1200 bps. However, I don't think this is a big concern in
practice, as these modules are meant for evaluation and testing only.
2 changes: 1 addition & 1 deletion Documentation/i2c/chips/max6875
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ And then read the data

or

count = i2c_smbus_read_i2c_block_data(fd, 0x84, buffer);
count = i2c_smbus_read_i2c_block_data(fd, 0x84, 16, buffer);

The block read should read 16 bytes.
0x84 is the block read command.
Expand Down
38 changes: 0 additions & 38 deletions Documentation/i2c/chips/x1205

This file was deleted.

2 changes: 0 additions & 2 deletions Documentation/i2c/summary
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ i2c-proc: The /proc/sys/dev/sensors interface for device (client) drivers
Algorithm drivers
-----------------

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-pcf: A PCF 8584 style algorithm
i2c-algo-ibm_ocp: An algorithm for the I2C device in IBM 4xx processors (NOT BUILT BY DEFAULT)
Expand All @@ -81,6 +80,5 @@ i2c-pcf-epp: PCF8584 on a EPP parallel port (uses i2c-algo-pcf) (NOT mkpatch
i2c-philips-par: Philips style parallel port adapter (uses i2c-algo-bit)
i2c-adap-ibm_ocp: IBM 4xx processor I2C device (uses i2c-algo-ibm_ocp) (NOT BUILT BY DEFAULT)
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-velleman: Velleman K8000 parallel port adapter (uses i2c-algo-bit)

2 changes: 1 addition & 1 deletion Documentation/i2c/writing-clients
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ SMBus communication
u8 command, u8 length,
u8 *values);
extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
u8 command, u8 *values);
u8 command, u8 length, u8 *values);

These ones were removed in Linux 2.6.10 because they had no users, but could
be added back later if needed:
Expand Down
4 changes: 0 additions & 4 deletions drivers/i2c/algos/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ config I2C_ALGOPCA
This support is also available as a module. If so, the module
will be called i2c-algo-pca.

config I2C_ALGO8XX
tristate "MPC8xx CPM I2C interface"
depends on 8xx

config I2C_ALGO_SGI
tristate "I2C SGI interfaces"
depends on SGI_IP22 || SGI_IP32 || X86_VISWS
Expand Down
31 changes: 26 additions & 5 deletions drivers/i2c/busses/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ config I2C_PIIX4
ATI IXP300
ATI IXP400
ATI SB600
ATI SB700
Serverworks OSB4
Serverworks CSB5
Serverworks CSB6
Expand Down Expand Up @@ -390,11 +391,6 @@ config I2C_PROSAVAGE
This support is also available as a module. If so, the module
will be called i2c-prosavage.

config I2C_RPXLITE
tristate "Embedded Planet RPX Lite/Classic support"
depends on RPXLITE || RPXCLASSIC
select I2C_ALGO8XX

config I2C_S3C2410
tristate "S3C2410 I2C Driver"
depends on ARCH_S3C2410
Expand Down Expand Up @@ -512,6 +508,22 @@ config I2C_SIS96X
This driver can also be built as a module. If so, the module
will be called i2c-sis96x.

config I2C_TAOS_EVM
tristate "TAOS evaluation module"
depends on EXPERIMENTAL
select SERIO
select SERIO_SERPORT
default n
help
This supports TAOS evaluation modules on serial port. In order to
use this driver, you will need the inputattach tool, which is part
of the input-utils package.

If unsure, say N.

This support is also available as a module. If so, the module
will be called i2c-taos-evm.

config I2C_STUB
tristate "I2C/SMBus Test Stub"
depends on EXPERIMENTAL && m
Expand Down Expand Up @@ -635,4 +647,13 @@ config I2C_PNX
This driver can also be built as a module. If so, the module
will be called i2c-pnx.

config I2C_PMCMSP
tristate "PMC MSP I2C TWI Controller"
depends on PMC_MSP
help
This driver supports the PMC TWI controller on MSP devices.

This driver can also be built as module. If so, the module
will be called i2c-pmcmsp.

endmenu
3 changes: 2 additions & 1 deletion drivers/i2c/busses/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ obj-$(CONFIG_I2C_PARPORT_LIGHT) += i2c-parport-light.o
obj-$(CONFIG_I2C_PASEMI) += i2c-pasemi.o
obj-$(CONFIG_I2C_PCA_ISA) += i2c-pca-isa.o
obj-$(CONFIG_I2C_PIIX4) += i2c-piix4.o
obj-$(CONFIG_I2C_PMCMSP) += i2c-pmcmsp.o
obj-$(CONFIG_I2C_PNX) += i2c-pnx.o
obj-$(CONFIG_I2C_PROSAVAGE) += i2c-prosavage.o
obj-$(CONFIG_I2C_PXA) += i2c-pxa.o
obj-$(CONFIG_I2C_RPXLITE) += i2c-rpx.o
obj-$(CONFIG_I2C_S3C2410) += i2c-s3c2410.o
obj-$(CONFIG_I2C_SAVAGE4) += i2c-savage4.o
obj-$(CONFIG_I2C_SIBYTE) += i2c-sibyte.o
Expand All @@ -44,6 +44,7 @@ obj-$(CONFIG_I2C_SIS5595) += i2c-sis5595.o
obj-$(CONFIG_I2C_SIS630) += i2c-sis630.o
obj-$(CONFIG_I2C_SIS96X) += i2c-sis96x.o
obj-$(CONFIG_I2C_STUB) += i2c-stub.o
obj-$(CONFIG_I2C_TAOS_EVM) += i2c-taos-evm.o
obj-$(CONFIG_I2C_TINY_USB) += i2c-tiny-usb.o
obj-$(CONFIG_I2C_VERSATILE) += i2c-versatile.o
obj-$(CONFIG_I2C_ACORN) += i2c-acorn.o
Expand Down
12 changes: 9 additions & 3 deletions drivers/i2c/busses/i2c-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ static void i2c_gpio_setscl_val(void *data, int state)
gpio_set_value(pdata->scl_pin, state);
}

int i2c_gpio_getsda(void *data)
static int i2c_gpio_getsda(void *data)
{
struct i2c_gpio_platform_data *pdata = data;

return gpio_get_value(pdata->sda_pin);
}

int i2c_gpio_getscl(void *data)
static int i2c_gpio_getscl(void *data)
{
struct i2c_gpio_platform_data *pdata = data;

Expand Down Expand Up @@ -142,7 +142,13 @@ static int __init i2c_gpio_probe(struct platform_device *pdev)
adap->algo_data = bit_data;
adap->dev.parent = &pdev->dev;

ret = i2c_bit_add_bus(adap);
/*
* If "dev->id" is negative we consider it as zero.
* The reason to do so is to avoid sysfs names that only make
* sense when there are multiple adapters.
*/
adap->nr = pdev->id >= 0 ? pdev->id : 0;
ret = i2c_bit_add_numbered_bus(adap);
if (ret)
goto err_add_bus;

Expand Down
Loading

0 comments on commit 068345f

Please sign in to comment.