[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20231018130942.31187-6-ansuelsmth@gmail.com>
Date: Wed, 18 Oct 2023 15:09:42 +0200
From: Christian Marangi <ansuelsmth@...il.com>
To: Felix Fietkau <nbd@....name>,
Lorenzo Bianconi <lorenzo@...nel.org>,
Ryder Lee <ryder.lee@...iatek.com>,
Shayne Chen <shayne.chen@...iatek.com>,
Sean Wang <sean.wang@...iatek.com>,
Kalle Valo <kvalo@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Christian Marangi <ansuelsmth@...il.com>,
Alexander Couzens <lynxis@...0.eu>,
Nicolas Cavallari <nicolas.cavallari@...en-communications.fr>,
Daniel Golle <daniel@...rotopia.org>,
linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Cc: Shiji Yang <yangshiji66@...look.com>
Subject: [PATCH v2 6/6] wifi: mt76: permit to load precal from NVMEM cell for mt7915
Permit to load precal from NVMEM cell for mt7915. The NVMEM cell must be
named "precal" to be correctly loaded.
NVMEM cell must already account the correct offset and be placed after
the EEPROM as the function expect the data right from the start.
Tested-by: Shiji Yang <yangshiji66@...look.com>
Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
---
drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
index 5228f710b3da..3bb2643d1b26 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c
@@ -11,6 +11,7 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev)
u8 *eeprom = mdev->eeprom.data;
u32 val = eeprom[MT_EE_DO_PRE_CAL];
u32 offs;
+ int ret;
if (!dev->flash_mode)
return 0;
@@ -25,7 +26,11 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev)
offs = is_mt7915(&dev->mt76) ? MT_EE_PRECAL : MT_EE_PRECAL_V2;
- return mt76_get_of_data_from_mtd(mdev, dev->cal, offs, val);
+ ret = mt76_get_of_data_from_mtd(mdev, dev->cal, offs, val);
+ if (!ret)
+ return ret;
+
+ return mt76_get_of_data_from_nvmem(mdev, dev->cal, "precal", val);
}
static int mt7915_check_eeprom(struct mt7915_dev *dev)
--
2.40.1
Powered by blists - more mailing lists