projects/linux·commit dc221eae

Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6

dc221eae · Linus Torvalds <[email protected]> · 2008-07-15 11:16:05 -07:00

* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: (56 commits)
  i2c: Add detection capability to new-style drivers
  i2c: Call client_unregister for new-style devices too
  i2c: Clean up old chip drivers
  i2c-ibm_iic: Register child nodes
  i2c: New-style EEPROM driver using device IDs
  i2c: Export the i2c_bus_type symbol
  i2c-au1550: Fix PM support
  i2c-dev: Delete empty detach_client callback
  i2c: Drop stray references to lm_sensors
  i2c: Check for ACPI resource conflicts
  i2c-ocores: basic PM support
  i2c-sibyte: SWARM I2C board initialization
  i2c-i801: Fix handling of error conditions
  i2c-i801: Rename local variable temp to status
  i2c-i801: Properly report bus arbitration loss
  i2c-i801: Remove verbose debugging messages
  i2c-algo-pcf: Drop unused struct members
  i2c-algo-pcf: Multi-master lost-arbitration improvement
  i2c: Deprecate the legacy gpio drivers
  i2c-pxa: Initialize early
  ...
Commit
dc221eae08eea3b0db127d1f152fac24d10b6a52
Parents
98339cbd · 4735c98f

Merge commit. Changes below are compared with the first parent: 98339cbd.

Changes

72 files changed · +3872 −2236

FileStatusAddDelContent
Documentation/feature-removal-schedule.txtmodified+0−7View file
Documentation/i2c/busses/i2c-i810deleted+0−47View before deletion
Documentation/i2c/busses/i2c-prosavagedeleted+0−23View before deletion
Documentation/i2c/busses/i2c-savage4deleted+0−26View before deletion
Documentation/i2c/fault-codesadded+127−0View file
Documentation/i2c/smbus-protocolmodified+2−2View file
Documentation/i2c/writing-clientsmodified+40−11View file
MAINTAINERSmodified+7−0View file
arch/mips/sibyte/swarm/Makefilemodified+1−0View file
arch/mips/sibyte/swarm/swarm-i2c.cadded+37−0View file
drivers/i2c/algos/i2c-algo-bit.cmodified+2−2View file
drivers/i2c/algos/i2c-algo-pca.cmodified+1−1View file
drivers/i2c/algos/i2c-algo-pcf.cmodified+31−17View file
drivers/i2c/busses/Kconfigmodified+383−388View file
drivers/i2c/busses/Makefilemodified+34−23View file
drivers/i2c/busses/i2c-ali1535.cmodified+20−18View file
drivers/i2c/busses/i2c-ali1563.cmodified+27−11View file
drivers/i2c/busses/i2c-ali15x3.cmodified+18−14View file
drivers/i2c/busses/i2c-amd756-s4882.cmodified+2−2View file
drivers/i2c/busses/i2c-amd756.cmodified+19−16View file
drivers/i2c/busses/i2c-amd8111.cmodified+37−17View file
drivers/i2c/busses/i2c-au1550.cmodified+75−55View file
drivers/i2c/busses/i2c-cpm.cadded+745−0View file
drivers/i2c/busses/i2c-davinci.cmodified+67−22View file
drivers/i2c/busses/i2c-elektor.cmodified+1−3View file
drivers/i2c/busses/i2c-gpio.cmodified+1−1View file
drivers/i2c/busses/i2c-hydra.cmodified+0−3View file
drivers/i2c/busses/i2c-i801.cmodified+136−148View file
drivers/i2c/busses/i2c-i810.cdeleted+0−260View before deletion
drivers/i2c/busses/i2c-ibm_iic.cmodified+8−198View file
drivers/i2c/busses/i2c-iop3xx.cmodified+1−1View file
drivers/i2c/busses/i2c-isch.cadded+339−0View file
drivers/i2c/busses/i2c-mpc.cmodified+1−1View file
drivers/i2c/busses/i2c-mv64xxx.cmodified+1−1View file
drivers/i2c/busses/i2c-nforce2-s4985.cadded+257−0View file
drivers/i2c/busses/i2c-nforce2.cmodified+36−13View file
drivers/i2c/busses/i2c-ocores.cmodified+36−8View file
drivers/i2c/busses/i2c-pasemi.cmodified+1−1View file
drivers/i2c/busses/i2c-pca-platform.cmodified+1−1View file
drivers/i2c/busses/i2c-piix4.cmodified+33−40View file
drivers/i2c/busses/i2c-pmcmsp.cmodified+1−1View file
drivers/i2c/busses/i2c-prosavage.cdeleted+0−325View before deletion
drivers/i2c/busses/i2c-pxa.cmodified+1−1View file
drivers/i2c/busses/i2c-s3c2410.cmodified+1−1View file
drivers/i2c/busses/i2c-savage4.cdeleted+0−185View before deletion
drivers/i2c/busses/i2c-sibyte.cmodified+5−3View file
drivers/i2c/busses/i2c-sis5595.cmodified+18−11View file
drivers/i2c/busses/i2c-sis630.cmodified+33−26View file
drivers/i2c/busses/i2c-sis96x.cmodified+17−20View file
drivers/i2c/busses/i2c-stub.cmodified+3−3View file
drivers/i2c/busses/i2c-taos-evm.cmodified+2−3View file
drivers/i2c/busses/i2c-via.cmodified+1−4View file
drivers/i2c/busses/i2c-viapro.cmodified+18−13View file
drivers/i2c/busses/i2c-voodoo3.cmodified+0−2View file
drivers/i2c/busses/scx200_acb.cmodified+1−1View file
drivers/i2c/chips/Kconfigmodified+38−5View file
drivers/i2c/chips/Makefilemodified+1−0View file
drivers/i2c/chips/at24.cadded+583−0View file
drivers/i2c/chips/eeprom.cmodified+40−41View file
drivers/i2c/chips/max6875.cmodified+1−3View file
drivers/i2c/chips/pca9539.cmodified+12−13View file
drivers/i2c/chips/pcf8574.cmodified+11−14View file
drivers/i2c/chips/pcf8591.cmodified+15−18View file
drivers/i2c/i2c-core.cmodified+448−127View file
drivers/i2c/i2c-dev.cmodified+2−10View file
drivers/video/fb_ddc.cmodified+1−0View file
drivers/video/intelfb/intelfb_i2c.cmodified+7−5View file
drivers/video/matrox/i2c-matroxfb.cmodified+15−5View file
include/linux/i2c-algo-pcf.hmodified+5−3View file
include/linux/i2c-id.hmodified+0−3View file
include/linux/i2c.hmodified+37−9View file
include/linux/i2c/at24.hadded+28−0View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/feature-removal-schedule.txt

