Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp193115pxb; Thu, 14 Jan 2021 03:33:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyI3ouAptQ9Xt5smT8m14vRqYwR5AN4WG2EO7h8YEZ1fW1W3O2hsTu4eUN/uMLqDlKu/6O X-Received: by 2002:a17:907:3345:: with SMTP id yr5mr311338ejb.50.1610624021163; Thu, 14 Jan 2021 03:33:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610624021; cv=none; d=google.com; s=arc-20160816; b=hYr1+fQM/Lqu6tnQ7EKm5Lr3bPi8ejQN2sVTWk3b83Hi1xI0Oc5siRpbRD4ABRE5gA ZC6ND3XDX/rHK9lEIv80jZAsIqt13SqfkIiX1BtM4r67knzJCNv5CySgNKczTXFRdGgO ougXnflJJQSq1lIpOxHl5a0q1OsnnLVvsfgZyrBxSRsTY+9x3cIGcT0KbVP4pj+fXoRA zv7PbnperOAwee464yf34/z5hcyTi1atQF8JVyMcCYglOZBHrJAWLPcRP8YqDQKn/boG oH08Q2dsiCubvGSBqg1k/ySoVvlS8lBdz87BBbYGHUXpniFa74i5GEyCk7OuUTrBWpS+ 8jig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=GS4lB+Dmu0gpIV8fi33WFpEebsCdkKYl6F092yYuhto=; b=PZSN4llGI896EkgVca0PH2dIaKM0TibR2GgjdbNRHXRc0tsifaHLzgin1mDqmqoFI/ YKN6l5B+f/4QpZ8MqFe8rIu4uR5EhKetJz1ZZXwHJcJKBziPojeCMjhx6H8ib/3stVLm S1H9Zn5zpv9XYZldXl9/Qwf02OeLOsTI0bdklpfQ8y5f3vi7+hrkVnge//InIiWAFFdg Udwpgvd1IEcPJzv6JIxPkyMrmWCGCsIwDJb4hafJETp/vEfKIu4NiP/t2OKLbQZPeFYS YNTJAx3xEEomlXKfdEvFUx9+cwXFJyOIQgdVvVVpSFrVZN32ocSoIPPubx5qPtjy6cwu jfkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=mdbixb5z; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a5si2252354ejk.214.2021.01.14.03.33.14; Thu, 14 Jan 2021 03:33:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=mdbixb5z; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729028AbhANLbH (ORCPT + 99 others); Thu, 14 Jan 2021 06:31:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729023AbhANLbG (ORCPT ); Thu, 14 Jan 2021 06:31:06 -0500 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F232C06179F for ; Thu, 14 Jan 2021 03:29:29 -0800 (PST) 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=GS4lB+Dmu0gpIV8fi33WFpEebsCdkKYl6F092yYuhto=; b=mdbixb5zpg2o6vAUlYeX4Dkp1Q XnpQTbZkQHP2w6rwpRAX+j8DVtxxuS7yMtQJF0yUyeWnVD5gzw9knnnaclMQT0FWjURILPfDnjIJD TyTEi2/N6UELqNn0hiq8J/wN5KMdOln3J1AWU0kqt7lUY84B2CELg2fC8suO2jroRZzg=; Received: from p54ae91f2.dip0.t-ipconnect.de ([84.174.145.242] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1l00oi-0001PU-13 for linux-wireless@vger.kernel.org; Thu, 14 Jan 2021 12:29:28 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 7/7] mt76: mt7915: fix eeprom DBDC band selection Date: Thu, 14 Jan 2021 12:29:25 +0100 Message-Id: <20210114112925.87646-7-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210114112925.87646-1-nbd@nbd.name> References: <20210114112925.87646-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When the EEPROM band fields contain default values, assign 2.4 GHz to the first band and 5 GHz to the second. Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c | 7 +++++-- drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c index 8f12a1bef3fc..9704d114974f 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c @@ -54,11 +54,14 @@ void mt7915_eeprom_parse_band_config(struct mt7915_phy *phy) val = mt7915_eeprom_read(dev, MT_EE_WIFI_CONF + ext_phy); val = FIELD_GET(MT_EE_WIFI_CONF0_BAND_SEL, val); + if (val == MT_EE_BAND_SEL_DEFAULT && dev->dbdc_support) + val = ext_phy ? MT_EE_BAND_SEL_5GHZ : MT_EE_BAND_SEL_2GHZ; + switch (val) { - case MT_EE_5GHZ: + case MT_EE_BAND_SEL_5GHZ: phy->mt76->cap.has_5ghz = true; break; - case MT_EE_2GHZ: + case MT_EE_BAND_SEL_2GHZ: phy->mt76->cap.has_2ghz = true; break; default: diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h index 7999e95560a8..3ee8c27bb61b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h +++ b/drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h @@ -35,10 +35,10 @@ enum mt7915_eeprom_field { #define MT_EE_WIFI_CONF7_TSSI1_5G BIT(4) enum mt7915_eeprom_band { - MT_EE_DUAL_BAND, - MT_EE_5GHZ, - MT_EE_2GHZ, - MT_EE_DBDC, + MT_EE_BAND_SEL_DEFAULT, + MT_EE_BAND_SEL_5GHZ, + MT_EE_BAND_SEL_2GHZ, + MT_EE_BAND_SEL_DUAL, }; #define SKU_DELTA_VAL GENMASK(5, 0) -- 2.28.0