eeprom: add support for dumping otp data separately via debugfs

Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2015-09-26 00:59:16 +02:00
parent 1e2f05b719
commit a1767ddf64
3 changed files with 7 additions and 5 deletions
+1
View File
@@ -111,6 +111,7 @@ void mt76_init_debugfs(struct mt76_dev *dev)
return;
debugfs_create_blob("eeprom", S_IRUSR, dir, &dev->eeprom);
debugfs_create_blob("otp", S_IRUSR, dir, &dev->otp);
debugfs_create_u8("temperature", S_IRUSR, dir, &dev->cal.temp);
debugfs_create_u32("regidx", S_IRUSR | S_IWUSR, dir, &dev->debugfs_reg);
+5 -5
View File
@@ -189,15 +189,16 @@ mt76_eeprom_load(struct mt76_dev *dev)
bool found;
dev->eeprom.size = len;
dev->eeprom.data = devm_kzalloc(dev->dev, len, GFP_KERNEL);
dev->eeprom.data = devm_kzalloc(dev->dev, len * 2, GFP_KERNEL);
if (!dev->eeprom.data)
return -ENOMEM;
dev->otp.size = len;
dev->otp.data = dev->eeprom.data + len;
found = !mt76_get_of_eeprom(dev, len);
efuse = kzalloc(len, GFP_KERNEL);
if (!efuse)
return -ENOMEM;
efuse = dev->otp.data;
if (mt76_get_efuse_data(dev, efuse, len))
goto out;
@@ -211,7 +212,6 @@ mt76_eeprom_load(struct mt76_dev *dev)
}
out:
kfree(efuse);
if (!found)
return -ENOENT;
+1
View File
@@ -225,6 +225,7 @@ struct mt76_dev {
struct mt76_calibration cal;
struct debugfs_blob_wrapper eeprom;
struct debugfs_blob_wrapper otp;
struct mt76_hw_cap cap;
u32 debugfs_reg;