mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
FMC: make eeprom attribute writable
This allows easier modification to the eeprom than loading the fmc-write-eeprom module. The carrier driver will refuse writing if the FPGA is not running the golden gateware image, so writing in practice is only available at manufacture/development time. Signed-off-by: Alessandro Rubini <[email protected]> Acked-by: Juan David Gonzalez Cobas <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
dd97b2410e
commit
5c9a87367d
2 changed files with 39 additions and 53 deletions
|
|
@ -99,10 +99,23 @@ static ssize_t fmc_read_eeprom(struct file *file, struct kobject *kobj,
|
|||
return count;
|
||||
}
|
||||
|
||||
static ssize_t fmc_write_eeprom(struct file *file, struct kobject *kobj,
|
||||
struct bin_attribute *bin_attr,
|
||||
char *buf, loff_t off, size_t count)
|
||||
{
|
||||
struct device *dev;
|
||||
struct fmc_device *fmc;
|
||||
|
||||
dev = container_of(kobj, struct device, kobj);
|
||||
fmc = container_of(dev, struct fmc_device, dev);
|
||||
return fmc->op->write_ee(fmc, off, buf, count);
|
||||
}
|
||||
|
||||
static struct bin_attribute fmc_eeprom_attr = {
|
||||
.attr = { .name = "eeprom", .mode = S_IRUGO, },
|
||||
.attr = { .name = "eeprom", .mode = S_IRUGO | S_IWUSR, },
|
||||
.size = 8192, /* more or less standard */
|
||||
.read = fmc_read_eeprom,
|
||||
.write = fmc_write_eeprom,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue