Commit 8b925a3d authored by Jean Delvare's avatar Jean Delvare Committed by Jean Delvare

i2c/eeprom: Recognize VGN as a valid Sony Vaio name prefix

Recent (i.e. 2005 and later) Sony Vaio laptops have names beginning
with VGN rather than PCG. Update the eeprom driver so that it
recognizes these.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 0f2cbd38
...@@ -204,12 +204,16 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) ...@@ -204,12 +204,16 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
goto exit_kfree; goto exit_kfree;
/* Detect the Vaio nature of EEPROMs. /* Detect the Vaio nature of EEPROMs.
We use the "PCG-" prefix as the signature. */ We use the "PCG-" or "VGN-" prefix as the signature. */
if (address == 0x57) { if (address == 0x57) {
if (i2c_smbus_read_byte_data(new_client, 0x80) == 'P' char name[4];
&& i2c_smbus_read_byte(new_client) == 'C'
&& i2c_smbus_read_byte(new_client) == 'G' name[0] = i2c_smbus_read_byte_data(new_client, 0x80);
&& i2c_smbus_read_byte(new_client) == '-') { name[1] = i2c_smbus_read_byte(new_client);
name[2] = i2c_smbus_read_byte(new_client);
name[3] = i2c_smbus_read_byte(new_client);
if (!memcmp(name, "PCG-", 4) || !memcmp(name, "VGN-", 4)) {
dev_info(&new_client->dev, "Vaio EEPROM detected, " dev_info(&new_client->dev, "Vaio EEPROM detected, "
"enabling privacy protection\n"); "enabling privacy protection\n");
data->nature = VAIO; data->nature = VAIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment