557-ath9k-disable-bands-via-dt.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. --- a/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt
  2. +++ b/Documentation/devicetree/bindings/net/wireless/qca,ath9k.txt
  3. @@ -34,6 +34,14 @@ Optional properties:
  4. ath9k wireless chip (in this case the calibration /
  5. EEPROM data will be loaded from userspace using the
  6. kernel firmware loader).
  7. +- qca,disable-2ghz: Overrides the settings from the EEPROM and disables the
  8. + 2.4GHz band. Setting this property is only needed
  9. + when the RF circuit does not support the 2.4GHz band
  10. + while it is enabled nevertheless in the EEPROM.
  11. +- qca,disable-5ghz: Overrides the settings from the EEPROM and disables the
  12. + 5GHz band. Setting this property is only needed when
  13. + the RF circuit does not support the 5GHz band while
  14. + it is enabled nevertheless in the EEPROM.
  15. - mac-address: See ethernet.txt in the parent directory
  16. - local-mac-address: See ethernet.txt in the parent directory
  17. --- a/drivers/net/wireless/ath/ath9k/init.c
  18. +++ b/drivers/net/wireless/ath/ath9k/init.c
  19. @@ -571,6 +571,12 @@ static int ath9k_of_init(struct ath_soft
  20. ath_dbg(common, CONFIG, "parsing configuration from OF node\n");
  21. + if (of_property_read_bool(np, "qca,disable-2ghz"))
  22. + ah->disable_2ghz = true;
  23. +
  24. + if (of_property_read_bool(np, "qca,disable-5ghz"))
  25. + ah->disable_5ghz = true;
  26. +
  27. if (of_property_read_bool(np, "qca,no-eeprom")) {
  28. /* ath9k-eeprom-<bus>-<id>.bin */
  29. scnprintf(eeprom_name, sizeof(eeprom_name),