19 #include <linux/kernel.h>
21 #include <linux/module.h>
22 #include <linux/slab.h>
24 #include <linux/i2c.h>
28 static const unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54,
33 #define EEPROM_SIZE 256
58 if (!(data->
valid & (1 << slice)) ||
60 dev_dbg(&client->
dev,
"Starting eeprom update, slice %u\n", slice);
63 for (i = slice << 5; i < (slice + 1) << 5; i += 32)
69 for (i = slice << 5; i < (slice + 1) << 5; i += 2) {
73 data->
data[
i] = word & 0xff;
74 data->
data[i + 1] = word >> 8;
78 data->
valid |= (1 << slice);
98 for (slice = off >> 5; slice <= (off + count - 1) >> 5; slice++)
99 eeprom_update_client(client, slice);
108 for (i = 0; i <
count; i++) {
109 if ((off + i <= 0x1f) ||
110 (off + i >= 0xc0 && off + i <= 0xdf))
113 buf[
i] = data->
data[off +
i];
158 static int eeprom_probe(
struct i2c_client *client,
171 i2c_set_clientdata(client, data);
177 if (client->
addr == 0x57
186 if (!
memcmp(name,
"PCG-", 4) || !
memcmp(name,
"VGN-", 4)) {
188 "enabling privacy protection\n");
206 static int eeprom_remove(
struct i2c_client *client)
209 kfree(i2c_get_clientdata(client));
223 .probe = eeprom_probe,
224 .remove = eeprom_remove,
228 .detect = eeprom_detect,
229 .address_list = normal_i2c,