Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b925a3dd8a4d7451092cb9aa11da727ba69e0f0
Commit:     8b925a3dd8a4d7451092cb9aa11da727ba69e0f0
Parent:     0f2cbd38aa377e30df3b7602abed69464d1970aa
Author:     Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 15 19:24:03 2007 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Thu Nov 15 19:24:03 2007 +0100

    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: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/i2c/chips/eeprom.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c
index ef8a754..1a7eeeb 100644
--- a/drivers/i2c/chips/eeprom.c
+++ b/drivers/i2c/chips/eeprom.c
@@ -204,12 +204,16 @@ static int eeprom_detect(struct i2c_adapter *adapter, int 
address, int kind)
                goto exit_kfree;
 
        /* 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)) {
                        dev_info(&new_client->dev, "Vaio EEPROM detected, "
                                 "enabling privacy protection\n");
                        data->nature = VAIO;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to