Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3236476ybb; Mon, 6 Apr 2020 05:05:41 -0700 (PDT) X-Google-Smtp-Source: APiQypJrnjgE3DnsKqDpJGi4iWUovHJrMi67F+yyzOhXfIxyk5/kKV6QHgxHicymIyjJlQe/SQEV X-Received: by 2002:a05:6830:239b:: with SMTP id l27mr17428772ots.278.1586174741681; Mon, 06 Apr 2020 05:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586174741; cv=none; d=google.com; s=arc-20160816; b=ZvKk/Hcs5Qd8+2EzZjrRtle6dFlkplC5wBrj3dJ/IpdRwj/qlKkTLB2k/DpmlasCyj HK7bVWUd2c875qcBJ2cm9qB1g9r3yBddl6ckp9mW7FN4Y3o5mkqvyCAsV+p+/8nO0Lt+ LQ8tYDLTDSThZThWl0ATvDpjqNmxpj9OKXMWx9EXpYkKiM7k1x9tLEt2gMpcppuJHJq6 XCqfotCQiTecQXWuW3sacv0AnMDGdvwKsY3RjO3dFlinaUntf/X0rV4oQ6wvxX0Pe+u0 v7cY78qxPyINHoy/7FoT+s77/FK8eyfUHcT99vdOVrxeBNmw6s3A3iyN2OKnuMETmEAz xGEA== 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=EiyfoY+LzndWncjUsp/QkyR+kHtde9ADtmPh5GRnAtQ=; b=iWEeJNCtKC6MbVmpO7f4lBYc3LlWjZDLnfJZBygH1DNzDT0YgO7vi293JMlJJnTNdG jk2qqIAKucaYtFUha8ZUIPrjj7R7+KA2GMViibJPBZ7DePYGGh/37COs4jZtaV5wltWx fjt7LVIAsGaDuT4Zbc4nTHLrSROQflXRhu6sR3a1bX9UQAEbikxrcJOCz6vgqXAPO4ZJ s9Thr75qqeriFA8y+Wm6udxazQOU4+o5w/L8a/3tSKzKXbMl8wkqjWsMldB9HnWRnslv hLEO3jjkKcWMcYBqP8pocqi+BRRxxpVkQSxwyDUy8U8XjkqcNVtMk1mFJh8dMKO9gVQ1 wMjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=X5PhHe3J; 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 h7si7814746oia.277.2020.04.06.05.05.05; Mon, 06 Apr 2020 05:05:41 -0700 (PDT) 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=X5PhHe3J; 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 S1727849AbgDFMFC (ORCPT + 99 others); Mon, 6 Apr 2020 08:05:02 -0400 Received: from nbd.name ([46.4.11.11]:35486 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727837AbgDFMFB (ORCPT ); Mon, 6 Apr 2020 08:05:01 -0400 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=EiyfoY+LzndWncjUsp/QkyR+kHtde9ADtmPh5GRnAtQ=; b=X5PhHe3JYZZuRtBqtofHG0Jqfk tAkBqDRJjSaImO+kSIDj+UYg7CFc37euQPMwYszOppbkM7Ae9GNc8TX+v+53REyD3BrlBDNioMWLj fTitc+N6640DXhjT/mNyf3pF49D52h1SOrbhX9/rIxNFXc2XoCEyxzvr7mNeodWVz3Mg=; Received: from [80.255.7.105] (helo=maeck.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jLQUu-0008NR-Nb for linux-wireless@vger.kernel.org; Mon, 06 Apr 2020 14:05:00 +0200 Received: by maeck.local (Postfix, from userid 501) id F0F2281E97B2; Mon, 6 Apr 2020 14:04:59 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 2/2] mt76: mt76x2: disable merge of OTP ROM data by default Date: Mon, 6 Apr 2020 14:04:59 +0200 Message-Id: <20200406120459.61713-2-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200406120459.61713-1-nbd@nbd.name> References: <20200406120459.61713-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 The reference driver does not seem to enable it by default, only under certain conditions, e.g. when a .bin file is loaded. Make it opt-in via a device tree property for now, in case it is needed on some boards. Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c index 4a748a6f0ce2..410ffce3baff 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c @@ -4,6 +4,7 @@ */ #include +#include #include #include "mt76x2.h" #include "eeprom.h" @@ -76,6 +77,7 @@ mt76x2_apply_cal_free_data(struct mt76x02_dev *dev, u8 *efuse) MT_EE_RF_5G_GRP4_5_RX_HIGH_GAIN, MT_EE_RF_5G_GRP4_5_RX_HIGH_GAIN + 1, }; + struct device_node *np = dev->mt76.dev->of_node; u8 *eeprom = dev->mt76.eeprom.data; u8 prev_grp0[4] = { eeprom[MT_EE_TX_POWER_0_START_5G], @@ -86,6 +88,9 @@ mt76x2_apply_cal_free_data(struct mt76x02_dev *dev, u8 *efuse) u16 val; int i; + if (!np || !of_property_read_bool(np, "mediatek,eeprom-merge-otp")) + return; + if (!mt76x2_has_cal_free_data(dev, efuse)) return; -- 2.24.0