View file
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 46ece3f..65a1482 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -222,13 +222,6 @@ Who: Thomas Gleixner <[email protected]>
---------------------------
-What: i2c-i810, i2c-prosavage and i2c-savage4
-When: May 2008
-Why: These drivers are superseded by i810fb, intelfb and savagefb.
-Who: Jean Delvare <[email protected]>
-
----------------------------
-
What (Why):
- include/linux/netfilter_ipv4/ipt_TOS.h ipt_tos.h header files
(superseded by xt_TOS/xt_tos target & match)

Documentation/i2c/busses/i2c-i810

View before deletion
diff --git a/Documentation/i2c/busses/i2c-i810 b/Documentation/i2c/busses/i2c-i810
deleted file mode 100644
index 778210e..0000000
--- a/Documentation/i2c/busses/i2c-i810
+++ /dev/null
@@ -1,47 +0,0 @@
-Kernel driver i2c-i810
-
-Supported adapters:
- * Intel 82810, 82810-DC100, 82810E, and 82815 (GMCH)
- * Intel 82845G (GMCH)
-
-Authors:
- Frodo Looijaard <[email protected]>,
- Philip Edelbrock <[email protected]>,
- Kyösti Mälkki <[email protected]>,
- Ralph Metzler <[email protected]>,
- Mark D. Studebaker <[email protected]>
-
-Main contact: Mark Studebaker <[email protected]>
-
-Description
------------
-
-WARNING: If you have an '810' or '815' motherboard, your standard I2C
-temperature sensors are most likely on the 801's I2C bus. You want the
-i2c-i801 driver for those, not this driver.
-
-Now for the i2c-i810...
-
-The GMCH chip contains two I2C interfaces.
-
-The first interface is used for DDC (Data Display Channel) which is a
-serial channel through the VGA monitor connector to a DDC-compliant
-monitor. This interface is defined by the Video Electronics Standards
-Association (VESA). The standards are available for purchase at
-http://www.vesa.org .
-
-The second interface is a general-purpose I2C bus. It may be connected to a
-TV-out chip such as the BT869 or possibly to a digital flat-panel display.
-
-Features
---------
-
-Both busses use the i2c-algo-bit driver for 'bit banging'
-and support for specific transactions is provided by i2c-algo-bit.
-
-Issues
-------
-
-If you enable bus testing in i2c-algo-bit (insmod i2c-algo-bit bit_test=1),
-the test may fail; if so, the i2c-i810 driver won't be inserted. However,
-we think this has been fixed.

