diff options
author | Grazvydas Ignotas <notasas@gmail.com> | 2010-11-03 18:13:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-15 13:27:02 -0500 |
commit | e4b3fdb80021bc0a3239bfc2a873a6d7c6ac52a1 (patch) | |
tree | ed955270792c46c6c8687ea0f5d19dc81c9e2a49 /arch/arm | |
parent | 1d4b89f2970f9ea0902d0a3bc1090f3c770b5080 (diff) |
wl1251: use wl12xx_platform_data to pass data
Make use the newly added method to pass platform data for wl1251 too.
This allows to eliminate some redundant code.
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Kalle Valo <kvalo@adurom.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/board-omap3pandora.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 89ed1be2d62e..8be261506056 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) | |||
642 | omap_gpio_init(); | 642 | omap_gpio_init(); |
643 | } | 643 | } |
644 | 644 | ||
645 | static void pandora_wl1251_set_power(bool enable) | 645 | static void __init pandora_wl1251_init(void) |
646 | { | ||
647 | /* | ||
648 | * Keep power always on until wl1251_sdio driver learns to re-init | ||
649 | * the chip after powering it down and back up. | ||
650 | */ | ||
651 | } | ||
652 | |||
653 | static struct wl12xx_platform_data pandora_wl1251_pdata = { | ||
654 | .set_power = pandora_wl1251_set_power, | ||
655 | .use_eeprom = true, | ||
656 | }; | ||
657 | |||
658 | static struct platform_device pandora_wl1251_data = { | ||
659 | .name = "wl1251_data", | ||
660 | .id = -1, | ||
661 | .dev = { | ||
662 | .platform_data = &pandora_wl1251_pdata, | ||
663 | }, | ||
664 | }; | ||
665 | |||
666 | static void pandora_wl1251_init(void) | ||
667 | { | 646 | { |
647 | struct wl12xx_platform_data pandora_wl1251_pdata; | ||
668 | int ret; | 648 | int ret; |
669 | 649 | ||
650 | memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata)); | ||
651 | |||
670 | ret = gpio_request(PANDORA_WIFI_IRQ_GPIO, "wl1251 irq"); | 652 | ret = gpio_request(PANDORA_WIFI_IRQ_GPIO, "wl1251 irq"); |
671 | if (ret < 0) | 653 | if (ret < 0) |
672 | goto fail; | 654 | goto fail; |
@@ -679,6 +661,11 @@ static void pandora_wl1251_init(void) | |||
679 | if (pandora_wl1251_pdata.irq < 0) | 661 | if (pandora_wl1251_pdata.irq < 0) |
680 | goto fail_irq; | 662 | goto fail_irq; |
681 | 663 | ||
664 | pandora_wl1251_pdata.use_eeprom = true; | ||
665 | ret = wl12xx_set_platform_data(&pandora_wl1251_pdata); | ||
666 | if (ret < 0) | ||
667 | goto fail_irq; | ||
668 | |||
682 | return; | 669 | return; |
683 | 670 | ||
684 | fail_irq: | 671 | fail_irq: |
@@ -691,7 +678,6 @@ static struct platform_device *omap3pandora_devices[] __initdata = { | |||
691 | &pandora_leds_gpio, | 678 | &pandora_leds_gpio, |
692 | &pandora_keys_gpio, | 679 | &pandora_keys_gpio, |
693 | &pandora_dss_device, | 680 | &pandora_dss_device, |
694 | &pandora_wl1251_data, | ||
695 | &pandora_vwlan_device, | 681 | &pandora_vwlan_device, |
696 | }; | 682 | }; |
697 | 683 | ||