All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Subject: [PATCH 09/15] mt76: mt7615: add calibration free support for MT7622
Date: Thu, 30 Jan 2020 15:47:12 +0100	[thread overview]
Message-ID: <20200130144718.14298-9-nbd@nbd.name> (raw)
In-Reply-To: <20200130144718.14298-1-nbd@nbd.name>

MT7622 uses fewer efuse overrides than MT7615

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 .../wireless/mediatek/mt76/mt7615/eeprom.c    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c
index 3c3570332366..0008e4584537 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c
@@ -210,6 +210,26 @@ static void mt7615_apply_cal_free_data(struct mt7615_dev *dev)
 		eeprom[ical_nocheck[i]] = otp[ical_nocheck[i]];
 }
 
+static void mt7622_apply_cal_free_data(struct mt7615_dev *dev)
+{
+	static const u16 ical[] = {
+		0x53, 0x54, 0x55, 0x56, 0xf4, 0xf7, 0x144, 0x156, 0x15b
+	};
+	u8 *eeprom = dev->mt76.eeprom.data;
+	u8 *otp = dev->mt76.otp.data;
+	int i;
+
+	if (!otp)
+		return;
+
+	for (i = 0; i < ARRAY_SIZE(ical); i++) {
+		if (!otp[ical[i]])
+			continue;
+
+		eeprom[ical[i]] = otp[ical[i]];
+	}
+}
+
 int mt7615_eeprom_init(struct mt7615_dev *dev)
 {
 	int ret;
@@ -222,6 +242,8 @@ int mt7615_eeprom_init(struct mt7615_dev *dev)
 	if (ret && dev->mt76.otp.data)
 		memcpy(dev->mt76.eeprom.data, dev->mt76.otp.data,
 		       MT7615_EEPROM_SIZE);
+	else if (is_mt7622(&dev->mt76))
+		mt7622_apply_cal_free_data(dev);
 	else
 		mt7615_apply_cal_free_data(dev);
 
-- 
2.24.0


  parent reply	other threads:[~2020-01-30 14:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 14:47 [PATCH 01/15] dt-bindings: net: wireless: mt76: document bindings for MT7622 Felix Fietkau
2020-01-30 14:47 ` [PATCH 02/15] mt76: mt7615: add __aligned(4) to txp structs Felix Fietkau
2020-01-30 14:47 ` [PATCH 03/15] mt76: mt7615: move mmio related code from pci.c to mmio.c Felix Fietkau
2020-01-30 14:47 ` [PATCH 04/15] mt76: mt7615: split up firmware loading functions Felix Fietkau
2020-01-30 14:47 ` [PATCH 05/15] mt76: mt7615: store N9 firmware version instead of CR4 Felix Fietkau
2020-01-30 14:47 ` [PATCH 06/15] mt76: mt7615: fix MT_INT_TX_DONE_ALL definition for MT7622 Felix Fietkau
2020-01-30 14:47 ` [PATCH 07/15] mt76: mt7615: add dma and tx queue initialization " Felix Fietkau
2020-01-30 14:47 ` [PATCH 08/15] mt76: mt7615: add eeprom support " Felix Fietkau
2020-01-30 14:47 ` Felix Fietkau [this message]
2020-01-30 14:47 ` [PATCH 10/15] mt76: mt7615: disable 5 GHz on MT7622 Felix Fietkau
2020-01-30 14:47 ` [PATCH 11/15] mt76: mt7615: implement probing and firmware loading " Felix Fietkau
2020-01-30 14:47 ` [PATCH 12/15] mt76: mt7615: implement DMA support for MT7622 Felix Fietkau
2020-01-30 14:47 ` [PATCH 13/15] mt76: mt7615: decrease rx ring size " Felix Fietkau
2020-01-30 14:47 ` [PATCH 14/15] mt76: mt7615: disable DBDC on MT7622 Felix Fietkau
2020-01-30 14:47 ` [PATCH 15/15] mt76: mt7615: add Kconfig entry for MT7622 Felix Fietkau
2020-02-06 18:22 ` [PATCH 01/15] dt-bindings: net: wireless: mt76: document bindings " Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200130144718.14298-9-nbd@nbd.name \
    --to=nbd@nbd.name \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.