From patchwork Thu Sep 20 09:11:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10607257 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 432B36CB for ; Thu, 20 Sep 2018 09:34:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FAC22CDCB for ; Thu, 20 Sep 2018 09:34:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21E1D2CECD; Thu, 20 Sep 2018 09:34:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BE3612CDCB for ; Thu, 20 Sep 2018 09:34:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=D/IVaLkDi45jJGsUPDtr3UysrioYM/Y4pWFAIm8yJEs=; b=PDpIzMcrEhjq0fmtakeZXVb4on P6okVJyVkEBPul+q1K1FYnKFPi+1bzEQMoj4SW0d67fLaqGR0a0IlmDGae0a1sKHa60sqTsY7uW0o 9ZDSNaGJEGNgdyDxqgDS3vsryWC2rgqA+Lz+VEE90i/FX9N/pLnS5HgVG1cYiJ14Bp0IMfn0JKhdb VPX1NMikrjxk5ej0He3WByQkaCSYi5Nc7qTiMe4i77E/NJjIl+YVxty8yW6nuqiCZgzU/5eQrGftt P1MMiYT5SXnPSJvbOABTCxXRJYXtYL+yO4R5RM+KyRecAncLi0SBZkShOHXIAmFVKaD9tkUi70bRA fWGEZoVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2vM3-0004C7-10; Thu, 20 Sep 2018 09:34:35 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2vE2-0007yC-2X for linux-mediatek@bombadil.infradead.org; Thu, 20 Sep 2018 09:26:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding: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=pTP+Z4WWIn6SO7Fo1gacwASAnQom8Px1On+RC6dcYAQ=; b=gURl2w3Fou8Njrd0oAaP2+tnn MHf4MHtf8Yex1fv0S4cWWp86IEjJrg4nDqHsQskRejkmGLCHrjtAiR/vL8Z5c+c0JvWz7M77V8c+j OmKXWAr2omHcxSIN+mrCMWkWpAqygORzWlvJnRNgDx8CX8iM5DsbUl+HCTptnkbh7TKHxFEjJEgr1 onBS+rr3AxG9yKAU8bWA2J3h/LZZpe8fkgbfMWJkloYWk7rsGc66lYsnh720y7mhhQ85XhQpvGiRu eR6bprwnpIeY/1ral+KhhhJGI4ppP5e4i77hc/yjUuTLOYJAFPjL4nvSgGfkKHqtGHydzP+V5cBk2 r5dh1Di1A==; Received: from mail-wr1-f66.google.com ([209.85.221.66]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g2v0v-0000W3-K8 for linux-mediatek@lists.infradead.org; Thu, 20 Sep 2018 09:12:46 +0000 Received: by mail-wr1-f66.google.com with SMTP id k5-v6so8566457wre.10 for ; Thu, 20 Sep 2018 02:12:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pTP+Z4WWIn6SO7Fo1gacwASAnQom8Px1On+RC6dcYAQ=; b=OwaKfcRYyZenRCTNXkr7386fX0cX+/NMaE0hWCcEJ03FsuDjMFZSNMCe39POo8yPHG KLFng6tj14IemxAAt0kbZMM5MrJo7/LMV4LKrm0jyY0CUEMnL3KHYQH8b0DEAmVIzY3a 00emvYrq6UAT944nO0wpGWxUlH73Xqto/+4jjVjzrT8nZRsEQyN/KXUZB+bH1Aia0s2y 4+Xf8xpRkSLTQQjrRQXqS3Z7GRTehghQ0opflX0iQd5bqXWiJ329brMZhFRP02rHFelQ MuEhohyeal8kDpo/xAMINPeepsJRHaQFD3zHm60erdI87BpasQHfsHILkl5btVOa3cyG tMrw== X-Gm-Message-State: APzg51AJ9U7MmSg3UmhPCy/pHhavSGPZ7B//d6ENaDf3cYcF9F54bqDj qlyTmtrZ0NfoBbhDkSg1JfEZAg== X-Google-Smtp-Source: ANB0VdaMO3xLYwNtTExH+p1Xh8XbeEh+5anCtTTRGI5ksepZlGRcpm1tKvTonbcArSWv0VXIRJB+0A== X-Received: by 2002:adf:add0:: with SMTP id w74-v6mr33249412wrc.73.1537434753912; Thu, 20 Sep 2018 02:12:33 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id 34-v6sm35501691wra.20.2018.09.20.02.12.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 02:12:33 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Subject: [PATCH 09/20] mt76x0: remove mt76x0_set_country_reg routine Date: Thu, 20 Sep 2018 11:11:56 +0200 Message-Id: <249232763e7ee05755b26bbb0a05c933d2a1ae95.1537433365.git.lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180920_051245_709084_E20C1C44 X-CRM114-Status: GOOD ( 14.69 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sgruszka@redhat.com, linux-mediatek@lists.infradead.org, linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Remove mt76x0_set_country_reg routine for the moment since it is partial and it is not actually used Signed-off-by: Lorenzo Bianconi --- .../wireless/mediatek/mt76/mt76x0/debugfs.c | 2 - .../wireless/mediatek/mt76/mt76x0/eeprom.c | 38 ------------------- .../wireless/mediatek/mt76/mt76x0/eeprom.h | 2 - 3 files changed, 42 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c index f9e305840176..932c0e41196c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c @@ -117,8 +117,6 @@ mt76x0_eeprom_param_read(struct seq_file *file, void *data) val = mt76x02_eeprom_get(&dev->mt76, MT_EE_NIC_CONF_0); seq_printf(file, "Power Amplifier type %lx\n", val & MT_EE_NIC_CONF_0_PA_TYPE); - seq_printf(file, "Reg channels: %hhu-%hhu\n", dev->ee->reg.start, - dev->ee->reg.start + dev->ee->reg.num - 1); seq_puts(file, "Per channel power:\n"); for (i = 0; i < 58; i++) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c index 6c492a21be26..5d08a7bb16ce 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c @@ -103,43 +103,6 @@ mt76x0_set_temp_offset(struct mt76x0_dev *dev, u8 *eeprom) dev->ee->temp_off = -10; } -static void -mt76x0_set_country_reg(struct mt76x0_dev *dev, u8 *eeprom) -{ - /* Note: - region 31 is not valid for mt76x0 (see rtmp_init.c) - * - comments in rtmp_def.h are incorrect (see rt_channel.c) - */ - static const struct reg_channel_bounds chan_bounds[] = { - /* EEPROM country regions 0 - 7 */ - { 1, 11 }, { 1, 13 }, { 10, 2 }, { 10, 4 }, - { 14, 1 }, { 1, 14 }, { 3, 7 }, { 5, 9 }, - /* EEPROM country regions 32 - 33 */ - { 1, 11 }, { 1, 14 } - }; - u8 val = eeprom[MT_EE_COUNTRY_REGION_2GHZ]; - int idx = -1; - - dev_dbg(dev->mt76.dev, "REG 2GHZ %u REG 5GHZ %u\n", val, eeprom[MT_EE_COUNTRY_REGION_5GHZ]); - if (val < 8) - idx = val; - if (val > 31 && val < 33) - idx = val - 32 + 8; - - if (idx != -1) - dev_info(dev->mt76.dev, - "EEPROM country region %02hhx (channels %hhd-%hhd)\n", - val, chan_bounds[idx].start, - chan_bounds[idx].start + chan_bounds[idx].num - 1); - else - idx = 5; /* channels 1 - 14 */ - - dev->ee->reg = chan_bounds[idx]; - - /* TODO: country region 33 is special - phy should be set to B-mode - * before entering channel 14 (see sta/connect.c) - */ -} - static void mt76x0_set_rf_freq_off(struct mt76x0_dev *dev, u8 *eeprom) { @@ -353,7 +316,6 @@ mt76x0_eeprom_init(struct mt76x0_dev *dev) mt76x02_mac_setaddr(&dev->mt76, eeprom + MT_EE_MAC_ADDR); mt76x0_set_chip_cap(dev, eeprom); - mt76x0_set_country_reg(dev, eeprom); mt76x0_set_rf_freq_off(dev, eeprom); mt76x0_set_temp_offset(dev, eeprom); mt76x0_set_lna_gain(dev, eeprom); diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h index e58a30589aa2..dbfcbfa71291 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h @@ -41,8 +41,6 @@ struct mt76x0_eeprom_params { u32 tx_pwr_cfg_5g[5][2]; u8 tx_pwr_per_chan[58]; - - struct reg_channel_bounds reg; }; int mt76x0_eeprom_init(struct mt76x0_dev *dev);