From 9df95ebdeebc83d996a6b4850944c1746010a11f Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 16 Nov 2007 09:08:44 +0000 Subject: [PATCH] Recognize VGN as a valid Sony Vaio name prefix. This is a backport from Linux 2.6. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5021 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + kernel/chips/eeprom.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 6f530b13..99e9c171 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ SVN-HEAD Makefile: Revert changeset 4738, fix bug #2187 differently Module eeprom: Hide Sony Vaio serial numbers to regular users (2.6 backport) Drop useless debugging log messages + Recognize VGN as a valid Sony Vaio name prefix (2.6 backport) Program decode-dimms.pl: Fix DDR2 SDRAM module speed decoding Update manufacturer IDs. Program sensors: Hide spurious errors on missing f71872f voltage inputs diff --git a/kernel/chips/eeprom.c b/kernel/chips/eeprom.c index e56b0187..2650dde5 100644 --- a/kernel/chips/eeprom.c +++ b/kernel/chips/eeprom.c @@ -200,12 +200,16 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, goto ERROR3; /* 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 (i2c_smbus_read_byte_data(new_client, 0x80) == 'P' - && i2c_smbus_read_byte(new_client) == 'C' - && i2c_smbus_read_byte(new_client) == 'G' - && i2c_smbus_read_byte(new_client) == '-') { + char name[4]; + + name[0] = i2c_smbus_read_byte_data(new_client, 0x80); + 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)) { printk(KERN_INFO "Vaio EEPROM detected, " "enabling privacy protection\n"); data->nature = NATURE_VAIO;