aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/feature-removal-schedule.txt11
-rw-r--r--Documentation/hwmon/abituguru32
-rw-r--r--Documentation/i2c/busses/i2c-sis96x4
-rw-r--r--MAINTAINERS14
-rw-r--r--drivers/hwmon/abituguru.c21
-rw-r--r--drivers/i2c/algos/i2c-algo-bit.c4
-rw-r--r--drivers/i2c/algos/i2c-algo-ite.c4
-rw-r--r--drivers/i2c/algos/i2c-algo-pca.c6
-rw-r--r--drivers/i2c/algos/i2c-algo-pcf.c8
-rw-r--r--drivers/i2c/algos/i2c-algo-sibyte.c4
-rw-r--r--drivers/i2c/busses/i2c-iop3xx.c17
-rw-r--r--drivers/i2c/busses/i2c-iop3xx.h2
-rw-r--r--drivers/i2c/busses/i2c-powermac.c4
-rw-r--r--drivers/i2c/busses/scx200_acb.c20
-rw-r--r--drivers/i2c/chips/pca9539.c12
-rw-r--r--drivers/i2c/i2c-core.c4
-rw-r--r--include/linux/i2c.h2
17 files changed, 118 insertions, 51 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 47d714d70821..9d3a0775a11d 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -247,3 +247,14 @@ Why: The interrupt related SA_* flags are replaced by IRQF_* to move them
247Who: Thomas Gleixner <tglx@linutronix.de> 247Who: Thomas Gleixner <tglx@linutronix.de>
248 248
249--------------------------- 249---------------------------
250
251What: i2c-ite and i2c-algo-ite drivers
252When: September 2006
253Why: These drivers never compiled since they were added to the kernel
254 tree 5 years ago. This feature removal can be reevaluated if
255 someone shows interest in the drivers, fixes them and takes over
256 maintenance.
257 http://marc.theaimsgroup.com/?l=linux-mips&m=115040510817448
258Who: Jean Delvare <khali@linux-fr.org>
259
260---------------------------
diff --git a/Documentation/hwmon/abituguru b/Documentation/hwmon/abituguru
index 69cdb527d58f..b2c0d61b39a2 100644
--- a/Documentation/hwmon/abituguru
+++ b/Documentation/hwmon/abituguru
@@ -2,13 +2,36 @@ Kernel driver abituguru
2======================= 2=======================
3 3
4Supported chips: 4Supported chips:
5 * Abit uGuru (Hardware Monitor part only) 5 * Abit uGuru revision 1-3 (Hardware Monitor part only)
6 Prefix: 'abituguru' 6 Prefix: 'abituguru'
7 Addresses scanned: ISA 0x0E0 7 Addresses scanned: ISA 0x0E0
8 Datasheet: Not available, this driver is based on reverse engineering. 8 Datasheet: Not available, this driver is based on reverse engineering.
9 A "Datasheet" has been written based on the reverse engineering it 9 A "Datasheet" has been written based on the reverse engineering it
10 should be available in the same dir as this file under the name 10 should be available in the same dir as this file under the name
11 abituguru-datasheet. 11 abituguru-datasheet.
12 Note:
13 The uGuru is a microcontroller with onboard firmware which programs
14 it to behave as a hwmon IC. There are many different revisions of the
15 firmware and thus effectivly many different revisions of the uGuru.
16 Below is an incomplete list with which revisions are used for which
17 Motherboards:
18 uGuru 1.00 ~ 1.24 (AI7, KV8-MAX3, AN7) (1)
19 uGuru 2.0.0.0 ~ 2.0.4.2 (KV8-PRO)
20 uGuru 2.1.0.0 ~ 2.1.2.8 (AS8, AV8, AA8, AG8, AA8XE, AX8)
21 uGuru 2.2.0.0 ~ 2.2.0.6 (AA8 Fatal1ty)
22 uGuru 2.3.0.0 ~ 2.3.0.9 (AN8)
23 uGuru 3.0.0.0 ~ 3.0.1.2 (AW8, AL8, NI8)
24 uGuru 4.xxxxx? (AT8 32X) (2)
25 1) For revisions 2 and 3 uGuru's the driver can autodetect the
26 sensortype (Volt or Temp) for bank1 sensors, for revision 1 uGuru's
27 this doesnot always work. For these uGuru's the autodection can
28 be overriden with the bank1_types module param. For all 3 known
29 revison 1 motherboards the correct use of this param is:
30 bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1
31 You may also need to specify the fan_sensors option for these boards
32 fan_sensors=5
33 2) The current version of the abituguru driver is known to NOT work
34 on these Motherboards
12 35
13Authors: 36Authors:
14 Hans de Goede <j.w.r.degoede@hhs.nl>, 37 Hans de Goede <j.w.r.degoede@hhs.nl>,
@@ -22,6 +45,11 @@ Module Parameters
22* force: bool Force detection. Note this parameter only causes the 45* force: bool Force detection. Note this parameter only causes the
23 detection to be skipped, if the uGuru can't be read 46 detection to be skipped, if the uGuru can't be read
24 the module initialization (insmod) will still fail. 47 the module initialization (insmod) will still fail.
48* bank1_types: int[] Bank1 sensortype autodetection override:
49 -1 autodetect (default)
50 0 volt sensor
51 1 temp sensor
52 2 not connected
25* fan_sensors: int Tell the driver how many fan speed sensors there are 53* fan_sensors: int Tell the driver how many fan speed sensors there are
26 on your motherboard. Default: 0 (autodetect). 54 on your motherboard. Default: 0 (autodetect).
27* pwms: int Tell the driver how many fan speed controls (fan 55* pwms: int Tell the driver how many fan speed controls (fan
@@ -29,7 +57,7 @@ Module Parameters
29* verbose: int How verbose should the driver be? (0-3): 57* verbose: int How verbose should the driver be? (0-3):
30 0 normal output 58 0 normal output
31 1 + verbose error reporting 59 1 + verbose error reporting
32 2 + sensors type probing info\n" 60 2 + sensors type probing info (default)
33 3 + retryable error reporting 61 3 + retryable error reporting
34 Default: 2 (the driver is still in the testing phase) 62 Default: 2 (the driver is still in the testing phase)
35 63
diff --git a/Documentation/i2c/busses/i2c-sis96x b/Documentation/i2c/busses/i2c-sis96x
index 00a009b977e9..08d7b2dac69a 100644
--- a/Documentation/i2c/busses/i2c-sis96x
+++ b/Documentation/i2c/busses/i2c-sis96x
@@ -42,8 +42,8 @@ I suspect that this driver could be made to work for the following SiS
42chipsets as well: 635, and 635T. If anyone owns a board with those chips 42chipsets as well: 635, and 635T. If anyone owns a board with those chips
43AND is willing to risk crashing & burning an otherwise well-behaved kernel 43AND is willing to risk crashing & burning an otherwise well-behaved kernel
44in the name of progress... please contact me at <mhoffman@lightlink.com> or 44in the name of progress... please contact me at <mhoffman@lightlink.com> or
45via the project's mailing list: <lm-sensors@lm-sensors.org>. Please 45via the project's mailing list: <i2c@lm-sensors.org>. Please send bug
46send bug reports and/or success stories as well. 46reports and/or success stories as well.
47 47
48 48
49TO DOs 49TO DOs
diff --git a/MAINTAINERS b/MAINTAINERS
index 491e034f3475..5276d52c3fc5 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -274,7 +274,7 @@ S: Maintained
274ALI1563 I2C DRIVER 274ALI1563 I2C DRIVER
275P: Rudolf Marek 275P: Rudolf Marek
276M: r.marek@sh.cvut.cz 276M: r.marek@sh.cvut.cz
277L: lm-sensors@lm-sensors.org 277L: i2c@lm-sensors.org
278S: Maintained 278S: Maintained
279 279
280ALPHA PORT 280ALPHA PORT
@@ -1249,7 +1249,7 @@ S: Maintained
1249I2C SUBSYSTEM 1249I2C SUBSYSTEM
1250P: Jean Delvare 1250P: Jean Delvare
1251M: khali@linux-fr.org 1251M: khali@linux-fr.org
1252L: lm-sensors@lm-sensors.org 1252L: i2c@lm-sensors.org
1253W: http://www.lm-sensors.nu/ 1253W: http://www.lm-sensors.nu/
1254T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ 1254T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
1255S: Maintained 1255S: Maintained
@@ -2093,7 +2093,7 @@ S: Maintained
2093OPENCORES I2C BUS DRIVER 2093OPENCORES I2C BUS DRIVER
2094P: Peter Korsgaard 2094P: Peter Korsgaard
2095M: jacmet@sunsite.dk 2095M: jacmet@sunsite.dk
2096L: lm-sensors@lm-sensors.org 2096L: i2c@lm-sensors.org
2097S: Maintained 2097S: Maintained
2098 2098
2099ORACLE CLUSTER FILESYSTEM 2 (OCFS2) 2099ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
@@ -3132,7 +3132,7 @@ S: Maintained
3132VIAPRO SMBUS DRIVER 3132VIAPRO SMBUS DRIVER
3133P: Jean Delvare 3133P: Jean Delvare
3134M: khali@linux-fr.org 3134M: khali@linux-fr.org
3135L: lm-sensors@lm-sensors.org 3135L: i2c@lm-sensors.org
3136S: Maintained 3136S: Maintained
3137 3137
3138UCLINUX (AND M68KNOMMU) 3138UCLINUX (AND M68KNOMMU)
@@ -3182,6 +3182,12 @@ P: Evgeniy Polyakov
3182M: johnpol@2ka.mipt.ru 3182M: johnpol@2ka.mipt.ru
3183S: Maintained 3183S: Maintained
3184 3184
3185W83791D HARDWARE MONITORING DRIVER
3186P: Charles Spirakis
3187M: bezaur@gmail.com
3188L: lm-sensors@lm-sensors.org
3189S: Maintained
3190
3185W83L51xD SD/MMC CARD INTERFACE DRIVER 3191W83L51xD SD/MMC CARD INTERFACE DRIVER
3186P: Pierre Ossman 3192P: Pierre Ossman
3187M: drzeus-wbsd@drzeus.cx 3193M: drzeus-wbsd@drzeus.cx
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index 59122cc0a50a..cc15c4f2e9ec 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -142,6 +142,14 @@ static const u8 abituguru_pwm_max[5] = { 0, 255, 255, 75, 75 };
142static int force; 142static int force;
143module_param(force, bool, 0); 143module_param(force, bool, 0);
144MODULE_PARM_DESC(force, "Set to one to force detection."); 144MODULE_PARM_DESC(force, "Set to one to force detection.");
145static int bank1_types[ABIT_UGURU_MAX_BANK1_SENSORS] = { -1, -1, -1, -1, -1,
146 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
147module_param_array(bank1_types, int, NULL, 0);
148MODULE_PARM_DESC(bank1_types, "Bank1 sensortype autodetection override:\n"
149 " -1 autodetect\n"
150 " 0 volt sensor\n"
151 " 1 temp sensor\n"
152 " 2 not connected");
145static int fan_sensors; 153static int fan_sensors;
146module_param(fan_sensors, int, 0); 154module_param(fan_sensors, int, 0);
147MODULE_PARM_DESC(fan_sensors, "Number of fan sensors on the uGuru " 155MODULE_PARM_DESC(fan_sensors, "Number of fan sensors on the uGuru "
@@ -397,6 +405,15 @@ abituguru_detect_bank1_sensor_type(struct abituguru_data *data,
397 u8 val, buf[3]; 405 u8 val, buf[3];
398 int ret = ABIT_UGURU_NC; 406 int ret = ABIT_UGURU_NC;
399 407
408 /* If overriden by the user return the user selected type */
409 if (bank1_types[sensor_addr] >= ABIT_UGURU_IN_SENSOR &&
410 bank1_types[sensor_addr] <= ABIT_UGURU_NC) {
411 ABIT_UGURU_DEBUG(2, "assuming sensor type %d for bank1 sensor "
412 "%d because of \"bank1_types\" module param\n",
413 bank1_types[sensor_addr], (int)sensor_addr);
414 return bank1_types[sensor_addr];
415 }
416
400 /* First read the sensor and the current settings */ 417 /* First read the sensor and the current settings */
401 if (abituguru_read(data, ABIT_UGURU_SENSOR_BANK1, sensor_addr, &val, 418 if (abituguru_read(data, ABIT_UGURU_SENSOR_BANK1, sensor_addr, &val,
402 1, ABIT_UGURU_MAX_RETRIES) != 1) 419 1, ABIT_UGURU_MAX_RETRIES) != 1)
@@ -514,7 +531,7 @@ abituguru_detect_no_bank2_sensors(struct abituguru_data *data)
514{ 531{
515 int i; 532 int i;
516 533
517 if (fan_sensors) { 534 if (fan_sensors > 0 && fan_sensors <= ABIT_UGURU_MAX_BANK2_SENSORS) {
518 data->bank2_sensors = fan_sensors; 535 data->bank2_sensors = fan_sensors;
519 ABIT_UGURU_DEBUG(2, "assuming %d fan sensors because of " 536 ABIT_UGURU_DEBUG(2, "assuming %d fan sensors because of "
520 "\"fan_sensors\" module param\n", 537 "\"fan_sensors\" module param\n",
@@ -568,7 +585,7 @@ abituguru_detect_no_pwms(struct abituguru_data *data)
568{ 585{
569 int i, j; 586 int i, j;
570 587
571 if (pwms) { 588 if (pwms > 0 && pwms <= ABIT_UGURU_MAX_PWMS) {
572 data->pwms = pwms; 589 data->pwms = pwms;
573 ABIT_UGURU_DEBUG(2, "assuming %d PWM outputs because of " 590 ABIT_UGURU_DEBUG(2, "assuming %d PWM outputs because of "
574 "\"pwms\" module param\n", (int)data->pwms); 591 "\"pwms\" module param\n", (int)data->pwms);
diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index df05df1a0ef6..ab230c033f99 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -372,7 +372,6 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
372 372
373 while (count > 0) { 373 while (count > 0) {
374 inval = i2c_inb(i2c_adap); 374 inval = i2c_inb(i2c_adap);
375/*printk("%#02x ",inval); if ( ! (count % 16) ) printk("\n"); */
376 if (inval>=0) { 375 if (inval>=0) {
377 *temp = inval; 376 *temp = inval;
378 rdcount++; 377 rdcount++;
@@ -544,8 +543,7 @@ int i2c_bit_add_bus(struct i2c_adapter *adap)
544 adap->timeout = 100; /* default values, should */ 543 adap->timeout = 100; /* default values, should */
545 adap->retries = 3; /* be replaced by defines */ 544 adap->retries = 3; /* be replaced by defines */
546 545
547 i2c_add_adapter(adap); 546 return i2c_add_adapter(adap);
548 return 0;
549} 547}
550 548
551 549
diff --git a/drivers/i2c/algos/i2c-algo-ite.c b/drivers/i2c/algos/i2c-algo-ite.c
index 2db7bfc85225..70d8eefb5efc 100644
--- a/drivers/i2c/algos/i2c-algo-ite.c
+++ b/drivers/i2c/algos/i2c-algo-ite.c
@@ -742,10 +742,8 @@ int i2c_iic_add_bus(struct i2c_adapter *adap)
742 adap->retries = 3; /* be replaced by defines */ 742 adap->retries = 3; /* be replaced by defines */
743 adap->flags = 0; 743 adap->flags = 0;
744 744
745 i2c_add_adapter(adap);
746 iic_init(iic_adap); 745 iic_init(iic_adap);
747 746 return i2c_add_adapter(adap);
748 return 0;
749} 747}
750 748
751 749
diff --git a/drivers/i2c/algos/i2c-algo-pca.c b/drivers/i2c/algos/i2c-algo-pca.c
index 82946acab4c7..b88a6fcf7bd0 100644
--- a/drivers/i2c/algos/i2c-algo-pca.c
+++ b/drivers/i2c/algos/i2c-algo-pca.c
@@ -374,10 +374,10 @@ int i2c_pca_add_bus(struct i2c_adapter *adap)
374 adap->timeout = 100; /* default values, should */ 374 adap->timeout = 100; /* default values, should */
375 adap->retries = 3; /* be replaced by defines */ 375 adap->retries = 3; /* be replaced by defines */
376 376
377 rval = pca_init(pca_adap); 377 if ((rval = pca_init(pca_adap)))
378 return rval;
378 379
379 if (!rval) 380 rval = i2c_add_adapter(adap);
380 i2c_add_adapter(adap);
381 381
382 return rval; 382 return rval;
383} 383}
diff --git a/drivers/i2c/algos/i2c-algo-pcf.c b/drivers/i2c/algos/i2c-algo-pcf.c
index 6e498df1f717..5b24930adb5a 100644
--- a/drivers/i2c/algos/i2c-algo-pcf.c
+++ b/drivers/i2c/algos/i2c-algo-pcf.c
@@ -479,9 +479,11 @@ int i2c_pcf_add_bus(struct i2c_adapter *adap)
479 adap->timeout = 100; /* default values, should */ 479 adap->timeout = 100; /* default values, should */
480 adap->retries = 3; /* be replaced by defines */ 480 adap->retries = 3; /* be replaced by defines */
481 481
482 rval = pcf_init_8584(pcf_adap); 482 if ((rval = pcf_init_8584(pcf_adap)))
483 if (!rval) 483 return rval;
484 i2c_add_adapter(adap); 484
485 rval = i2c_add_adapter(adap);
486
485 return rval; 487 return rval;
486} 488}
487 489
diff --git a/drivers/i2c/algos/i2c-algo-sibyte.c b/drivers/i2c/algos/i2c-algo-sibyte.c
index 3df3f09995c2..32d41c6fac0f 100644
--- a/drivers/i2c/algos/i2c-algo-sibyte.c
+++ b/drivers/i2c/algos/i2c-algo-sibyte.c
@@ -173,9 +173,7 @@ int i2c_sibyte_add_bus(struct i2c_adapter *i2c_adap, int speed)
173 printk("\n"); 173 printk("\n");
174 } 174 }
175 175
176 i2c_add_adapter(i2c_adap); 176 return i2c_add_adapter(i2c_adap);
177
178 return 0;
179} 177}
180 178
181 179
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
index aca7e1668605..48c56939c861 100644
--- a/drivers/i2c/busses/i2c-iop3xx.c
+++ b/drivers/i2c/busses/i2c-iop3xx.c
@@ -21,6 +21,9 @@
21 * - Make it work with IXP46x chips 21 * - Make it work with IXP46x chips
22 * - Cleanup function names, coding style, etc 22 * - Cleanup function names, coding style, etc
23 * 23 *
24 * - writing to slave address causes latchup on iop331.
25 * fix: driver refuses to address self.
26 *
24 * This program is free software; you can redistribute it and/or modify 27 * This program is free software; you can redistribute it and/or modify
25 * it under the terms of the GNU General Public License as published by 28 * it under the terms of the GNU General Public License as published by
26 * the Free Software Foundation, version 2. 29 * the Free Software Foundation, version 2.
@@ -73,12 +76,6 @@ iop3xx_i2c_reset(struct i2c_algo_iop3xx_data *iop3xx_adap)
73} 76}
74 77
75static void 78static void
76iop3xx_i2c_set_slave_addr(struct i2c_algo_iop3xx_data *iop3xx_adap)
77{
78 __raw_writel(MYSAR, iop3xx_adap->ioaddr + SAR_OFFSET);
79}
80
81static void
82iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap) 79iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap)
83{ 80{
84 u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE; 81 u32 cr = IOP3XX_ICR_GCD | IOP3XX_ICR_SCLEN | IOP3XX_ICR_UE;
@@ -248,6 +245,13 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap,
248 int status; 245 int status;
249 int rc; 246 int rc;
250 247
248 /* avoid writing to my slave address (hangs on 80331),
249 * forbidden in Intel developer manual
250 */
251 if (msg->addr == MYSAR) {
252 return -EBUSY;
253 }
254
251 __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET); 255 __raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET);
252 256
253 cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK); 257 cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK);
@@ -498,7 +502,6 @@ iop3xx_i2c_probe(struct platform_device *pdev)
498 spin_lock_init(&adapter_data->lock); 502 spin_lock_init(&adapter_data->lock);
499 503
500 iop3xx_i2c_reset(adapter_data); 504 iop3xx_i2c_reset(adapter_data);
501 iop3xx_i2c_set_slave_addr(adapter_data);
502 iop3xx_i2c_enable(adapter_data); 505 iop3xx_i2c_enable(adapter_data);
503 506
504 platform_set_drvdata(pdev, new_adapter); 507 platform_set_drvdata(pdev, new_adapter);
diff --git a/drivers/i2c/busses/i2c-iop3xx.h b/drivers/i2c/busses/i2c-iop3xx.h
index e46ebaea7b1e..8485861f6a36 100644
--- a/drivers/i2c/busses/i2c-iop3xx.h
+++ b/drivers/i2c/busses/i2c-iop3xx.h
@@ -80,7 +80,7 @@
80#define IOP3XX_GPOD_I2C0 0x00c0 /* clear these bits to enable ch0 */ 80#define IOP3XX_GPOD_I2C0 0x00c0 /* clear these bits to enable ch0 */
81#define IOP3XX_GPOD_I2C1 0x0030 /* clear these bits to enable ch1 */ 81#define IOP3XX_GPOD_I2C1 0x0030 /* clear these bits to enable ch1 */
82 82
83#define MYSAR 0x02 /* SWAG a suitable slave address */ 83#define MYSAR 0 /* default slave address */
84 84
85#define I2C_ERR 321 85#define I2C_ERR 321
86#define I2C_ERR_BERR (I2C_ERR+0) 86#define I2C_ERR_BERR (I2C_ERR+0)
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c
index 2a0b3be7cdd0..53bb43593863 100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
@@ -148,8 +148,6 @@ static int i2c_powermac_master_xfer( struct i2c_adapter *adap,
148 int read; 148 int read;
149 int addrdir; 149 int addrdir;
150 150
151 if (num != 1)
152 return -EINVAL;
153 if (msgs->flags & I2C_M_TEN) 151 if (msgs->flags & I2C_M_TEN)
154 return -EINVAL; 152 return -EINVAL;
155 read = (msgs->flags & I2C_M_RD) != 0; 153 read = (msgs->flags & I2C_M_RD) != 0;
@@ -166,7 +164,7 @@ static int i2c_powermac_master_xfer( struct i2c_adapter *adap,
166 rc = pmac_i2c_xfer(bus, addrdir, 0, 0, msgs->buf, msgs->len); 164 rc = pmac_i2c_xfer(bus, addrdir, 0, 0, msgs->buf, msgs->len);
167 bail: 165 bail:
168 pmac_i2c_close(bus); 166 pmac_i2c_close(bus);
169 return rc < 0 ? rc : msgs->len; 167 return rc < 0 ? rc : 1;
170} 168}
171 169
172static u32 i2c_powermac_func(struct i2c_adapter * adapter) 170static u32 i2c_powermac_func(struct i2c_adapter * adapter)
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c
index 22a3eda04166..ced309ff056f 100644
--- a/drivers/i2c/busses/scx200_acb.c
+++ b/drivers/i2c/busses/scx200_acb.c
@@ -184,21 +184,21 @@ static void scx200_acb_machine(struct scx200_acb_iface *iface, u8 status)
184 break; 184 break;
185 185
186 case state_read: 186 case state_read:
187 /* Set ACK if receiving the last byte */ 187 /* Set ACK if _next_ byte will be the last one */
188 if (iface->len == 1) 188 if (iface->len == 2)
189 outb(inb(ACBCTL1) | ACBCTL1_ACK, ACBCTL1); 189 outb(inb(ACBCTL1) | ACBCTL1_ACK, ACBCTL1);
190 else 190 else
191 outb(inb(ACBCTL1) & ~ACBCTL1_ACK, ACBCTL1); 191 outb(inb(ACBCTL1) & ~ACBCTL1_ACK, ACBCTL1);
192 192
193 *iface->ptr++ = inb(ACBSDA); 193 if (iface->len == 1) {
194 --iface->len;
195
196 if (iface->len == 0) {
197 iface->result = 0; 194 iface->result = 0;
198 iface->state = state_idle; 195 iface->state = state_idle;
199 outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1); 196 outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1);
200 } 197 }
201 198
199 *iface->ptr++ = inb(ACBSDA);
200 --iface->len;
201
202 break; 202 break;
203 203
204 case state_write: 204 case state_write:
@@ -307,8 +307,12 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter,
307 buffer = (u8 *)&cur_word; 307 buffer = (u8 *)&cur_word;
308 break; 308 break;
309 309
310 case I2C_SMBUS_BLOCK_DATA: 310 case I2C_SMBUS_I2C_BLOCK_DATA:
311 if (rw == I2C_SMBUS_READ)
312 data->block[0] = I2C_SMBUS_BLOCK_MAX; /* For now */
311 len = data->block[0]; 313 len = data->block[0];
314 if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
315 return -EINVAL;
312 buffer = &data->block[1]; 316 buffer = &data->block[1];
313 break; 317 break;
314 318
@@ -372,7 +376,7 @@ static u32 scx200_acb_func(struct i2c_adapter *adapter)
372{ 376{
373 return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | 377 return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
374 I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | 378 I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
375 I2C_FUNC_SMBUS_BLOCK_DATA; 379 I2C_FUNC_SMBUS_I2C_BLOCK;
376} 380}
377 381
378/* For now, we only handle combined mode (smbus) */ 382/* For now, we only handle combined mode (smbus) */
diff --git a/drivers/i2c/chips/pca9539.c b/drivers/i2c/chips/pca9539.c
index 54b6e6a4beed..cb22280cdd27 100644
--- a/drivers/i2c/chips/pca9539.c
+++ b/drivers/i2c/chips/pca9539.c
@@ -134,11 +134,13 @@ static int pca9539_detect(struct i2c_adapter *adapter, int address, int kind)
134 new_client->driver = &pca9539_driver; 134 new_client->driver = &pca9539_driver;
135 new_client->flags = 0; 135 new_client->flags = 0;
136 136
137 /* Detection: the pca9539 only has 8 registers (0-7). 137 if (kind < 0) {
138 A read of 7 should succeed, but a read of 8 should fail. */ 138 /* Detection: the pca9539 only has 8 registers (0-7).
139 if ((i2c_smbus_read_byte_data(new_client, 7) < 0) || 139 A read of 7 should succeed, but a read of 8 should fail. */
140 (i2c_smbus_read_byte_data(new_client, 8) >= 0)) 140 if ((i2c_smbus_read_byte_data(new_client, 7) < 0) ||
141 goto exit_kfree; 141 (i2c_smbus_read_byte_data(new_client, 8) >= 0))
142 goto exit_kfree;
143 }
142 144
143 strlcpy(new_client->name, "pca9539", I2C_NAME_SIZE); 145 strlcpy(new_client->name, "pca9539", I2C_NAME_SIZE);
144 146
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index a45155f799d4..9cb277d6aa48 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -756,9 +756,9 @@ int i2c_probe(struct i2c_adapter *adapter,
756 "parameter for adapter %d, " 756 "parameter for adapter %d, "
757 "addr 0x%02x\n", adap_id, 757 "addr 0x%02x\n", adap_id,
758 address_data->ignore[j + 1]); 758 address_data->ignore[j + 1]);
759 ignore = 1;
760 break;
759 } 761 }
760 ignore = 1;
761 break;
762 } 762 }
763 if (ignore) 763 if (ignore)
764 continue; 764 continue;
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 526ddc8eecfb..eb0628a7ecc6 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -193,6 +193,8 @@ struct i2c_algorithm {
193 to NULL. If an adapter algorithm can do SMBus access, set 193 to NULL. If an adapter algorithm can do SMBus access, set
194 smbus_xfer. If set to NULL, the SMBus protocol is simulated 194 smbus_xfer. If set to NULL, the SMBus protocol is simulated
195 using common I2C messages */ 195 using common I2C messages */
196 /* master_xfer should return the number of messages successfully
197 processed, or a negative value on error */
196 int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, 198 int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs,
197 int num); 199 int num);
198 int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, 200 int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,