Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1830487ybl; Thu, 30 Jan 2020 06:47:44 -0800 (PST) X-Google-Smtp-Source: APXvYqwwPPYp3Vx8KqCexw4TMG1cnsxMamTD3xX+2SO6dU/zax6FXAzcOR35t1RLh7xb9JoMWqU6 X-Received: by 2002:a9d:5885:: with SMTP id x5mr3761741otg.132.1580395664652; Thu, 30 Jan 2020 06:47:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580395664; cv=none; d=google.com; s=arc-20160816; b=ekqlIJWMaV1+T9WL/ojlCQrrnfabxQJj87fEEbALmUV4gB3l1EdQmjkPd9KRtHu7Xg J4ReceFb8GhJ8DmHYbSpLDC1SqTCuFtkWaVig51br2HpxMg1a/Bsi7WGzsZCAKi3YW3P gh524lT/US20w8VuXFn/EXt4RyaKUv9iKv/Cg+XXeFVfSFcXqW8w5cPyttTn5Czobi7d spiKxW3UT5v93r/QfZF/sm+B/svHWLQfBYNCcBoH9/RhbE0AEJWD2k4adfflSctDiluF IRcTdxSvjC0nYgINRdTzCf13lJb4gy9mmUkyR4LV6zAGkL/6g9ooheI2ELOU/VWzpegw BHoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=xvL4Hnoc7Z9n+1o5fDi0PDHmJcWkBY+tOtvloOlnfKw=; b=Y31bqMBIXp/C1PR3VBTyQ5ulGvg9Gek5vEkZqahvcSwMGPifJC8vIZ/8mvhmLRBKUb OoeYqFTjfHx4FG/6N0ww5xFu+s07+ggkDbPjVURHlzigirvbQASzPB2/a18NHn0JGldH e3cAAnqN+scjfpwGQ4V4yygZZVhMMN6RIoEUiexQ5x2rgx/Xb+pKCxRNoVsXV+tbtuqz y8eGRFMy1Cz49EahcnTBl8aDczMWV3igmzQ5rwVSU5FtOSJbHscC0LVOsdM5XJdTzN3S XOiXJ9iHplu2cPLdL94LI0uxpx9bn9j4W2/bM5vCPOAXGhUBut3eHeYNBaWAlhnOh9hM EuUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=mZxFmSX9; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si2987117oie.181.2020.01.30.06.47.33; Thu, 30 Jan 2020 06:47:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=mZxFmSX9; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727332AbgA3OrZ (ORCPT + 99 others); Thu, 30 Jan 2020 09:47:25 -0500 Received: from nbd.name ([46.4.11.11]:57444 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727240AbgA3OrW (ORCPT ); Thu, 30 Jan 2020 09:47:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xvL4Hnoc7Z9n+1o5fDi0PDHmJcWkBY+tOtvloOlnfKw=; b=mZxFmSX9WUWY2yBv2SWnq4oXPx FApGIMlqwmfEiSIkS+UAitqb+5Rh/lESlMgmS5Swp/qDw1u2monqol2IGR3lugk8OJ5w7QG/Cbw1J s/26fDIXmcKQwaNfB/w/eNXyPyin6oinZ70WubWJeOg+PdItIjNYcTwnSTsU9I6MkstM=; Received: from [178.162.209.135] (helo=maeck.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ixB6G-0001Ve-Gw for linux-wireless@vger.kernel.org; Thu, 30 Jan 2020 15:47:20 +0100 Received: by maeck.local (Postfix, from userid 501) id ECE3B7AE468F; Thu, 30 Jan 2020 15:47:18 +0100 (CET) From: Felix Fietkau 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 Message-Id: <20200130144718.14298-9-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200130144718.14298-1-nbd@nbd.name> References: <20200130144718.14298-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org MT7622 uses fewer efuse overrides than MT7615 Signed-off-by: Felix Fietkau --- .../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