From 63394e92f00240672356ebc69f184df8ad45a377 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 9 Aug 2005 20:28:10 +0200 Subject: [PATCH] --- yaml --- r: 7183 b: refs/heads/master c: 4c9337da37c877e53a64696fc8524f642d446cba h: refs/heads/master i: 7181: 5cf781d90a49af68668ecf5c3071d482871075b1 7179: 9c623ed465646d5f716ae2e15ac8a276e3bbe028 7175: 2961cbebcc439ddcc3818cb6b607c78c40486384 7167: 4561ccd15ea6c93158b7673001941c678ccc34da v: v3 --- [refs] | 2 +- trunk/Documentation/i2c/porting-clients | 2 ++ trunk/drivers/i2c/chips/eeprom.c | 5 ----- trunk/drivers/i2c/chips/max6875.c | 5 ----- trunk/drivers/i2c/i2c-core.c | 13 ++++++++++--- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index a7912faf15df..3710e9144413 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a89ba0bc02e82920a0f4137aa5d655ac0366cc28 +refs/heads/master: 4c9337da37c877e53a64696fc8524f642d446cba diff --git a/trunk/Documentation/i2c/porting-clients b/trunk/Documentation/i2c/porting-clients index 5eb8d37cc679..4849dfd6961c 100644 --- a/trunk/Documentation/i2c/porting-clients +++ b/trunk/Documentation/i2c/porting-clients @@ -90,6 +90,8 @@ Technical changes: device_create_file. Move the driver initialization before any sysfs file creation. Drop client->id. + Drop any 24RF08 corruption prevention you find, as this is now done + at the i2c-core level, and doing it twice voids it. * [Init] Limits must not be set by the driver (can be done later in user-space). Chip should not be reset default (although a module diff --git a/trunk/drivers/i2c/chips/eeprom.c b/trunk/drivers/i2c/chips/eeprom.c index a27420a54c84..d58403a47908 100644 --- a/trunk/drivers/i2c/chips/eeprom.c +++ b/trunk/drivers/i2c/chips/eeprom.c @@ -161,11 +161,6 @@ int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) struct eeprom_data *data; int err = 0; - /* prevent 24RF08 corruption */ - if (kind < 0) - i2c_smbus_xfer(adapter, address, 0, 0, 0, - I2C_SMBUS_QUICK, NULL); - /* There are three ways we can read the EEPROM data: (1) I2C block reads (faster, but unsupported by most adapters) (2) Consecutive byte reads (100% overhead) diff --git a/trunk/drivers/i2c/chips/max6875.c b/trunk/drivers/i2c/chips/max6875.c index 31cee2d34a17..9e1aeb69abf9 100644 --- a/trunk/drivers/i2c/chips/max6875.c +++ b/trunk/drivers/i2c/chips/max6875.c @@ -171,11 +171,6 @@ static int max6875_detect(struct i2c_adapter *adapter, int address, int kind) struct max6875_data *data; int err = 0; - /* Prevent 24rf08 corruption (in case of user error) */ - if (kind < 0) - i2c_smbus_xfer(adapter, address, 0, 0, 0, - I2C_SMBUS_QUICK, NULL); - if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA | I2C_FUNC_SMBUS_READ_BYTE)) return 0; diff --git a/trunk/drivers/i2c/i2c-core.c b/trunk/drivers/i2c/i2c-core.c index bee0148dfab8..dda472e5e8be 100644 --- a/trunk/drivers/i2c/i2c-core.c +++ b/trunk/drivers/i2c/i2c-core.c @@ -679,9 +679,16 @@ static int i2c_probe_address(struct i2c_adapter *adapter, int addr, int kind, return 0; /* Make sure there is something at this address, unless forced */ - if (kind < 0 - && i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL) < 0) - return 0; + if (kind < 0) { + if (i2c_smbus_xfer(adapter, addr, 0, 0, 0, + I2C_SMBUS_QUICK, NULL) < 0) + return 0; + + /* prevent 24RF08 corruption */ + if ((addr & ~0x0f) == 0x50) + i2c_smbus_xfer(adapter, addr, 0, 0, 0, + I2C_SMBUS_QUICK, NULL); + } /* Finally call the custom detection function */ err = found_proc(adapter, addr, kind);