Lines Matching +full:otp +full:- +full:1
1 // SPDX-License-Identifier: ISC
28 return -ETIMEDOUT; in mt7615_efuse_read()
53 if (is_mt7663(&dev->mt76)) in mt7615_efuse_init()
60 dev->mt76.otp.data = devm_kzalloc(dev->mt76.dev, len, GFP_KERNEL); in mt7615_efuse_init()
61 dev->mt76.otp.size = len; in mt7615_efuse_init()
62 if (!dev->mt76.otp.data) in mt7615_efuse_init()
63 return -ENOMEM; in mt7615_efuse_init()
65 buf = dev->mt76.otp.data; in mt7615_efuse_init()
87 ret = mt76_eeprom_init(&dev->mt76, MT7615_EEPROM_FULL_SIZE); in mt7615_eeprom_load()
96 u16 val = get_unaligned_le16(dev->eeprom.data); in mt7615_check_eeprom()
104 return -EINVAL; in mt7615_check_eeprom()
111 u8 val, *eeprom = dev->mt76.eeprom.data; in mt7615_eeprom_parse_hw_band_cap()
113 if (is_mt7663(&dev->mt76)) { in mt7615_eeprom_parse_hw_band_cap()
115 dev->mphy.cap.has_2ghz = true; in mt7615_eeprom_parse_hw_band_cap()
116 dev->mphy.cap.has_5ghz = true; in mt7615_eeprom_parse_hw_band_cap()
120 if (is_mt7622(&dev->mt76)) { in mt7615_eeprom_parse_hw_band_cap()
122 dev->mphy.cap.has_2ghz = true; in mt7615_eeprom_parse_hw_band_cap()
126 if (is_mt7611(&dev->mt76)) { in mt7615_eeprom_parse_hw_band_cap()
128 dev->mphy.cap.has_5ghz = true; in mt7615_eeprom_parse_hw_band_cap()
136 dev->mphy.cap.has_5ghz = true; in mt7615_eeprom_parse_hw_band_cap()
139 dev->dbdc_support = true; in mt7615_eeprom_parse_hw_band_cap()
142 dev->mphy.cap.has_2ghz = true; in mt7615_eeprom_parse_hw_band_cap()
145 dev->mphy.cap.has_2ghz = true; in mt7615_eeprom_parse_hw_band_cap()
146 dev->mphy.cap.has_5ghz = true; in mt7615_eeprom_parse_hw_band_cap()
153 u8 *eeprom = dev->mt76.eeprom.data; in mt7615_eeprom_parse_hw_cap()
158 if (is_mt7663(&dev->mt76)) { in mt7615_eeprom_parse_hw_cap()
165 /* read tx-rx mask from eeprom */ in mt7615_eeprom_parse_hw_cap()
175 dev->chainmask = BIT(tx_mask) - 1; in mt7615_eeprom_parse_hw_cap()
176 dev->mphy.antenna_mask = dev->chainmask; in mt7615_eeprom_parse_hw_cap()
177 dev->mphy.chainmask = dev->chainmask; in mt7615_eeprom_parse_hw_cap()
186 if (chain_idx > 1) in mt7663_eeprom_get_target_power_index()
187 return -EINVAL; in mt7663_eeprom_get_target_power_index()
189 if (chan->band == NL80211_BAND_2GHZ) in mt7663_eeprom_get_target_power_index()
192 group = mt7615_get_channel_group(chan->hw_value); in mt7663_eeprom_get_target_power_index()
193 if (chain_idx == 1) in mt7663_eeprom_get_target_power_index()
207 if (is_mt7663(&dev->mt76)) in mt7615_eeprom_get_target_power_index()
212 return -EINVAL; in mt7615_eeprom_get_target_power_index()
215 if (mt7615_ext_pa_enabled(dev, chan->band)) { in mt7615_eeprom_get_target_power_index()
216 if (chan->band == NL80211_BAND_2GHZ) in mt7615_eeprom_get_target_power_index()
223 if (chan->band == NL80211_BAND_2GHZ) { in mt7615_eeprom_get_target_power_index()
226 int group = mt7615_get_channel_group(chan->hw_value); in mt7615_eeprom_get_target_power_index()
229 case 1: in mt7615_eeprom_get_target_power_index()
253 if (is_mt7663(&dev->mt76)) { in mt7615_eeprom_get_power_delta_index()
285 u8 *eeprom = dev->mt76.eeprom.data; in mt7615_apply_cal_free_data()
286 u8 *otp = dev->mt76.otp.data; in mt7615_apply_cal_free_data() local
289 if (!otp) in mt7615_apply_cal_free_data()
293 if (!otp[ical[i]]) in mt7615_apply_cal_free_data()
297 eeprom[ical[i]] = otp[ical[i]]; in mt7615_apply_cal_free_data()
300 eeprom[ical_nocheck[i]] = otp[ical_nocheck[i]]; in mt7615_apply_cal_free_data()
308 u8 *eeprom = dev->mt76.eeprom.data; in mt7622_apply_cal_free_data()
309 u8 *otp = dev->mt76.otp.data; in mt7622_apply_cal_free_data() local
312 if (!otp) in mt7622_apply_cal_free_data()
316 if (!otp[ical[i]]) in mt7622_apply_cal_free_data()
319 eeprom[ical[i]] = otp[ical[i]]; in mt7622_apply_cal_free_data()
327 struct device_node *np = dev->mt76.dev->of_node; in mt7615_cal_free_data()
329 if (!np || !of_property_read_bool(np, "mediatek,eeprom-merge-otp")) in mt7615_cal_free_data()
332 switch (mt76_chip(&dev->mt76)) { in mt7615_cal_free_data()
352 ret = mt7615_check_eeprom(&dev->mt76); in mt7615_eeprom_init()
353 if (ret && dev->mt76.otp.data) { in mt7615_eeprom_init()
354 memcpy(dev->mt76.eeprom.data, dev->mt76.otp.data, in mt7615_eeprom_init()
355 dev->mt76.otp.size); in mt7615_eeprom_init()
357 dev->flash_eeprom = true; in mt7615_eeprom_init()
363 memcpy(dev->mphy.macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR, in mt7615_eeprom_init()
365 memcpy(dev->mphy.macaddr, (u8 *)dev->mt76.eeprom.data + MT_EE_MAC_ADDR, in mt7615_eeprom_init()
369 mt76_eeprom_override(&dev->mphy); in mt7615_eeprom_init()