Merge commit master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6 of HEAD

* HEAD:
  [PATCH] hwmon: Documentation update for abituguru
  [PATCH] hwmon: Fix for first generation Abit uGuru chips
  [PATCH] hwmon: New maintainer for w83791d
  [PATCH] pca9539: Honor the force parameter
  [PATCH] i2c-algo-bit: Wipe out dead code
  [PATCH] i2c: Handle i2c_add_adapter failure in i2c algorithm drivers
  [PATCH] i2c: New mailing list
  [PATCH] i2c-ite: Plan for removal
  [PATCH] i2c-powermac: Fix master_xfer return value
  [PATCH] scx200_acb: Fix the block transactions
  [PATCH] scx200_acb: Fix the state machine
  [PATCH] i2c-iop3xx: Avoid addressing self
  [PATCH] i2c: Fix 'ignore' module parameter handling in i2c-core
This commit is contained in:
Linus Torvalds 2006-07-12 21:19:23 -07:00
commit a0486407be
17 changed files with 118 additions and 51 deletions

View File

@ -247,3 +247,14 @@ Why: The interrupt related SA_* flags are replaced by IRQF_* to move them
Who: Thomas Gleixner <tglx@linutronix.de>
---------------------------
What: i2c-ite and i2c-algo-ite drivers
When: September 2006
Why: These drivers never compiled since they were added to the kernel
tree 5 years ago. This feature removal can be reevaluated if
someone shows interest in the drivers, fixes them and takes over
maintenance.
http://marc.theaimsgroup.com/?l=linux-mips&m=115040510817448
Who: Jean Delvare <khali@linux-fr.org>
---------------------------

View File

@ -2,13 +2,36 @@ Kernel driver abituguru
=======================
Supported chips:
* Abit uGuru (Hardware Monitor part only)
* Abit uGuru revision 1-3 (Hardware Monitor part only)
Prefix: 'abituguru'
Addresses scanned: ISA 0x0E0
Datasheet: Not available, this driver is based on reverse engineering.
A "Datasheet" has been written based on the reverse engineering it
should be available in the same dir as this file under the name
abituguru-datasheet.
Note:
The uGuru is a microcontroller with onboard firmware which programs
it to behave as a hwmon IC. There are many different revisions of the
firmware and thus effectivly many different revisions of the uGuru.
Below is an incomplete list with which revisions are used for which
Motherboards:
uGuru 1.00 ~ 1.24 (AI7, KV8-MAX3, AN7) (1)
uGuru 2.0.0.0 ~ 2.0.4.2 (KV8-PRO)
uGuru 2.1.0.0 ~ 2.1.2.8 (AS8, AV8, AA8, AG8, AA8XE, AX8)
uGuru 2.2.0.0 ~ 2.2.0.6 (AA8 Fatal1ty)
uGuru 2.3.0.0 ~ 2.3.0.9 (AN8)
uGuru 3.0.0.0 ~ 3.0.1.2 (AW8, AL8, NI8)
uGuru 4.xxxxx? (AT8 32X) (2)
1) For revisions 2 and 3 uGuru's the driver can autodetect the
sensortype (Volt or Temp) for bank1 sensors, for revision 1 uGuru's
this doesnot always work. For these uGuru's the autodection can
be overriden with the bank1_types module param. For all 3 known
revison 1 motherboards the correct use of this param is:
bank1_types=1,1,0,0,0,0,0,2,0,0,0,0,2,0,0,1
You may also need to specify the fan_sensors option for these boards
fan_sensors=5
2) The current version of the abituguru driver is known to NOT work
on these Motherboards
Authors:
Hans de Goede <j.w.r.degoede@hhs.nl>,
@ -22,6 +45,11 @@ Module Parameters
* force: bool Force detection. Note this parameter only causes the
detection to be skipped, if the uGuru can't be read
the module initialization (insmod) will still fail.
* bank1_types: int[] Bank1 sensortype autodetection override:
-1 autodetect (default)
0 volt sensor
1 temp sensor
2 not connected
* fan_sensors: int Tell the driver how many fan speed sensors there are
on your motherboard. Default: 0 (autodetect).
* pwms: int Tell the driver how many fan speed controls (fan
@ -29,7 +57,7 @@ Module Parameters
* verbose: int How verbose should the driver be? (0-3):
0 normal output
1 + verbose error reporting
2 + sensors type probing info\n"
2 + sensors type probing info (default)
3 + retryable error reporting
Default: 2 (the driver is still in the testing phase)

View File

@ -42,8 +42,8 @@ I suspect that this driver could be made to work for the following SiS
chipsets as well: 635, and 635T. If anyone owns a board with those chips
AND is willing to risk crashing & burning an otherwise well-behaved kernel
in the name of progress... please contact me at <mhoffman@lightlink.com> or
via the project's mailing list: <lm-sensors@lm-sensors.org>. Please
send bug reports and/or success stories as well.
via the project's mailing list: <i2c@lm-sensors.org>. Please send bug
reports and/or success stories as well.
TO DOs

View File

@ -274,7 +274,7 @@ S: Maintained
ALI1563 I2C DRIVER
P: Rudolf Marek
M: r.marek@sh.cvut.cz
L: lm-sensors@lm-sensors.org
L: i2c@lm-sensors.org
S: Maintained
ALPHA PORT
@ -1249,7 +1249,7 @@ S: Maintained
I2C SUBSYSTEM
P: Jean Delvare
M: khali@linux-fr.org
L: lm-sensors@lm-sensors.org
L: i2c@lm-sensors.org
W: http://www.lm-sensors.nu/
T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
S: Maintained
@ -2093,7 +2093,7 @@ S: Maintained
OPENCORES I2C BUS DRIVER
P: Peter Korsgaard
M: jacmet@sunsite.dk
L: lm-sensors@lm-sensors.org
L: i2c@lm-sensors.org
S: Maintained
ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
@ -3132,7 +3132,7 @@ S: Maintained
VIAPRO SMBUS DRIVER
P: Jean Delvare
M: khali@linux-fr.org
L: lm-sensors@lm-sensors.org
L: i2c@lm-sensors.org
S: Maintained
UCLINUX (AND M68KNOMMU)
@ -3182,6 +3182,12 @@ P: Evgeniy Polyakov
M: johnpol@2ka.mipt.ru
S: Maintained
W83791D HARDWARE MONITORING DRIVER
P: Charles Spirakis
M: bezaur@gmail.com
L: lm-sensors@lm-sensors.org
S: Maintained
W83L51xD SD/MMC CARD INTERFACE DRIVER
P: Pierre Ossman
M: drzeus-wbsd@drzeus.cx

View File

@ -142,6 +142,14 @@ static const u8 abituguru_pwm_max[5] = { 0, 255, 255, 75, 75 };
static int force;
module_param(force, bool, 0);
MODULE_PARM_DESC(force, "Set to one to force detection.");
static int bank1_types[ABIT_UGURU_MAX_BANK1_SENSORS] = { -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
module_param_array(bank1_types, int, NULL, 0);
MODULE_PARM_DESC(bank1_types, "Bank1 sensortype autodetection override:\n"
" -1 autodetect\n"
" 0 volt sensor\n"
" 1 temp sensor\n"
" 2 not connected");
static int fan_sensors;
module_param(fan_sensors, int, 0);
MODULE_PARM_DESC(fan_sensors, "Number of fan sensors on the uGuru "
@ -397,6 +405,15 @@ abituguru_detect_bank1_sensor_type(struct abituguru_data *data,
u8 val, buf[3];
int ret = ABIT_UGURU_NC;
/* If overriden by the user return the user selected type */
if (bank1_types[sensor_addr] >= ABIT_UGURU_IN_SENSOR &&
bank1_types[sensor_addr] <= ABIT_UGURU_NC) {
ABIT_UGURU_DEBUG(2, "assuming sensor type %d for bank1 sensor "
"%d because of \"bank1_types\" module param\n",
bank1_types[sensor_addr], (int)sensor_addr);
return bank1_types[sensor_addr];
}
/* First read the sensor and the current settings */
if (abituguru_read(data, ABIT_UGURU_SENSOR_BANK1, sensor_addr, &val,
1, ABIT_UGURU_MAX_RETRIES) != 1)
@ -514,7 +531,7 @@ abituguru_detect_no_bank2_sensors(struct abituguru_data *data)
{
int i;
if (fan_sensors) {
if (fan_sensors > 0 && fan_sensors <= ABIT_UGURU_MAX_BANK2_SENSORS) {
data->bank2_sensors = fan_sensors;
ABIT_UGURU_DEBUG(2, "assuming %d fan sensors because of "
"\"fan_sensors\" module param\n",
@ -568,7 +585,7 @@ abituguru_detect_no_pwms(struct abituguru_data *data)
{
int i, j;
if (pwms) {
if (pwms > 0 && pwms <= ABIT_UGURU_MAX_PWMS) {
data->pwms = pwms;
ABIT_UGURU_DEBUG(2, "assuming %d PWM outputs because of "
"\"pwms\" module param\n", (int)data->pwms);

View File

@ -372,7 +372,6 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
while (count > 0) {
inval = i2c_inb(i2c_adap);
/*printk("%#02x ",inval); if ( ! (count % 16) ) printk("\n"); */
if (inval>=0) {
*temp = inval;
rdcount++;
@ -544,8 +543,7 @@ int i2c_bit_add_bus(struct i2c_adapter *adap)
adap->timeout = 100; /* default values, should */
adap->retries = 3; /* be replaced by defines */
i2c_add_adapter(adap);
return 0;
return i2c_add_adapter(adap);
}

View File

@ -742,10 +742,8 @@ int i2c_iic_add_bus(struct i2c_adapter *adap)
adap->retries = 3; /* be replaced by defines */
adap->flags = 0;
i2c_add_adapter(adap);
iic_init(iic_adap);
return 0;
return i2c_add_adapter(adap);
}

View File

@ -374,10 +374,10 @@ int i2c_pca_add_bus(struct i2c_adapter *adap)
adap->timeout = 100; /* default values, should */
adap->retries = 3; /* be replaced by defines */
rval = pca_init(pca_adap);
if ((rval = pca_init(pca_adap)))
return rval;
if (!rval)
i2c_add_adapter(adap);
rval = i2c_add_adapter(adap);
return rval;
}

View File

@ -479,9 +479,11 @@ int i2c_pcf_add_bus(struct i2c_adapter *adap)
adap->timeout = 100; /* default values, should */
adap->retries = 3; /* be replaced by defines */
rval = pcf_init_8584(pcf_adap);
if (!rval)
i2c_add_adapter(adap);
if ((rval = pcf_init_8584(pcf_adap)))
return rval;
rval = i2c_add_adapter(adap);
return rval;
}

View File

@ -173,9 +173,7 @@ int i2c_sibyte_add_bus(struct i2c_adapter *i2c_adap, int speed)
printk("\n");
}
i2c_add_adapter(i2c_adap);
return 0;
return i2c_add_adapter(i2c_adap);
}

View File

@ -21,6 +21,9 @@
* - Make it work with IXP46x chips
* - Cleanup function names, coding style, etc
*
* - writing to slave address causes latchup on iop331.
* fix: driver refuses to address self.
*
* 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, version 2.
@ -72,12 +75,6 @@ iop3xx_i2c_reset(struct i2c_algo_iop3xx_data *iop3xx_adap)
__raw_writel(0, iop3xx_adap->ioaddr + CR_OFFSET);
}
static void
iop3xx_i2c_set_slave_addr(struct i2c_algo_iop3xx_data *iop3xx_adap)
{
__raw_writel(MYSAR, iop3xx_adap->ioaddr + SAR_OFFSET);
}
static void
iop3xx_i2c_enable(struct i2c_algo_iop3xx_data *iop3xx_adap)
{
@ -248,6 +245,13 @@ iop3xx_i2c_send_target_addr(struct i2c_algo_iop3xx_data *iop3xx_adap,
int status;
int rc;
/* avoid writing to my slave address (hangs on 80331),
* forbidden in Intel developer manual
*/
if (msg->addr == MYSAR) {
return -EBUSY;
}
__raw_writel(iic_cook_addr(msg), iop3xx_adap->ioaddr + DBR_OFFSET);
cr &= ~(IOP3XX_ICR_MSTOP | IOP3XX_ICR_NACK);
@ -498,7 +502,6 @@ iop3xx_i2c_probe(struct platform_device *pdev)
spin_lock_init(&adapter_data->lock);
iop3xx_i2c_reset(adapter_data);
iop3xx_i2c_set_slave_addr(adapter_data);
iop3xx_i2c_enable(adapter_data);
platform_set_drvdata(pdev, new_adapter);

View File

@ -80,7 +80,7 @@
#define IOP3XX_GPOD_I2C0 0x00c0 /* clear these bits to enable ch0 */
#define IOP3XX_GPOD_I2C1 0x0030 /* clear these bits to enable ch1 */
#define MYSAR 0x02 /* SWAG a suitable slave address */
#define MYSAR 0 /* default slave address */
#define I2C_ERR 321
#define I2C_ERR_BERR (I2C_ERR+0)

View File

@ -148,8 +148,6 @@ static int i2c_powermac_master_xfer( struct i2c_adapter *adap,
int read;
int addrdir;
if (num != 1)
return -EINVAL;
if (msgs->flags & I2C_M_TEN)
return -EINVAL;
read = (msgs->flags & I2C_M_RD) != 0;
@ -166,7 +164,7 @@ static int i2c_powermac_master_xfer( struct i2c_adapter *adap,
rc = pmac_i2c_xfer(bus, addrdir, 0, 0, msgs->buf, msgs->len);
bail:
pmac_i2c_close(bus);
return rc < 0 ? rc : msgs->len;
return rc < 0 ? rc : 1;
}
static u32 i2c_powermac_func(struct i2c_adapter * adapter)

View File

@ -184,21 +184,21 @@ static void scx200_acb_machine(struct scx200_acb_iface *iface, u8 status)
break;
case state_read:
/* Set ACK if receiving the last byte */
if (iface->len == 1)
/* Set ACK if _next_ byte will be the last one */
if (iface->len == 2)
outb(inb(ACBCTL1) | ACBCTL1_ACK, ACBCTL1);
else
outb(inb(ACBCTL1) & ~ACBCTL1_ACK, ACBCTL1);
*iface->ptr++ = inb(ACBSDA);
--iface->len;
if (iface->len == 0) {
if (iface->len == 1) {
iface->result = 0;
iface->state = state_idle;
outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1);
}
*iface->ptr++ = inb(ACBSDA);
--iface->len;
break;
case state_write:
@ -307,8 +307,12 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter,
buffer = (u8 *)&cur_word;
break;
case I2C_SMBUS_BLOCK_DATA:
case I2C_SMBUS_I2C_BLOCK_DATA:
if (rw == I2C_SMBUS_READ)
data->block[0] = I2C_SMBUS_BLOCK_MAX; /* For now */
len = data->block[0];
if (len == 0 || len > I2C_SMBUS_BLOCK_MAX)
return -EINVAL;
buffer = &data->block[1];
break;
@ -372,7 +376,7 @@ static u32 scx200_acb_func(struct i2c_adapter *adapter)
{
return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE |
I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA |
I2C_FUNC_SMBUS_BLOCK_DATA;
I2C_FUNC_SMBUS_I2C_BLOCK;
}
/* For now, we only handle combined mode (smbus) */

View File

@ -134,11 +134,13 @@ static int pca9539_detect(struct i2c_adapter *adapter, int address, int kind)
new_client->driver = &pca9539_driver;
new_client->flags = 0;
if (kind < 0) {
/* Detection: the pca9539 only has 8 registers (0-7).
A read of 7 should succeed, but a read of 8 should fail. */
if ((i2c_smbus_read_byte_data(new_client, 7) < 0) ||
(i2c_smbus_read_byte_data(new_client, 8) >= 0))
goto exit_kfree;
}
strlcpy(new_client->name, "pca9539", I2C_NAME_SIZE);

View File

@ -756,10 +756,10 @@ int i2c_probe(struct i2c_adapter *adapter,
"parameter for adapter %d, "
"addr 0x%02x\n", adap_id,
address_data->ignore[j + 1]);
}
ignore = 1;
break;
}
}
if (ignore)
continue;

View File

@ -193,6 +193,8 @@ struct i2c_algorithm {
to NULL. If an adapter algorithm can do SMBus access, set
smbus_xfer. If set to NULL, the SMBus protocol is simulated
using common I2C messages */
/* master_xfer should return the number of messages successfully
processed, or a negative value on error */
int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs,
int num);
int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr,