From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
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 <martin.blumenstingl@googlemail.com>
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 [thread overview]
Message-ID: <20161002225059.16757-4-martin.blumenstingl@googlemail.com> (raw)
In-Reply-To: <20161002225059.16757-1-martin.blumenstingl@googlemail.com>
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 <martin.blumenstingl@googlemail.com>
---
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 <linux/ath9k_platform.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/of_ieee80211.h>
#include <linux/of_net.h>
#include <linux/relay.h>
#include <net/ieee80211_radiotap.h>
@@ -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-<bus>-<id>.bin */
scnprintf(eeprom_name, sizeof(eeprom_name),
--
2.10.0
next prev parent reply other threads:[~2016-10-02 22:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-02 22:50 [RFC 0/3] of: add common bindings to (de)activate IEEE 802.11 bands Martin Blumenstingl
2016-10-02 22:50 ` [RFC 1/3] Documentation: dt-bindings: add IEEE 802.11 binding documentation Martin Blumenstingl
2016-10-02 22:50 ` [RFC 2/3] of: add IEEE 802.11 device configuration support code Martin Blumenstingl
2016-10-02 22:50 ` Martin Blumenstingl [this message]
2016-10-03 15:22 ` [RFC 0/3] of: add common bindings to (de)activate IEEE 802.11 bands Rob Herring
2016-10-05 18:25 ` Martin Blumenstingl
2016-10-05 18:36 ` Felix Fietkau
2016-10-05 20:31 ` Rob Herring
2016-10-05 20:34 ` Felix Fietkau
2016-10-16 21:20 ` Martin Blumenstingl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161002225059.16757-4-martin.blumenstingl@googlemail.com \
--to=martin.blumenstingl@googlemail.com \
--cc=ath9k-devel@lists.ath9k.org \
--cc=ath9k-devel@qca.qualcomm.com \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=nbd@nbd.name \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox