From da916a854ba6af420c4ffdf02080d26d57ed8578 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sat, 9 Aug 2003 14:18:13 +0000 Subject: [PATCH] Ignore Sony Vaio EEPROMs with a password set (override with force parameter). git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1949 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/eeprom.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/kernel/chips/eeprom.c b/kernel/chips/eeprom.c index 3cac20b0..d9e482e0 100644 --- a/kernel/chips/eeprom.c +++ b/kernel/chips/eeprom.c @@ -55,7 +55,6 @@ MODULE_PARM_DESC(checksum, #define EIGHT_K 4 #define SIXTEEN_K 5 -/* Conversions */ /* Size of EEPROM in bytes */ #define EEPROM_SIZE 256 @@ -223,6 +222,22 @@ int eeprom_detect(struct i2c_adapter *adapter, int address, goto ERROR1; } + /* Ignore Vaio EEPROMs with a password set, unless forced. + We use the "PCG-" prefix as the signature. */ + if (kind < 0 && address == 0x57) + { + if (i2c_smbus_read_byte_data(new_client, 0x80) == 'P' + && i2c_smbus_read_byte_data(new_client, 0x81) == 'C' + && i2c_smbus_read_byte_data(new_client, 0x82) == 'G' + && i2c_smbus_read_byte_data(new_client, 0x83) == '-' + && i2c_smbus_read_byte_data(new_client, 0x00) != 0x00) + { + printk("eeprom.o: Protecting Sony Vaio password, use force to" + "override\n"); + goto ERROR1; + } + } + /* Determine the chip type - only one kind supported! */ if (kind <= 0) kind = eeprom;