Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1588948

Re: [PATCH 3/3] ath9k: ahb: Add OF support

From Rafał Miłecki <zajec5@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] ath9k: ahb: Add OF support
Date 2017-02-27 22:20 +0100
Message-ID <tfAS5-2SI-11@gated-at.bofh.it> (permalink)
References <tfAfo-2lV-9@gated-at.bofh.it> <tfAp4-2r5-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Why you didn't cc linux-wireless?!?!

On 27 February 2017 at 21:28, Alban <albeu@free.fr> wrote:
> @@ -513,6 +515,43 @@ static void ath9k_eeprom_release(struct ath_softc *sc)
>         release_firmware(sc->sc_ah->eeprom_blob);
>  }
>
> +#ifdef CONFIG_OF
> +static int ath9k_init_of(struct ath_softc *sc)
> +{
> +       struct device_node *np = sc->dev->of_node;
> +       struct ath_hw *ah = sc->sc_ah;
> +       const void *macaddr;
> +       struct clk *clk;
> +       int ret = 0;
> +
> +       if (!np) {
> +               dev_err(sc->dev, "no platform data or OF node\n");
> +               return -EINVAL;
> +       }
> +
> +       clk = clk_get(sc->dev, "ref");
> +       if (!IS_ERR(clk)) {
> +               ah->is_clk_25mhz = (clk_get_rate(clk) == 25000000);
> +               clk_put(clk);
> +       }
> +
> +       ah->disable_2ghz = of_property_read_bool(np, "qca,disable-2ghz");
> +       ah->disable_5ghz = of_property_read_bool(np, "qca,disable-5ghz");

Please use ieee80211-freq-limit:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b330b25eaabda00d74e47566d9200907da381896

Most likely with the wiphy_read_of_freq_limits helper:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=e691ac2f75b69bee743f0370d79454ba4429b17

Example:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=0f83ff69735651cc7a3d150466a5257ff829b62b

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC 0/3] drivers: Add an API to read device specific config data Alban <albeu@free.fr> - 2017-02-27 21:40 +0100
  [PATCH 3/3] ath9k: ahb: Add OF support Alban <albeu@free.fr> - 2017-02-27 21:50 +0100
    Re: [PATCH 3/3] ath9k: ahb: Add OF support Rafał Miłecki <zajec5@gmail.com> - 2017-02-27 22:20 +0100
      Re: [PATCH 3/3] ath9k: ahb: Add OF support Rafał Miłecki <zajec5@gmail.com> - 2017-02-28 00:00 +0100
      Re: [PATCH 3/3] ath9k: ahb: Add OF support Alban <albeu@free.fr> - 2017-02-28 00:20 +0100
  Re: [RFC 0/3] drivers: Add an API to read device specific config data Marek Vasut <marek.vasut@gmail.com> - 2017-02-27 21:50 +0100
  Re: [RFC 0/3] drivers: Add an API to read device specific config  data Boris Brezillon <boris.brezillon@free-electrons.com> - 2017-02-27 22:40 +0100
    Re: [RFC 0/3] drivers: Add an API to read device specific config data Moritz Fischer <moritz.fischer@ettus.com> - 2017-02-27 23:30 +0100
    Re: [RFC 0/3] drivers: Add an API to read device specific config  data Alban <albeu@free.fr> - 2017-02-27 23:50 +0100

csiph-web