From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Nikolaus Schaller" Subject: [PATCH v3 02/12] net: wireless: ti: wl1251 add device tree support Date: Thu, 7 Nov 2019 11:30:35 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Tony Lindgren , Rob Herring , Mark Rutland , Russell King , Ulf Hansson , Kalle Valo , Mike Rapoport , David Sterba , "Rafael J. Wysocki" , Petr Mladek , Sakari Ailus , "H. Nikolaus Schaller" , Kefeng Wang , Yangtao Li , Alexios Zavras , Thomas Gleixner , Allison Randal , Greg Kroah-Hartman , John Stultz , Bjorn Helgaas Cc: devicetree@vger.kernel.org, letux-kernel@openphoenux.org, linux-mmc@vger.kernel.org, kernel@pyra-handheld.com, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org List-Id: linux-mmc@vger.kernel.org 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 Acked-by: Kalle Valo --- 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 #include #include +#include +#include +#include #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); + 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)) { -- 2.23.0