From patchwork Sun Oct 2 22:50:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9359835 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8AD3E601C0 for ; Sun, 2 Oct 2016 22:51:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7983A289FA for ; Sun, 2 Oct 2016 22:51:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E4BC28A24; Sun, 2 Oct 2016 22:51:14 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09EE3289FA for ; Sun, 2 Oct 2016 22:51:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751894AbcJBWvN (ORCPT ); Sun, 2 Oct 2016 18:51:13 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33517 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751967AbcJBWvL (ORCPT ); Sun, 2 Oct 2016 18:51:11 -0400 Received: by mail-wm0-f65.google.com with SMTP id p138so12055942wmb.0; Sun, 02 Oct 2016 15:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dQhnQAca7EJ23xY8VUL8f8Hcsr3UtmIgAm6J3yRgu38=; b=h7HjKTccXYPUd2q7zg1eUGmjBnIyN9B7WB41pP7XaX06lohiUXp8N5Ue8EoPlFDdgm elkUO5M1/EBPDO305hDMVFO8+QD+hBLZJY2+rMjsLtR5Wxfetw8eWxwLBFmXtc5Tf/Zw mp9nHDdQmK9fe8xnzlTx1kab4KC4MoMASC5nsM2qXr6+dJg3nmcKLrPkrMizfS4PnEwA PzLaN8KPIOkfB1Zvymfrm4y5EkBhY6fm81RuNs0iPtVsceNTBno1FrhdEJZo4I3f0Nk9 IFxh1yU4RfJpVj6R2+9Xm/AcLw7LAQJBCq1zScNNJQyo6q+ce8/Kh5aNO8+Ch/9827sy riSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dQhnQAca7EJ23xY8VUL8f8Hcsr3UtmIgAm6J3yRgu38=; b=OBMaGy862PJZdo1JVWM5jndYbsSF4A4O4QO7SDG+JuzODbPIfRzw898Ts5mhlnRBdD wUFd3XZO9NjNZ3BfJUz9Q16RoVkVk9N+83Fo6A6MFDCqWUUH3aW0Hf7Z/6wyI84r6ZCf EGlfgw3qz099zx9GYgHrnp+JE/wp2wf6tapID5xpKB4T0+Oi2wxrp6MQjMwz/e+NNY9E WZ+r4Y7o2hq1G7wqbKtJ7U7mStNRlHopzyA1ij5SUTSsYUKDNwdBgWl3/JRvveU21UeD FsLIv/22OzWBceha4I0q85GgGtERtnYz2ud5kra57FYCdn7JKeu1vNNy5EXVEh1yUc3F lzmA== X-Gm-Message-State: AA6/9RkRvMzewH7UJmm1sAfWt49G7bJVCn0y3yBezJJDQf6dOxJS4P0jJftQJmrV7BVupw== X-Received: by 10.28.131.199 with SMTP id f190mr7988597wmd.30.1475448669449; Sun, 02 Oct 2016 15:51:09 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD3D4610440DF0B34A14E22AB.dip0.t-ipconnect.de. [2003:dc:d3d4:6104:40df:b34:a14e:22ab]) by smtp.googlemail.com with ESMTPSA id l206sm15868863wmf.15.2016.10.02.15.51.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Oct 2016 15:51:08 -0700 (PDT) From: Martin Blumenstingl To: robh+dt@kernel.org, mark.rutland@arm.com, frowand.list@gmail.com, devicetree@vger.kernel.org, nbd@nbd.name Cc: linux-wireless@vger.kernel.org, ath9k-devel@qca.qualcomm.com, ath9k-devel@lists.ath9k.org, kvalo@codeaurora.org, Martin Blumenstingl Subject: [RFC 3/3] ath9k: add OF configuration to disable the 2.4GHz or 5GHz band Date: Mon, 3 Oct 2016 00:50:59 +0200 Message-Id: <20161002225059.16757-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161002225059.16757-1-martin.blumenstingl@googlemail.com> References: <20161002225059.16757-1-martin.blumenstingl@googlemail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some devices are shipped with EEPROMs where a band is enabled which is not supported by the actual hardware. Allow disabling the affected bands using the new generic IEEE 802.11 bindings. This is the OF equivalent to using ath9k_platform_data's disable_2ghz and disable_5ghz attributes. Signed-off-by: Martin Blumenstingl --- Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt | 2 ++ drivers/net/wireless/ath/ath9k/init.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt index 9b58ede..042319a 100644 --- a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt +++ b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt @@ -18,6 +18,8 @@ Optional properties: kernel firmware loader). - mac-address: See ethernet.txt in the parent directory - local-mac-address: See ethernet.txt in the parent directory +- disable-ieee80211-2ghz: See ieee80211.txt in the current directory +- disable-ieee80211-5ghz: See ieee80211.txt in the current directory In this example, the node is defined as child node of the PCI controller: diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index b7c8ff9..8b3f906 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -572,6 +573,9 @@ static int ath9k_of_init(struct ath_softc *sc) ath_dbg(common, CONFIG, "parsing configuration from OF node\n"); + ah->disable_2ghz = of_ieee80211_is_2ghz_disabled(np); + ah->disable_5ghz = of_ieee80211_is_5ghz_disabled(np); + if (of_property_read_bool(np, "qca,no-eeprom")) { /* ath9k-eeprom--.bin */ scnprintf(eeprom_name, sizeof(eeprom_name),