Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3237524ybb; Mon, 6 Apr 2020 05:06:45 -0700 (PDT) X-Google-Smtp-Source: APiQypLCxfBf9ORMHV74zeCHidyPiX9yoRg1UyJIqT8kuXQDandpGcL3Kmf+WTTZFlSfFO8GeeIv X-Received: by 2002:aca:f084:: with SMTP id o126mr12929488oih.81.1586174805759; Mon, 06 Apr 2020 05:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586174805; cv=none; d=google.com; s=arc-20160816; b=pLA6swU2FbeYV4fvc4o0XlzfSRKLS3ML00Fh9hPwtgwPAqq+BsFDQcvLsh9B3Ztr5K bq9i9ZHR2mhKeFp1ShDFwvBJYIA8t0WaF15lni1kjpTc9xF2Naqv1a/6YUP/ybFmlsZg offvRE7vEv1T1EzVjai2C/3cOmEI07pPT+m+uWAzspotWly4iAWkHJ8vJYofbGvmoPVR y4LQlHHSpAnOD41naAnwmisSXhujdd6iXcbRF1P6JBRDbb1GHx0+bbVo0mBzMJNBj06w vqQcYR7GgY5btzJKPReGGNgTf3slsgR921mKIIU0h6vv+BrCBEXGQkJTD2m0F3A8kzQE QV1Q== 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 :message-id:date:subject:to:from:dkim-signature; bh=dyMsA4uHqgq9WTBI6tCsEhKaBVf+ETwutw6Dp+JJp5g=; b=TyMgcBHvlMkMgMHZVUDaR7IM/uMqVRrilCwgUpU3DzjO0U4cahF1S1FKHjxTNjI3ef EA3IsV449a5Lmf/rPnrkfwUhzW2T5YJDEwoVcaKpBEZjiqAgAfpi3Wz1/mdyxY3CVuvh jF5A+ppBzLp6gBsYJS46tI+5sHPmy5oZASnVGpK8c32IXCvdaZjYNpEIofNW9EKh66tH EFCYahVqQ9aOCx6/nUBhvqd0WbPmHpcDKMq7BS76xSCQY8n0CO0SG2f0Pu/ocZzeKP4c VYnKhQQLGyhtQfTvFf+Sj+VZ/qTLDZw2Qc2br9JPlhiQuTr6Op49sJQLvi+Po38By594 ckEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=NKrsGpqL; 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 i5si7682276otp.103.2020.04.06.05.06.33; Mon, 06 Apr 2020 05:06:45 -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=NKrsGpqL; 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 S1727847AbgDFMFC (ORCPT + 99 others); Mon, 6 Apr 2020 08:05:02 -0400 Received: from nbd.name ([46.4.11.11]:35488 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727614AbgDFMFB (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: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: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=dyMsA4uHqgq9WTBI6tCsEhKaBVf+ETwutw6Dp+JJp5g=; b=NKrsGpqLQ8dnh4WicKninBNiMh dJXqkWNkU2LWaSqsnopXlogFiOZRQkJyAJTsYIoRmeGl9fjlKGMKX6yoKIpdwklGBpUfBDO5jNZeo k0gSIuc4ElE0GGhTXIhv/+AC3LvPaWuE5kmyr2KVPPCPWyHgg2uX8auvr1H3PjKNVqZ4=; 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-0008NQ-NW for linux-wireless@vger.kernel.org; Mon, 06 Apr 2020 14:05:00 +0200 Received: by maeck.local (Postfix, from userid 501) id EE4F081E97B1; Mon, 6 Apr 2020 14:04:59 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 1/2] mt76: mt7603: disable merge of OTP ROM data by default Date: Mon, 6 Apr 2020 14:04:58 +0200 Message-Id: <20200406120459.61713-1-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 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/mt7603/eeprom.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7603/eeprom.c index 2b6a4d8a8dc7..3ee06e2577b8 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7603/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt7603/eeprom.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: ISC +#include #include "mt7603.h" #include "eeprom.h" @@ -100,10 +101,14 @@ mt7603_apply_cal_free_data(struct mt7603_dev *dev, u8 *efuse) MT_EE_TX_POWER_1_START_2G, MT_EE_TX_POWER_1_START_2G + 1, }; + struct device_node *np = dev->mt76.dev->of_node; u8 *eeprom = dev->mt76.eeprom.data; int n = ARRAY_SIZE(cal_free_bytes); int i; + if (!np || !of_property_read_bool(np, "mediatek,eeprom-merge-otp")) + return; + if (!mt7603_has_cal_free_data(dev, efuse)) return; -- 2.24.0