Documentation/i2c/busses/i2c-prosavage

View before deletion
diff --git a/Documentation/i2c/busses/i2c-prosavage b/Documentation/i2c/busses/i2c-prosavage
deleted file mode 100644
index 7036879..0000000
--- a/Documentation/i2c/busses/i2c-prosavage
+++ /dev/null
@@ -1,23 +0,0 @@
-Kernel driver i2c-prosavage
-
-Supported adapters:
-
- S3/VIA KM266/VT8375 aka ProSavage8
- S3/VIA KM133/VT8365 aka Savage4
-
-Author: Henk Vergonet <[email protected]>
-
-Description
------------
-
-The Savage4 chips contain two I2C interfaces (aka a I2C 'master' or
-'host').
-
-The first interface is used for DDC (Data Display Channel) which is a
-serial channel through the VGA monitor connector to a DDC-compliant
-monitor. This interface is defined by the Video Electronics Standards
-Association (VESA). The standards are available for purchase at
-http://www.vesa.org . The second interface is a general-purpose I2C bus.
-
-Usefull for gaining access to the TV Encoder chips.
-

Documentation/i2c/busses/i2c-savage4

View before deletion
diff --git a/Documentation/i2c/busses/i2c-savage4 b/Documentation/i2c/busses/i2c-savage4
deleted file mode 100644
index 6ecceab..0000000
--- a/Documentation/i2c/busses/i2c-savage4
+++ /dev/null
@@ -1,26 +0,0 @@
-Kernel driver i2c-savage4
-
-Supported adapters:
- * Savage4
- * Savage2000
-
-Authors:
- Alexander Wold <[email protected]>,
- Mark D. Studebaker <[email protected]>
-
-Description
------------
-
-The Savage4 chips contain two I2C interfaces (aka a I2C 'master'
-or 'host').
-
-The first interface is used for DDC (Data Display Channel) which is a
-serial channel through the VGA monitor connector to a DDC-compliant
-monitor. This interface is defined by the Video Electronics Standards
-Association (VESA). The standards are available for purchase at
-http://www.vesa.org . The DDC bus is not yet supported because its register
-is not directly memory-mapped.
-
-The second interface is a general-purpose I2C bus. This is the only
-interface supported by the driver at the moment.
-

Documentation/i2c/fault-codes

