Reputation: 43
Thank you.
Peio
P.D: I tried chmod the eeprom file to rwx, but in anycase I receive an error trying to write to the eeprom: "bash: eeprom: Permission denied".
Upvotes: 1
Views: 3554
Reputation: 31
One problem is that the eeprom.c driver you are using does not support writing the eeprom, as it has no write function.
Consider using instead the driver at24.c. It has functions for writing, for example at24_eeprom_write()
In fact, the probe() function of this driver will decide if the part is writable or not, and then setup function calls as needed, when it is writable. And the write function isn't available, when the part is read-only. It takes care of this automatically.
Here is the code for the at24.c driver for v3.3 of the linux kernel, as you indicate: https://elixir.bootlin.com/linux/v3.3/source/drivers/misc/eeprom/at24.c
Upvotes: 0
Reputation: 1908
It appears eeprom Linux driver only implements drivers/misc/eeprom/eeprom.c read sysfs attribute:
https://github.com/torvalds/linux/blob/master/drivers/misc/eeprom/eeprom.c#L117
static const struct bin_attribute eeprom_attr = {
.attr = {
.name = "eeprom",
.mode = S_IRUGO,
},
.size = EEPROM_SIZE,
.read = eeprom_read,
};
Upvotes: 0