[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFomoH5U0XevwKcaHRjf1hEyyqZfv4K_DZhCB7kpuXda2g@mail.gmail.com>
Date: Thu, 14 Nov 2019 15:12:48 +0100
From: Ulf Hansson <ulf.hansson@...aro.org>
To: "H. Nikolaus Schaller" <hns@...delico.com>
Cc: BenoƮt Cousson <bcousson@...libre.com>,
Tony Lindgren <tony@...mide.com>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Russell King <linux@...linux.org.uk>,
Kalle Valo <kvalo@...eaurora.org>,
Mike Rapoport <rppt@...ux.ibm.com>,
David Sterba <dsterba@...e.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Petr Mladek <pmladek@...e.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
Yangtao Li <tiny.windzz@...il.com>,
Alexios Zavras <alexios.zavras@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Allison Randal <allison@...utok.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
John Stultz <john.stultz@...aro.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
DTML <devicetree@...r.kernel.org>,
Discussions about the Letux Kernel
<letux-kernel@...nphoenux.org>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
kernel@...a-handheld.com,
linux-wireless <linux-wireless@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
netdev <netdev@...r.kernel.org>,
linux-omap <linux-omap@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v3 02/12] net: wireless: ti: wl1251 add device tree support
On Thu, 7 Nov 2019 at 11:31, H. Nikolaus Schaller <hns@...delico.com> wrote:
>
> We will have the wl1251 defined as a child node of the mmc interface
> and can read setup for gpios, interrupts and the ti,use-eeprom
> property from there instead of pdata to be provided by pdata-quirks.
>
> Fixes: 81eef6ca9201 ("mmc: omap_hsmmc: Use dma_request_chan() for requesting DMA channel")
>
> Signed-off-by: H. Nikolaus Schaller <hns@...delico.com>
> Acked-by: Kalle Valo <kvalo@...eaurora.org>
> ---
> drivers/net/wireless/ti/wl1251/sdio.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/net/wireless/ti/wl1251/sdio.c b/drivers/net/wireless/ti/wl1251/sdio.c
> index 677f1146ccf0..c54a273713ed 100644
> --- a/drivers/net/wireless/ti/wl1251/sdio.c
> +++ b/drivers/net/wireless/ti/wl1251/sdio.c
> @@ -16,6 +16,9 @@
> #include <linux/irq.h>
> #include <linux/pm_runtime.h>
> #include <linux/gpio.h>
> +#include <linux/of.h>
> +#include <linux/of_gpio.h>
> +#include <linux/of_irq.h>
>
> #include "wl1251.h"
>
> @@ -217,6 +220,7 @@ static int wl1251_sdio_probe(struct sdio_func *func,
> struct ieee80211_hw *hw;
> struct wl1251_sdio *wl_sdio;
> const struct wl1251_platform_data *wl1251_board_data;
> + struct device_node *np = func->dev.of_node;
>
> hw = wl1251_alloc_hw();
> if (IS_ERR(hw))
> @@ -248,6 +252,15 @@ static int wl1251_sdio_probe(struct sdio_func *func,
> wl->power_gpio = wl1251_board_data->power_gpio;
> wl->irq = wl1251_board_data->irq;
> wl->use_eeprom = wl1251_board_data->use_eeprom;
> + } else if (np) {
> + wl->use_eeprom =of_property_read_bool(np, "ti,wl1251-has-eeprom");
> + wl->power_gpio = of_get_named_gpio(np, "ti,power-gpio", 0);
This isn't needed as it seems. Perhaps remove or keep it as optional?
> + wl->irq = of_irq_get(np, 0);
> +
> + if (wl->power_gpio == -EPROBE_DEFER || wl->irq == -EPROBE_DEFER) {
> + ret = -EPROBE_DEFER;
> + goto disable;
> + }
> }
>
> if (gpio_is_valid(wl->power_gpio)) {
> --
Kind regards
Uffe
Powered by blists - more mailing lists