From patchwork Wed Nov 3 22:13:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 300602 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA3MEBAn010228 for ; Wed, 3 Nov 2010 22:14:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752986Ab0KCWOE (ORCPT ); Wed, 3 Nov 2010 18:14:04 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:62637 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752956Ab0KCWOB (ORCPT ); Wed, 3 Nov 2010 18:14:01 -0400 Received: by ewy7 with SMTP id 7so683241ewy.19 for ; Wed, 03 Nov 2010 15:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=rdHoRAITYeLBkesA9G87i634JjESZ1G8YAki3Uddz3g=; b=NPBiu0CYXifVFZ+XSb5uRL1gJ5i9aEVFA9vWBPovVMVO0D12/OPFgrQrujNq6ZrG2B uv8SLoqQ+qvAhLxH1St5dzf00YUBiktS6NnTuvPfot1gIjQjdRV0Twhhzz/9srngsqq3 cHdGeZkMwXQUhpqM5B2RmeCGS8zdhv9499dH0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=DTNd/6k/BMrcvpTtuQrXehQ7Mfqu8dcw3PNGmRj4iE+IgzOpEa2pnNuip1FJr5EwBf tmJOTpsvkDfy7a9dlmCAWp+oFFGFR+oe7BATmo8rrhL30I02JKc96nsd031wGmUP9w0d MlN4cabS7iJuT9+Bjxalumpd8C/9u2GLdN3Ys= Received: by 10.213.34.68 with SMTP id k4mr12589ebd.88.1288822440099; Wed, 03 Nov 2010 15:14:00 -0700 (PDT) Received: from localhost.localdomain (ip-88-119-226-136.static.b4net.lt [88.119.226.136]) by mx.google.com with ESMTPS id b52sm7027768eei.1.2010.11.03.15.13.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Nov 2010 15:13:59 -0700 (PDT) From: Grazvydas Ignotas To: linux-wireless@vger.kernel.org Cc: Kalle Valo , "John W. Linville" , Grazvydas Ignotas , Tony Lindgren , Ohad Ben-Cohen Subject: [PATCH 3/3] wl1251: use wl12xx_platform_data to pass data Date: Thu, 4 Nov 2010 00:13:49 +0200 Message-Id: <1288822429-24541-4-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1288822429-24541-1-git-send-email-notasas@gmail.com> References: <1288822429-24541-1-git-send-email-notasas@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 03 Nov 2010 22:14:12 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 89ed1be..8be2615 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -642,31 +642,13 @@ static void __init omap3pandora_init_irq(void) omap_gpio_init(); } -static void pandora_wl1251_set_power(bool enable) -{ - /* - * Keep power always on until wl1251_sdio driver learns to re-init - * the chip after powering it down and back up. - */ -} - -static struct wl12xx_platform_data pandora_wl1251_pdata = { - .set_power = pandora_wl1251_set_power, - .use_eeprom = true, -}; - -static struct platform_device pandora_wl1251_data = { - .name = "wl1251_data", - .id = -1, - .dev = { - .platform_data = &pandora_wl1251_pdata, - }, -}; - -static void pandora_wl1251_init(void) +static void __init pandora_wl1251_init(void) { + struct wl12xx_platform_data pandora_wl1251_pdata; int ret; + memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata)); + ret = gpio_request(PANDORA_WIFI_IRQ_GPIO, "wl1251 irq"); if (ret < 0) goto fail; @@ -679,6 +661,11 @@ static void pandora_wl1251_init(void) if (pandora_wl1251_pdata.irq < 0) goto fail_irq; + pandora_wl1251_pdata.use_eeprom = true; + ret = wl12xx_set_platform_data(&pandora_wl1251_pdata); + if (ret < 0) + goto fail_irq; + return; fail_irq: @@ -691,7 +678,6 @@ static struct platform_device *omap3pandora_devices[] __initdata = { &pandora_leds_gpio, &pandora_keys_gpio, &pandora_dss_device, - &pandora_wl1251_data, &pandora_vwlan_device, }; diff --git a/drivers/net/wireless/wl1251/sdio.c b/drivers/net/wireless/wl1251/sdio.c index 0a5db21..c27cc8c 100644 --- a/drivers/net/wireless/wl1251/sdio.c +++ b/drivers/net/wireless/wl1251/sdio.c @@ -43,8 +43,6 @@ struct wl1251_sdio { u32 elp_val; }; -static struct wl12xx_platform_data *wl12xx_board_data; - static struct sdio_func *wl_to_func(struct wl1251 *wl) { struct wl1251_sdio *wl_sdio = wl->if_priv; @@ -215,30 +213,6 @@ static struct wl1251_if_operations wl1251_sdio_ops = { .power = wl1251_sdio_set_power, }; -static int wl1251_platform_probe(struct platform_device *pdev) -{ - if (pdev->id != -1) { - wl1251_error("can only handle single device"); - return -ENODEV; - } - - wl12xx_board_data = pdev->dev.platform_data; - return 0; -} - -/* - * Dummy platform_driver for passing platform_data to this driver, - * until we have a way to pass this through SDIO subsystem or - * some other way. - */ -static struct platform_driver wl1251_platform_driver = { - .driver = { - .name = "wl1251_data", - .owner = THIS_MODULE, - }, - .probe = wl1251_platform_probe, -}; - static int wl1251_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id) { @@ -246,6 +220,7 @@ static int wl1251_sdio_probe(struct sdio_func *func, struct wl1251 *wl; struct ieee80211_hw *hw; struct wl1251_sdio *wl_sdio; + const struct wl12xx_platform_data *wl12xx_board_data; hw = wl1251_alloc_hw(); if (IS_ERR(hw)) @@ -272,6 +247,7 @@ static int wl1251_sdio_probe(struct sdio_func *func, wl->if_priv = wl_sdio; wl->if_ops = &wl1251_sdio_ops; + wl12xx_board_data = wl12xx_get_platform_data(); if (wl12xx_board_data != NULL) { wl->set_power = wl12xx_board_data->set_power; wl->irq = wl12xx_board_data->irq; @@ -376,12 +352,6 @@ static int __init wl1251_sdio_init(void) { int err; - err = platform_driver_register(&wl1251_platform_driver); - if (err) { - wl1251_error("failed to register platform driver: %d", err); - return err; - } - err = sdio_register_driver(&wl1251_sdio_driver); if (err) wl1251_error("failed to register sdio driver: %d", err); @@ -391,7 +361,6 @@ static int __init wl1251_sdio_init(void) static void __exit wl1251_sdio_exit(void) { sdio_unregister_driver(&wl1251_sdio_driver); - platform_driver_unregister(&wl1251_platform_driver); wl1251_notice("unloaded"); } diff --git a/drivers/net/wireless/wl12xx/Kconfig b/drivers/net/wireless/wl12xx/Kconfig index b447559..1f4d73f 100644 --- a/drivers/net/wireless/wl12xx/Kconfig +++ b/drivers/net/wireless/wl12xx/Kconfig @@ -42,5 +42,5 @@ config WL1271_SDIO config WL12XX_PLATFORM_DATA bool - depends on WL1271_SDIO != n + depends on WL1271_SDIO != n || WL1251_SDIO != n default y