View file
diff --git a/Documentation/i2c/fault-codes b/Documentation/i2c/fault-codes
new file mode 100644
index 0000000..045765c
--- /dev/null
+++ b/Documentation/i2c/fault-codes
@@ -0,0 +1,127 @@
+This is a summary of the most important conventions for use of fault
+codes in the I2C/SMBus stack.
+
+
+A "Fault" is not always an "Error"
+----------------------------------
+Not all fault reports imply errors; "page faults" should be a familiar
+example. Software often retries idempotent operations after transient
+faults. There may be fancier recovery schemes that are appropriate in
+some cases, such as re-initializing (and maybe resetting). After such
+recovery, triggered by a fault report, there is no error.
+
+In a similar way, sometimes a "fault" code just reports one defined
+result for an operation ... it doesn't indicate that anything is wrong
+at all, just that the outcome wasn't on the "golden path".
+
+In short, your I2C driver code may need to know these codes in order
+to respond correctly. Other code may need to rely on YOUR code reporting
+the right fault code, so that it can (in turn) behave correctly.
+
+
+I2C and SMBus fault codes
+-------------------------
+These are returned as negative numbers from most calls, with zero or
+some positive number indicating a non-fault return. The specific
+numbers associated with these symbols differ between architectures,
+though most Linux systems use <asm-generic/errno*.h> numbering.
+
+Note that the descriptions here are not exhaustive. There are other
+codes that may be returned, and other cases where these codes should
+be returned. However, drivers should not return other codes for these
+cases (unless the hardware doesn't provide unique fault reports).
+
+Also, codes returned by adapter probe methods follow rules which are
+specific to their host bus (such as PCI, or the platform bus).
+
+
+EAGAIN
+ Returned by I2C adapters when they lose arbitration in master
+ transmit mode: some other master was transmitting different
+ data at the same time.
+
+ Also returned when trying to invoke an I2C operation in an
+ atomic context, when some task is already using that I2C bus
+ to execute some other operation.
+
+EBADMSG
+ Returned by SMBus logic when an invalid Packet Error Code byte
+ is received. This code is a CRC covering all bytes in the
+ transaction, and is sent before the terminating STOP. This
+ fault is only reported on read transactions; the SMBus slave
+ may have a way to report PEC mismatches on writes from the
+ host. Note that even if PECs are in use, you should not rely
+ on these as the only way to detect incorrect data transfers.
+
+EBUSY
+ Returned by SMBus adapters when the bus was busy for longer
+ than allowed. This usually indicates some device (maybe the
+ SMBus adapter) needs some fault recovery (such as resetting),
+ or that the reset was attempted but failed.
+
+EINVAL
+ This rather vague error means an invalid parameter has been
+ detected before any I/O operation was started. Use a more
+ specific fault code when you can.
+
+ One example would be a driver trying an SMBus Block Write
+ with block size outside the range of 1-32 bytes.
+
+EIO
+ This rather vague error means something went wrong when
+ performing an I/O operation. Use a more specific fault
+ code when you can.
+
+ENODEV
+ Returned by driver probe() methods. This is a bit more
+ specific than ENXIO, implying the problem isn't with the
+ address, but with the device found there. Driver probes
+ may verify the device returns *correct* responses, and
+ return this as appropriate. (The driver core will warn
+ about probe faults other than ENXIO and ENODEV.)
+
+ENOMEM
+ Returned by any component that can't allocate memory when
+ it needs to do so.
+
+ENXIO
+ Returned by I2C adapters to indicate that the address phase
+ of a transfer didn't get an ACK. While it might just mean
+ an I2C device was temporarily not responding, usually it
+ means there's nothing listening at that address.
+
+ Returned by driver probe() methods to indicate that they
+ found no device to bind to. (ENODEV may also be used.)
+
+EOPNOTSUPP
+ Returned by an adapter when asked to perform an operation
+ that it doesn't, or can't, support.
+
+ For example, this would be returned when an adapter that
+ doesn't support SMBus block transfers is asked to execute
+ one. In that case, the driver making that request should
+ have verified that functionality was supported before it
+ made that block transfer request.
+
+ Similarly, if an I2C adapter can't execute all legal I2C
+ messages, it should return this when asked to perform a
+ transaction it can't. (These limitations can't be seen in
+ the adapter's functionality mask, since the assumption is
+ that if an adapter supports I2C it supports all of I2C.)
+
+EPROTO
+ Returned when slave does not conform to the relevant I2C
+ or SMBus (or chip-specific) protocol specifications. One
+ case is when the length of an SMBus block data response
+ (from the SMBus slave) is outside the range 1-32 bytes.
+
+ETIMEDOUT
+ This is returned by drivers when an operation took too much
+ time, and was aborted before it completed.
+
+ SMBus adapters may return it when an operation took more
+ time than allowed by the SMBus specification; for example,
+ when a slave stretches clocks too far. I2C has no such
+ timeouts, but it's normal for I2C adapters to impose some
+ arbitrary limits (much longer than SMBus!) too.
+

Documentation/i2c/smbus-protocol

View file
diff --git a/Documentation/i2c/smbus-protocol b/Documentation/i2c/smbus-protocol
index 03f08fb..24bfb65 100644
--- a/Documentation/i2c/smbus-protocol
+++ b/Documentation/i2c/smbus-protocol
@@ -42,8 +42,8 @@ Count (8 bits): A data byte containing the length of a block operation.
[..]: Data sent by I2C device, as opposed to data sent by the host adapter.
-SMBus Quick Command: i2c_smbus_write_quick()
-=============================================
+SMBus Quick Command
+===================
This sends a single bit to the device, at the place of the Rd/Wr bit.

Documentation/i2c/writing-clients

