Skip to content

Commit

Permalink
net: wireless: ti: wl1251 add device tree support
Browse files Browse the repository at this point in the history
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: 81eef6c ("mmc: omap_hsmmc: Use dma_request_chan() for requesting DMA channel")
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Cc: <stable@vger.kernel.org> # v4.7+
[Ulf: Fixed up some complaints from checkpatch]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
H. Nikolaus Schaller authored and Ulf Hansson committed Nov 15, 2019
1 parent 69167ae commit 9b8d707
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/net/wireless/ti/wl1251/sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -248,6 +252,17 @@ 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);
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)) {
Expand Down

0 comments on commit 9b8d707

Please sign in to comment.