enable the emc2305 fan controller and NCP power controller 30ms timeout mechanism (#8138)

Why I did it
fix the dx010 system eeprom unavailable issue

How I did it
enable the i2c slave 30ms timeout mechanism

How to verify it
i2cstress test in DX010 iSMT controller bus

Co-authored-by: nicwu-cel <nicwu@celestica.com>
This commit is contained in:
jerseyang 2021-08-12 09:41:21 +08:00 committed by GitHub
parent 9d2ccda1ec
commit f2e5eeb187
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View File

@ -147,6 +147,17 @@ start)
sleep 0.1 sleep 0.1
done done
bus_en=8
sleep 1
cfg_r=`i2cget -y -f 8 0x60 0xD1`
((cfg_w=$cfg_r+$bus_en))
i2cset -y -f 8 0x60 0xD1 $cfg_w
sleep 1
cfg_r=`i2cget -y -f 9 0x20 0xD1`
((cfg_w=$cfg_r+$bus_en))
i2cset -y -f 9 0x20 0xD1 $cfg_w
sleep 1
/bin/sh /usr/local/bin/platform_api_mgnt.sh init /bin/sh /usr/local/bin/platform_api_mgnt.sh init
echo "done." echo "done."

View File

@ -742,6 +742,7 @@ emc2305_probe(struct i2c_client *client, const struct i2c_device_id *id)
int status; int status;
int i; int i;
int fan_idx; int fan_idx;
unsigned char dis_to = 0;
if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EIO; return -EIO;
@ -753,6 +754,11 @@ emc2305_probe(struct i2c_client *client, const struct i2c_device_id *id)
i2c_set_clientdata(client, data); i2c_set_clientdata(client, data);
mutex_init(&data->update_lock); mutex_init(&data->update_lock);
dis_to = i2c_smbus_read_byte_data(client, REG_CONFIGURATION);
dis_to &= 0xBF;
/* The SMBus timeout function is enabled */
(void)i2c_smbus_write_byte_data(client, REG_CONFIGURATION, dis_to);
status = i2c_smbus_read_byte_data(client, REG_PRODUCT_ID); status = i2c_smbus_read_byte_data(client, REG_PRODUCT_ID);
switch (status) { switch (status) {
case 0x34: /* EMC2305 */ case 0x34: /* EMC2305 */