View file
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients
index d4cd412..6b61b3a 100644
--- a/Documentation/i2c/writing-clients
+++ b/Documentation/i2c/writing-clients
@@ -44,6 +44,10 @@ static struct i2c_driver foo_driver = {
.id_table = foo_ids,
.probe = foo_probe,
.remove = foo_remove,
+ /* if device autodetection is needed: */
+ .class = I2C_CLASS_SOMETHING,
+ .detect = foo_detect,
+ .address_data = &addr_data,
/* else, driver uses "legacy" binding model: */
.attach_adapter = foo_attach_adapter,
@@ -217,6 +221,31 @@ in the I2C bus driver. You may want to save the returned i2c_client
reference for later use.
+Device Detection (Standard driver model)
+----------------------------------------
+
+Sometimes you do not know in advance which I2C devices are connected to
+a given I2C bus. This is for example the case of hardware monitoring
+devices on a PC's SMBus. In that case, you may want to let your driver
+detect supported devices automatically. This is how the legacy model
+was working, and is now available as an extension to the standard
+driver model (so that we can finally get rid of the legacy model.)
+
+You simply have to define a detect callback which will attempt to
+identify supported devices (returning 0 for supported ones and -ENODEV
+for unsupported ones), a list of addresses to probe, and a device type
+(or class) so that only I2C buses which may have that type of device
+connected (and not otherwise enumerated) will be probed. The i2c
+core will then call you back as needed and will instantiate a device
+for you for every successful detection.
+
+Note that this mechanism is purely optional and not suitable for all
+devices. You need some reliable way to identify the supported devices
+(typically using device-specific, dedicated identification registers),
+otherwise misdetections are likely to occur and things can get wrong
+quickly.
+
+
Device Deletion (Standard driver model)
---------------------------------------
@@ -569,7 +598,6 @@ SMBus communication
in terms of it. Never use this function directly!
- extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value);
extern s32 i2c_smbus_read_byte(struct i2c_client * client);
extern s32 i2c_smbus_write_byte(struct i2c_client * client, u8 value);
extern s32 i2c_smbus_read_byte_data(struct i2c_client * client, u8 command);
@@ -578,30 +606,31 @@ SMBus communication
extern s32 i2c_smbus_read_word_data(struct i2c_client * client, u8 command);
extern s32 i2c_smbus_write_word_data(struct i2c_client * client,
u8 command, u16 value);
+ extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
+ u8 command, u8 *values);
extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
u8 command, u8 length,
u8 *values);
extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
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:
-
- extern s32 i2c_smbus_read_block_data(struct i2c_client * client,
- u8 command, u8 *values);
extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
u8 command, u8 length,
u8 *values);
+
+These ones were removed from i2c-core because they had no users, but could
+be added back later if needed:
+
+ extern s32 i2c_smbus_write_quick(struct i2c_client * client, u8 value);
extern s32 i2c_smbus_process_call(struct i2c_client * client,
u8 command, u16 value);
extern s32 i2c_smbus_block_process_call(struct i2c_client *client,
u8 command, u8 length,
u8 *values)
-All these transactions return -1 on failure. The 'write' transactions
-return 0 on success; the 'read' transactions return the read value, except
-for read_block, which returns the number of values read. The block buffers
-need not be longer than 32 bytes.
+All these transactions return a negative errno value on failure. The 'write'
+transactions return 0 on success; the 'read' transactions return the read
+value, except for block transactions, which return the number of values
+read. The block buffers need not be longer than 32 bytes.
You can read the file `smbus-protocol' for more information about the
actual SMBus protocol.

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 1528e58..6198fa3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1686,6 +1686,13 @@ L: [email protected]
S: Maintained
+FREESCALE I2C CPM DRIVER
+P: Jochen Friedrich
+S: Maintained
+
FREESCALE SOC FS_ENET DRIVER
P: Pantelis Antoniou

arch/mips/sibyte/swarm/Makefile

View file
diff --git a/arch/mips/sibyte/swarm/Makefile b/arch/mips/sibyte/swarm/Makefile
index 1775755..255d692 100644
--- a/arch/mips/sibyte/swarm/Makefile
+++ b/arch/mips/sibyte/swarm/Makefile
@@ -1,3 +1,4 @@
obj-y := setup.o rtc_xicor1241.o rtc_m41t81.o
+obj-$(CONFIG_I2C_BOARDINFO) += swarm-i2c.o
obj-$(CONFIG_KGDB) += dbg_io.o

arch/mips/sibyte/swarm/swarm-i2c.c

View file
diff --git a/arch/mips/sibyte/swarm/swarm-i2c.c b/arch/mips/sibyte/swarm/swarm-i2c.c
new file mode 100644
index 0000000..4282ac9
--- /dev/null
+++ b/arch/mips/sibyte/swarm/swarm-i2c.c
@@ -0,0 +1,37 @@
+/*
+ * arch/mips/sibyte/swarm/swarm-i2c.c
+ *
+ * Broadcom BCM91250A (SWARM), etc. I2C platform setup.
+ *
+ * Copyright (c) 2008 Maciej W. Rozycki
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/i2c.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+
+
+static struct i2c_board_info swarm_i2c_info1[] __initdata = {
+ {
+ I2C_BOARD_INFO("m41t81", 0x68),
+ },
+};
+
+static int __init swarm_i2c_init(void)
+{
+ int err;
+
+ err = i2c_register_board_info(1, swarm_i2c_info1,
+ ARRAY_SIZE(swarm_i2c_info1));
+ if (err < 0)
+ printk(KERN_ERR
+ "swarm-i2c: cannot register board I2C devices\n");
+ return err;
+}
+
+arch_initcall(swarm_i2c_init);

drivers/i2c/algos/i2c-algo-bit.c

View file
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index 3581282..eb8f72c 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -320,7 +320,7 @@ static int try_address(struct i2c_adapter *i2c_adap,
unsigned char addr, int retries)
{
struct i2c_algo_bit_data *adap = i2c_adap->algo_data;
- int i, ret = -1;
+ int i, ret = 0;
for (i = 0; i <= retries; i++) {
ret = i2c_outb(i2c_adap, addr);
@@ -508,7 +508,7 @@ static int bit_doAddress(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
addr ^= 1;
ret = try_address(i2c_adap, addr, retries);
if ((ret != 1) && !nak_ok)
- return -EREMOTEIO;
+ return -ENXIO;
}
return 0;

drivers/i2c/algos/i2c-algo-pca.c

View file
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
index e954a20..d50b329 100644
--- a/drivers/i2c/algos/i2c-algo-pca.c
+++ b/drivers/i2c/algos/i2c-algo-pca.c
@@ -182,7 +182,7 @@ static int pca_xfer(struct i2c_adapter *i2c_adap,
}
if (state != 0xf8) {
dev_dbg(&i2c_adap->dev, "bus is not idle. status is %#04x\n", state);
- return -EIO;
+ return -EAGAIN;
}
DEB1("{{{ XFER %d messages\n", num);

drivers/i2c/algos/i2c-algo-pcf.c

View file
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c
index 8907b01..1e328d1 100644
--- a/drivers/i2c/algos/i2c-algo-pcf.c
+++ b/drivers/i2c/algos/i2c-algo-pcf.c
@@ -78,6 +78,36 @@ static void i2c_stop(struct i2c_algo_pcf_data *adap)
set_pcf(adap, 1, I2C_PCF_STOP);
}
+static void handle_lab(struct i2c_algo_pcf_data *adap, const int *status)
+{
+ DEB2(printk(KERN_INFO
+ "i2c-algo-pcf.o: lost arbitration (CSR 0x%02x)\n",
+ *status));
+
+ /* Cleanup from LAB -- reset and enable ESO.
+ * This resets the PCF8584; since we've lost the bus, no
+ * further attempts should be made by callers to clean up
+ * (no i2c_stop() etc.)
+ */
+ set_pcf(adap, 1, I2C_PCF_PIN);
+ set_pcf(adap, 1, I2C_PCF_ESO);
+
+ /* We pause for a time period sufficient for any running
+ * I2C transaction to complete -- the arbitration logic won't
+ * work properly until the next START is seen.
+ * It is assumed the bus driver or client has set a proper value.
+ *
+ * REVISIT: should probably use msleep instead of mdelay if we
+ * know we can sleep.
+ */
+ if (adap->lab_mdelay)
+ mdelay(adap->lab_mdelay);
+
+ DEB2(printk(KERN_INFO
+ "i2c-algo-pcf.o: reset LAB condition (CSR 0x%02x)\n",
+ get_pcf(adap, 1)));
+}
+
static int wait_for_bb(struct i2c_algo_pcf_data *adap) {
int timeout = DEF_TIMEOUT;
@@ -109,23 +139,7 @@ static int wait_for_pin(struct i2c_algo_pcf_data *adap, int *status) {
*status = get_pcf(adap, 1);
}
if (*status & I2C_PCF_LAB) {
- DEB2(printk(KERN_INFO
- "i2c-algo-pcf.o: lost arbitration (CSR 0x%02x)\n",
- *status));
- /* Cleanup from LAB-- reset and enable ESO.
- * This resets the PCF8584; since we've lost the bus, no
- * further attempts should be made by callers to clean up
- * (no i2c_stop() etc.)
- */
- set_pcf(adap, 1, I2C_PCF_PIN);
- set_pcf(adap, 1, I2C_PCF_ESO);
- /* TODO: we should pause for a time period sufficient for any
- * running I2C transaction to complete-- the arbitration
- * logic won't work properly until the next START is seen.
- */
- DEB2(printk(KERN_INFO
- "i2c-algo-pcf.o: reset LAB condition (CSR 0x%02x)\n",
- get_pcf(adap,1)));
+ handle_lab(adap, status);
return(-EINTR);
}
#endif

drivers/i2c/busses/Kconfig

View file
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 48438cc..6ee997b 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -4,6 +4,9 @@
menu "I2C Hardware Bus support"
+comment "PC SMBus host controller drivers"
+ depends on PCI
+
config I2C_ALI1535
tristate "ALI 1535"
depends on PCI
@@ -73,94 +76,6 @@ config I2C_AMD8111
This driver can also be built as a module. If so, the module
will be called i2c-amd8111.
-config I2C_AT91
- tristate "Atmel AT91 I2C Two-Wire interface (TWI)"
- depends on ARCH_AT91 && EXPERIMENTAL && BROKEN
- help
- This supports the use of the I2C interface on Atmel AT91
- processors.
-
- This driver is BROKEN because the controller which it uses
- will easily trigger RX overrun and TX underrun errors. Using
- low I2C clock rates may partially work around those issues
- on some systems. Another serious problem is that there is no
- documented way to issue repeated START conditions, as needed
- to support combined I2C messages. Use the i2c-gpio driver
- unless your system can cope with those limitations.
-
-config I2C_AU1550
- tristate "Au1550/Au1200 SMBus interface"
- depends on SOC_AU1550 || SOC_AU1200
- help
- If you say yes to this option, support will be included for the
- Au1550 and Au1200 SMBus interface.
-
- This driver can also be built as a module. If so, the module
- will be called i2c-au1550.
-
-config I2C_BLACKFIN_TWI
- tristate "Blackfin TWI I2C support"
- depends on BLACKFIN
- help
- This is the TWI I2C device driver for Blackfin BF522, BF525,
- BF527, BF534, BF536, BF537 and BF54x. For other Blackfin processors,
- please don't use this driver.
-
- This driver can also be built as a module. If so, the module

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ali1535.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ali1563.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ali15x3.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-amd756-s4882.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-amd756.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-amd8111.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-au1550.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-cpm.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-davinci.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-elektor.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-gpio.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-hydra.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-i801.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-i810.c

View before deletion

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ibm_iic.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-iop3xx.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-isch.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-mpc.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-mv64xxx.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-nforce2-s4985.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-nforce2.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-ocores.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-pasemi.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-pca-platform.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-piix4.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-pmcmsp.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-prosavage.c

View before deletion

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-pxa.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-s3c2410.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-savage4.c

View before deletion

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-sibyte.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-sis5595.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-sis630.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-sis96x.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-stub.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-taos-evm.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-via.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-viapro.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-voodoo3.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/scx200_acb.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/at24.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/eeprom.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/max6875.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/pca9539.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/pcf8574.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/chips/pcf8591.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/i2c-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/i2c-dev.c

View file

This diff is incomplete. Download the complete patch.

drivers/video/fb_ddc.c

View file

This diff is incomplete. Download the complete patch.

drivers/video/intelfb/intelfb_i2c.c

View file

This diff is incomplete. Download the complete patch.

drivers/video/matrox/i2c-matroxfb.c

View file

This diff is incomplete. Download the complete patch.

include/linux/i2c-algo-pcf.h

View file

This diff is incomplete. Download the complete patch.

include/linux/i2c-id.h

View file

This diff is incomplete. Download the complete patch.

include/linux/i2c.h

View file

This diff is incomplete. Download the complete patch.

include/linux/i2c/at24.h

View file

This diff is incomplete. Download the complete patch.