Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3159015ybb; Mon, 6 Apr 2020 03:24:15 -0700 (PDT) X-Google-Smtp-Source: APiQypKcffUyknXaadbBrAReowVmQVY4iWFTFRAQEWPimfRmSVh/y2ifqg7w5NX28huTmXU3A6tT X-Received: by 2002:a9d:4b84:: with SMTP id k4mr17577854otf.233.1586168655054; Mon, 06 Apr 2020 03:24:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586168655; cv=none; d=google.com; s=arc-20160816; b=t7eDppdHJGCq1F/RsPopS+vZgkL2IY5+0/njvEkUBL0Lr15UYeU1xcRXRabipBllJ0 GFcc5PYSj453MMt4opoD8Hgig8qdAU98Ezb2XRMpwKB1FHGMqmWmMBJJyF4C5Un+IAo3 iiepMxY6LeujjEeSkPHn0VWPbpF5cBKa+ExQ8XJeNDp2XsusQO04i4q9m9IrugEW+4pR erIYGk36SIKORMIEE5oUDtsYKgXzebIcU6TETdxywD23fh1FY2jw5FlYTWdynx7vZhs6 /vSTu7V/3jiiRE5H9Xrly3xyC+iAt5RSaKxODUvGF0d6vlsbwWUuZUbmIUq6wtddltsN RyzA== 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=gSUMq6rvkPPyxjf1Y8nxReIv4JswMYaw3La2yp/B9Is=; b=ZvSeZlPAXeZ437BQJd3u9bzaEppD0f+V3pl8lt8nxfT9nVjyjgHjAl07IUMuE0Yqwk N2HOLxCHgT3qgxIKoLJzAAwAXL+awfnt8pzHo4BO8bUd8YcqTqnC+nbnTnUalDVfRVna VuynJ2X+zfpszKQe6NoRLBrBCypQtL1BlbvyP1vWNC3u/MQXpv3km53MQFGQ2RejOA0b z7IWn9DyxAVhPNNd2K2U+VollR89PHvN3zI9F0Sa1tO/ovHnOhu7n/jrJxAFKelukFUC WIpToZwty98ZahlH3G0/bBavvUBvlCJuRth498EmO+NLCAsFfZOwiRoqnjHklZ0Q+oY1 Z03w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=VhUOJt1x; 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 m81si7348040oig.190.2020.04.06.03.24.03; Mon, 06 Apr 2020 03:24:15 -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=VhUOJt1x; 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 S1727026AbgDFKWH (ORCPT + 99 others); Mon, 6 Apr 2020 06:22:07 -0400 Received: from nbd.name ([46.4.11.11]:57842 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbgDFKWH (ORCPT ); Mon, 6 Apr 2020 06:22:07 -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=gSUMq6rvkPPyxjf1Y8nxReIv4JswMYaw3La2yp/B9Is=; b=VhUOJt1x2a0MyVDPhnvuigaMe1 RyUjx+OjlXLO5ujK179OGZE7fLHbT7uxawa/9mZas3dkOximt1FHdXwtO2HrlZeG9deTtdhBxSYuz NXUAzGp7BCLPzJNjVk0wbHV/WcIRuF/HmeQ41o5uUd9dvWAAiFFR+HLeF8JPDE8MdhTY=; 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 1jLOtJ-0001ga-OP for linux-wireless@vger.kernel.org; Mon, 06 Apr 2020 12:22:05 +0200 Received: by maeck.local (Postfix, from userid 501) id 97DF881E8915; Mon, 6 Apr 2020 12:22:03 +0200 (CEST) From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 2/4] mt76: mt7615: disable merge of OTP ROM data by default Date: Mon, 6 Apr 2020 12:22:01 +0200 Message-Id: <20200406102203.54450-2-nbd@nbd.name> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200406102203.54450-1-nbd@nbd.name> References: <20200406102203.54450-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/mt7615/eeprom.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c index 23ed20553de2..34c33d23d79f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/eeprom.c @@ -5,6 +5,7 @@ * Felix Fietkau */ +#include #include "mt7615.h" #include "eeprom.h" @@ -255,6 +256,11 @@ static void mt7622_apply_cal_free_data(struct mt7615_dev *dev) static void mt7615_cal_free_data(struct mt7615_dev *dev) { + struct device_node *np = dev->mt76.dev->of_node; + + if (!np || !of_property_read_bool(np, "mediatek,eeprom-merge-otp")) + return; + switch (mt76_chip(&dev->mt76)) { case 0x7622: mt7622_apply_cal_free_data(dev); -- 2.24.0