native wl1271 support on ZOOM
Subsystems (5)
v6 cover native wl1271 support on ZOOM
This patchset adds wl1271 support on ZOOM2/3 boards.
Only basic support is included; power manipulation is submitted separately as SDIO Runtime PM support.
Changes since v5:
- rebase to wireless-testing
- remove 2nd copy from wl12xx_platform_data (keep the 1st one though)
Thanks,
Ohad Ben-Cohen (7):
wl12xx: make wl12xx.h common to both spi and sdio
wl1271: propagate set_power's return value
wl12xx: add platform data passing support
wl1271: take irq info from private board data
wl1271: make ref_clock configurable by board
omap: zoom: add fixed regulator device for wlan
omap: zoom: add mmc3/wl1271 device support
arch/arm/mach-omap2/board-zoom-peripherals.c | 54 ++++++++++++++++++++ drivers/net/wireless/Makefile | 2 + drivers/net/wireless/wl12xx/Kconfig | 5 ++- drivers/net/wireless/wl12xx/wl1251_sdio.c | 2 +- drivers/net/wireless/wl12xx/wl1251_spi.c | 2 +- drivers/net/wireless/wl12xx/wl1271.h | 3 +- drivers/net/wireless/wl12xx/wl1271_boot.c | 11 +++-- drivers/net/wireless/wl12xx/wl1271_boot.h | 1 - drivers/net/wireless/wl12xx/wl1271_io.h | 9 ++- drivers/net/wireless/wl12xx/wl1271_main.c | 4 +- drivers/net/wireless/wl12xx/wl1271_sdio.c | 31 +++++++----- drivers/net/wireless/wl12xx/wl1271_spi.c | 8 ++- drivers/net/wireless/wl12xx/wl12xx_platform_data.c | 28 ++++++++++ include/linux/spi/wl12xx.h | 34 ------------ include/linux/wl12xx.h | 38 ++++++++++++++ 15 files changed, 170 insertions(+), 62 deletions(-) create mode 100644 drivers/net/wireless/wl12xx/wl12xx_platform_data.c delete mode 100644 include/linux/spi/wl12xx.h create mode 100644 include/linux/wl12xx.h
PATCH v6 1/7 wl12xx: make wl12xx.h common to both spi and sdio
Move wl12xx.h outside of the spi-specific location, so it can be shared with both spi and sdio solutions.
--- drivers/net/wireless/wl12xx/wl1251_sdio.c | 2 +- drivers/net/wireless/wl12xx/wl1251_spi.c | 2 +- drivers/net/wireless/wl12xx/wl1271_spi.c | 2 +- include/linux/spi/wl12xx.h | 34 ----------------------------- include/linux/wl12xx.h | 34 +++++++++++++++++++++++++++++ 5 files changed, 37 insertions(+), 37 deletions(-) delete mode 100644 include/linux/spi/wl12xx.h create mode 100644 include/linux/wl12xx.h
drivers/net/wireless/wl12xx/wl1251_sdio.c +1 -1
@@ -24,7 +24,7 @@#include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_ids.h> #include <linux/platform_device.h> -#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> #include <linux/irq.h> #include "wl1251.h"
drivers/net/wireless/wl12xx/wl1251_spi.c +1 -1
@@ -24,7 +24,7 @@#include <linux/slab.h> #include <linux/crc7.h> #include <linux/spi/spi.h> -#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> #include "wl1251.h" #include "wl1251_reg.h"
drivers/net/wireless/wl12xx/wl1271_spi.c +1 -1
@@ -25,7 +25,7 @@#include <linux/module.h> #include <linux/crc7.h> #include <linux/spi/spi.h> -#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> #include <linux/slab.h> #include "wl1271.h"
include/linux/spi/wl12xx.h deleted +0 -34
@@ -1,34 +0,0 @@ -/* -* This file is part of wl12xx -* -* Copyright (C) 2009 Nokia Corporation -* -* Contact: Luciano Coelho <[email protected]> -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* version 2 as published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA -* -*/ - -#ifndef _LINUX_SPI_WL12XX_H -#define _LINUX_SPI_WL12XX_H - -struct wl12xx_platform_data { -void (*set_power)(bool enable); -/* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ -int irq; -bool use_eeprom; -}; - -#endif
include/linux/wl12xx.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* This file is part of wl12xx +* +* Copyright (C) 2009 Nokia Corporation +* +* Contact: Luciano Coelho <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* version 2 as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA +* +*/ + +#ifndef _LINUX_WL12XX_H +#define _LINUX_WL12XX_H + +struct wl12xx_platform_data { +void (*set_power)(bool enable); +/* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ +int irq; +bool use_eeprom; +}; + +#endif
Signature · 1 line
1.7.0.4
PATCH v6 1/7 wl12xx: make wl12xx.h common to both spi and sdio
Quoted 5 lines · ext Ohad Ben-Cohen
Move
wl12xx.houtside of the spi-specific location, so it can be shared with both spi and sdio solutions.Signed-off-by Ohad Ben-Cohen <[email protected]>---
Hi,
wl12xx.h seems to be included also in arch/arm/mach-omap2/board-rx51-peripherals.c, so that should be changed too.
Best Regards,
Teemu Paasikivi
PATCH v6 1/7 wl12xx: make wl12xx.h common to both spi and sdio
Quoted 4 lines · Teemu Paasikivi
Quoted 3 lines · ext Ohad Ben-Cohen
Move
wl12xx.houtside of the spi-specific location, so it can be shared with both spi and sdio solutions.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Ohad Ben-Cohen <[email protected]>---
Hi,
wl12xx.hseems to be included also inarch/arm/mach-omap2/board-rx51-peripherals.c, so that should be changed too.
Thanks for catching this, I now see there are several spi/wl12xx.h users (rx51, omap3pandora and MAINTAINERS).
An update is coming.
Quoted 8 lines
Best Regards,
Teemu Paasikivi
PATCH v6 1/17 wl12xx: make wl12xx.h common to both spi and sdio
Move wl12xx.h outside of the spi-specific location, so it can be shared with both spi and sdio solutions.
Update all users of spi/wl12xx.h accordingly
--- MAINTAINERS | 2 +- arch/arm/mach-omap2/board-omap3pandora.c | 2 +- arch/arm/mach-omap2/board-rx51-peripherals.c | 2 +- drivers/net/wireless/wl12xx/wl1251_sdio.c | 2 +- drivers/net/wireless/wl12xx/wl1251_spi.c | 2 +- drivers/net/wireless/wl12xx/wl1271_spi.c | 2 +- include/linux/spi/wl12xx.h | 34 -------------------------- include/linux/wl12xx.h | 34 ++++++++++++++++++++++++++ 8 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 include/linux/spi/wl12xx.h create mode 100644 include/linux/wl12xx.h
MAINTAINERS +1 -1
@@ -6416,7 +6416,7 @@ W: http://wireless.kernel.org T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git S: Maintained F: drivers/net/wireless/wl12xx/wl1271* -F: include/linux/spi/wl12xx.h +F: include/linux/wl12xx.h WL3501 WIRELESS PCMCIA CARD DRIVER M: Arnaldo Carvalho de Melo <[email protected]>
arch/arm/mach-omap2/board-omap3pandora.c +1 -1
@@ -25,7 +25,7 @@#include <linux/spi/ads7846.h> #include <linux/regulator/machine.h> #include <linux/i2c/twl.h> -#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> #include <linux/mtd/partitions.h> #include <linux/mtd/nand.h> #include <linux/leds.h>
arch/arm/mach-omap2/board-rx51-peripherals.c +1 -1
@@ -14,7 +14,7 @@#include <linux/input.h> #include <linux/input/matrix_keypad.h> #include <linux/spi/spi.h> -#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> #include <linux/i2c.h> #include <linux/i2c/twl.h> #include <linux/clk.h>
drivers/net/wireless/wl12xx/wl1251_sdio.c +1 -1
@@ -24,7 +24,7 @@#include <linux/mmc/sdio_func.h> #include <linux/mmc/sdio_ids.h> #include <linux/platform_device.h> -#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> #include <linux/irq.h> #include "wl1251.h"
drivers/net/wireless/wl12xx/wl1251_spi.c +1 -1
@@ -24,7 +24,7 @@#include <linux/slab.h> #include <linux/crc7.h> #include <linux/spi/spi.h> -#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> #include "wl1251.h" #include "wl1251_reg.h"
drivers/net/wireless/wl12xx/wl1271_spi.c +1 -1
@@ -25,7 +25,7 @@#include <linux/module.h> #include <linux/crc7.h> #include <linux/spi/spi.h> -#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> #include <linux/slab.h> #include "wl1271.h"
include/linux/spi/wl12xx.h deleted +0 -34
@@ -1,34 +0,0 @@ -/* -* This file is part of wl12xx -* -* Copyright (C) 2009 Nokia Corporation -* -* Contact: Luciano Coelho <[email protected]> -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* version 2 as published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA -* -*/ - -#ifndef _LINUX_SPI_WL12XX_H -#define _LINUX_SPI_WL12XX_H - -struct wl12xx_platform_data { -void (*set_power)(bool enable); -/* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ -int irq; -bool use_eeprom; -}; - -#endif
include/linux/wl12xx.h new file +34 -0
@@ -0,0 +1,34 @@ +/* +* This file is part of wl12xx +* +* Copyright (C) 2009 Nokia Corporation +* +* Contact: Luciano Coelho <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* version 2 as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA +* +*/ + +#ifndef _LINUX_WL12XX_H +#define _LINUX_WL12XX_H + +struct wl12xx_platform_data { +void (*set_power)(bool enable); +/* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ +int irq; +bool use_eeprom; +}; + +#endif
Signature · 1 line
1.7.0.4
PATCH v6 1/7 wl12xx: make wl12xx.h common to both spi and sdio
Hi John,
Quoted 7 lines · Ohad Ben-Cohen
Move
wl12xx.houtside of the spi-specific location, so it can be shared with both spi and sdio solutions.Update all users of
spi/wl12xx.haccordinglySigned-off-by Ohad Ben-Cohen <[email protected]>---
This updates the first patch in the patchset.
Please tell me if you prefer me to resubmit the whole set.
Thanks,
Ohad.
Quoted 174 lines
?MAINTAINERS ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? ?2 +- ?arch/arm/mach-omap2/board-omap3pandora.c ? ? | ? ?2 +- ?arch/arm/mach-omap2/board-rx51-peripherals.c | ? ?2 +- ?drivers/net/wireless/wl12xx/wl1251_sdio.c ? ?| ? ?2 +- ?drivers/net/wireless/wl12xx/wl1251_spi.c ? ? | ? ?2 +- ?drivers/net/wireless/wl12xx/wl1271_spi.c ? ? | ? ?2 +- ?include/linux/spi/wl12xx.h ? ? ? ? ? ? ? ? ? | ? 34 -------------------------- ?include/linux/wl12xx.h ? ? ? ? ? ? ? ? ? ? ? | ? 34 ++++++++++++++++++++++++++?8 files changed, 40 insertions(+), 40 deletions(-) ?delete mode 100644
include/linux/spi/wl12xx.h?create mode 100644include/linux/wl12xx.hMAINTAINERS +0
-0@@ -6416,7 +6416,7 @@ W: ? ? ? ?http://wireless.kernel.org?T: ? ? git
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
?S: ? ? Maintained
?F: ? ?drivers/net/wireless/wl12xx/wl1271*MAINTAINERS +1
-1-F: ? ? include/linux/spi/wl12xx.h +F: ? ? include/linux/wl12xx.h?WL3501 WIRELESS PCMCIA CARD DRIVER
?M: ? ? Arnaldo Carvalho de Melo <[email protected]>arch/arm/mach-omap2/board-omap3pandora.c +0
-0@@ -25,7 +25,7 @@?#include <
linux/spi/ads7846.h>
?#include <linux/regulator/machine.h>
?#include <linux/i2c/twl.h>arch/arm/mach-omap2/board-omap3pandora.c +1
-1-#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> ?#include <
linux/mtd/partitions.h>
?#include <linux/mtd/nand.h>
?#include <linux/leds.h>arch/arm/mach-omap2/board-rx51-peripherals.c +0
-0@@ -14,7 +14,7 @@?#include <
linux/input.h>
?#include <linux/input/matrix_keypad.h>
?#include <linux/spi/spi.h>arch/arm/mach-omap2/board-rx51-peripherals.c +1
-1-#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> ?#include <
linux/i2c.h>
?#include <linux/i2c/twl.h>
?#include <linux/clk.h>drivers/net/wireless/wl12xx/wl1251_sdio.c +0
-0@@ -24,7 +24,7 @@?#include <
linux/mmc/sdio_func.h>
?#include <linux/mmc/sdio_ids.h>
?#include <linux/platform_device.h>drivers/net/wireless/wl12xx/wl1251_sdio.c +1
-1-#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> ?#include <
linux/irq.h>?#include "
wl1251.h"drivers/net/wireless/wl12xx/wl1251_spi.c +0
-0@@ -24,7 +24,7 @@?#include <
linux/slab.h>
?#include <linux/crc7.h>
?#include <linux/spi/spi.h>drivers/net/wireless/wl12xx/wl1251_spi.c +1
-1-#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> ?#include "
wl1251.h"
?#include "wl1251_reg.h"drivers/net/wireless/wl12xx/wl1271_spi.c +0
-0@@ -25,7 +25,7 @@?#include <
linux/module.h>
?#include <linux/crc7.h>
?#include <linux/spi/spi.h>drivers/net/wireless/wl12xx/wl1271_spi.c +1
-1-#include <linux/spi/wl12xx.h> +#include <linux/wl12xx.h> ?#include <
linux/slab.h>?#include "
wl1271.h"include/linux/spi/wl12xx.h deleted +0
-34@@ -1,34 +0,0 @@ -/* -* This file is part of wl12xx -* -* Copyright (C) 2009 Nokia Corporation -* -* Contact: Luciano Coelho <[email protected]> -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License -* version 2 as published by the Free Software Foundation. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ?See the GNU -* General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA -* -*/ - -#ifndef _LINUX_SPI_WL12XX_H -#define _LINUX_SPI_WL12XX_H - -struct wl12xx_platform_data { - ? ? ? void (*set_power)(bool enable); - ? ? ? /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ - ? ? ? int irq; - ? ? ? bool use_eeprom; -}; - -#endif include/linux/wl12xx.h new file +34
-1@@ -0,0 +1,34 @@ +/* +* This file is part of wl12xx +* +* Copyright (C) 2009 Nokia Corporation +* +* Contact: Luciano Coelho <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* version 2 as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ?See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA +* +*/ + +#ifndef _LINUX_WL12XX_H +#define _LINUX_WL12XX_H + +struct wl12xx_platform_data { + ? ? ? void (*set_power)(bool enable); + ? ? ? /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ + ? ? ? int irq; + ? ? ? bool use_eeprom; +}; + +#endif --1.7.0.4
PATCH v6 1/17 wl12xx: make wl12xx.h common to both spi and sdio
In reply to Ohad Ben-CohenQuoted 7 lines · ext Ohad Ben-Cohen
Move
wl12xx.houtside of the spi-specific location, so it can be shared with both spi and sdio solutions.Update all users of
spi/wl12xx.haccordinglySigned-off-by Ohad Ben-Cohen <[email protected]>---
I just wonder why the wl12xx.h move wasn't detected as a rename. Did you forget to use the -M option in format-patch?
Signature · 2 lines
Cheers, Luca.
PATCH v6 1/17 wl12xx: make wl12xx.h common to both spi and sdio
Quoted 4 lines · Luciano Coelho
Acked-by Luciano Coelho <[email protected]>I just wonder why the
wl12xx.hmove wasn't detected as a rename. ?Did you forget to use the -M option in format-patch?
I thought it's because I stripped the SPI_ from the #ifndef _LINUX_SPI_WL12XX_H, but it should be smarter than that. Probably the -M.
Thanks,
Ohad.
Quoted 6 lines
--
Cheers,
Luca.
PATCH v6 1/17 wl12xx: make wl12xx.h common to both spi and sdio
Quoted 10 lines · ext Ohad Ben-Cohen
Quoted 4 lines · Luciano Coelho
Acked-by Luciano Coelho <[email protected]>I just wonder why the
wl12xx.hmove wasn't detected as a rename. Did you forget to use the -M option in format-patch?I thought it's because I stripped the
SPI_from the #ifndef_LINUX_SPI_WL12XX_H, but it should be smarter than that. Probably the -M.
Yes, it is smarter than that. With small changes like this, -M will still show it as a rename and show the diff instead of the whole file -ed and +ed back ;)
Signature · 2 lines
Cheers, Luca.
Tony Lindgren
maintainerPATCH v6 1/17 wl12xx: make wl12xx.h common to both spi and sdio
In reply to Luciano CoelhoQuoted 10 lines · Luciano Coelho
Quoted 7 lines · ext Ohad Ben-Cohen
Move
wl12xx.houtside of the spi-specific location, so it can be shared with both spi and sdio solutions.Update all users of
spi/wl12xx.haccordinglySigned-off-by Ohad Ben-Cohen <[email protected]>---
Acked-by Luciano Coelho <[email protected]>
Looks good to me too:
PATCH v6 2/7 wl1271: propagate set_power's return value
In reply to Ohad Ben-CohenMake it possible for the set power method to indicate a success/failure return value. This is needed to support more complex power on/off operations such as SDIO power manipulations.
--- drivers/net/wireless/wl12xx/wl1271.h | 2 +- drivers/net/wireless/wl12xx/wl1271_io.h | 9 ++++++--- drivers/net/wireless/wl12xx/wl1271_main.c | 4 +++- drivers/net/wireless/wl12xx/wl1271_sdio.c | 15 +++++++++------ drivers/net/wireless/wl12xx/wl1271_spi.c | 4 +++- 5 files changed, 22 insertions(+), 12 deletions(-)
drivers/net/wireless/wl12xx/wl1271.h +1 -1
@@ -313,7 +313,7 @@ struct wl1271_if_operations { bool fixed);void (*reset)(struct wl1271 *wl);void (*init)(struct wl1271 *wl); -void (*power)(struct wl1271 *wl,bool enable); +int (*power)(struct wl1271 *wl,bool enable);struct device * (*dev)(struct wl1271 *wl);void (*enable_irq)(struct wl1271 *wl);void (*disable_irq)(struct wl1271 *wl);
drivers/net/wireless/wl12xx/wl1271_io.h +6 -3
@@ -144,10 +144,13 @@ static inline void wl1271_power_off(struct wl1271 *wl)clear_bit (WL1271_FLAG_GPIO_POWER , &wl->flags); } -static inline void wl1271_power_on (struct wl1271 *wl) +static inline int wl1271_power_on (struct wl1271 *wl) { - wl->if_ops->power (wl, true); -set_bit (WL1271_FLAG_GPIO_POWER , &wl->flags); +int ret = wl->if_ops->power (wl, true); +if (ret ==0 ) +set_bit (WL1271_FLAG_GPIO_POWER , &wl->flags); + +return ret; }
drivers/net/wireless/wl12xx/wl1271_main.c +3 -1
@@ -621,7 +621,9 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)int ret =0 ;msleep (WL1271_PRE_POWER_ON_SLEEP ); -wl1271_power_on (wl); + ret =wl1271_power_on (wl); +if (ret <0 ) + goto out;msleep (WL1271_POWER_ON_SLEEP );wl1271_io_reset (wl);wl1271_io_init (wl);
drivers/net/wireless/wl12xx/wl1271_sdio.c +9 -6
@@ -159,35 +159,38 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,wl1271_error ("sdio write failed (%d)" , ret); } -static void wl1271_sdio_power_on (struct wl1271 *wl) +static int wl1271_sdio_power_on (struct wl1271 *wl) {struct sdio_func *func =wl_to_func (wl);sdio_claim_host (func);sdio_enable_func (func);sdio_release_host (func); + +return 0 ; } -static void wl1271_sdio_power_off (struct wl1271 *wl) +static int wl1271_sdio_power_off (struct wl1271 *wl) {struct sdio_func *func =wl_to_func (wl);sdio_claim_host (func);sdio_disable_func (func);sdio_release_host (func); + +return 0 ; } -static void wl1271_sdio_set_power (struct wl1271 *wl,bool enable) +static int wl1271_sdio_set_power (struct wl1271 *wl,bool enable) {/* Let the SDIO stack handle wlan_enable control, so we * keep host claimed while wlan is in use to keep wl1271 * alive. */ if (enable) -wl1271_sdio_power_on (wl); +return wl1271_sdio_power_on (wl);else -wl1271_sdio_power_off (wl); - +return wl1271_sdio_power_off (wl); }static struct wl1271_if_operations sdio_ops = {
drivers/net/wireless/wl12xx/wl1271_spi.c +3 -1
@@ -312,10 +312,12 @@ static irqreturn_t wl1271_irq(int irq, void *cookie)return IRQ_HANDLED ; } -static void wl1271_spi_set_power (struct wl1271 *wl,bool enable) +static int wl1271_spi_set_power (struct wl1271 *wl,bool enable) {if (wl->set_power) wl->set_power (enable); + +return 0 ; }static struct wl1271_if_operations spi_ops = {
Signature · 1 line
1.7.0.4
PATCH v6 2/7 wl1271: propagate set_power's return value
Quoted 7 lines · ext Ohad Ben-Cohen
Make it possible for the set power method to indicate a success/failure return value. This is needed to support more complex power on/off operations such as SDIO power manipulations.
Signed-off-by Ohad Ben-Cohen <[email protected]>---
Some comments below.
Quoted 5 lines
drivers/net/wireless/wl12xx/wl1271_io.h +0
-0
drivers/net/wireless/wl12xx/wl1271_io.h static inline void wl1271_power_off(struct wl1271 *wl) · line 149
Quoted 9 lines
drivers/net/wireless/wl12xx/wl1271_io.h +2
-3@@ -144,10 +144,13 @@ static inline void wl1271_power_off(struct wl1271 *wl)clear_bit (WL1271_FLAG_GPIO_POWER , &wl->flags); } -static inline void wl1271_power_on (struct wl1271 *wl) +static inline int wl1271_power_on (struct wl1271 *wl) { - wl->if_ops->power (wl, true); -set_bit (WL1271_FLAG_GPIO_POWER , &wl->flags); +int ret = wl->if_ops->power (wl, true);
I think it look nicer if you keep the "int ret" in one line by itself and then do a ret = wl->if_ops... on another one.
Quoted 16 lines
drivers/net/wireless/wl12xx/wl1271_io.h +4
-0+if (ret ==0 ) +set_bit (WL1271_FLAG_GPIO_POWER , &wl->flags); + +return ret; }drivers/net/wireless/wl12xx/wl1271_sdio.c +0
-1@@ -159,35 +159,38 @@ static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf,wl1271_error ("sdio write failed (%d)" , ret); } -static void wl1271_sdio_power_on (struct wl1271 *wl)
drivers/net/wireless/wl12xx/wl1271_sdio.c static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf, · line 171
Quoted 10 lines
drivers/net/wireless/wl12xx/wl1271_sdio.c +3
-0+static int wl1271_sdio_power_on (struct wl1271 *wl) {struct sdio_func *func =wl_to_func (wl);sdio_claim_host (func);sdio_enable_func (func);sdio_release_host (func); + +return 0 ; }
You seem to always return 0, so the whole chain to pass the value up seems unnecessary. Is this just a preparation for a future patch?
Signature · 2 lines
Cheers, Luca.
PATCH v6 2/7 wl1271: propagate set_power's return value
Quoted 4 lines · Luciano Coelho
Quoted 1 line
+ ? ? int ret =
wl->if_ops->power(wl, true);I think it look nicer if you keep the "int ret" in one line by itself and then do a ret =
wl->if_ops... on another one.
Fixed.
Quoted 4 lines
Quoted 4 lines
+static int
wl1271_sdio_power_on(struct wl1271 *wl)?{
? ? ? structsdio_func*func =wl_to_func(wl);
Quoted 9 lines
Quoted 6 lines
? ? ?
sdio_claim_host(func);
? ? ?sdio_enable_func(func);
? ? ?sdio_release_host(func);
+
+ ? ? return 0;
?}You seem to always return 0, so the whole chain to pass the value up seems unnecessary. ?Is this just a preparation for a future patch?
Yes, it's soon going to be:
static int wl1271_sdio_power_on(struct wl1271 *wl) {
? ? ? struct sdio_func *func = wl_to_func(wl);
int ret;
ret = pm_runtime_get_sync(&func->dev);
if (ret)
goto out; ? ? ? sdio_claim_host(func);
? ? ? sdio_enable_func(func);
? ? ? sdio_release_host(func);
out:
? ? return ret;
}
Thanks,
Ohad.
Quoted 6 lines
--
Cheers,
Luca.
PATCH v6 2/7 wl1271: propagate set_power's return value
Quoted 38 lines · ext Ohad Ben-Cohen
Quoted 4 lines · Luciano Coelho
Quoted 1 line
+ int ret =
wl->if_ops->power(wl, true);I think it look nicer if you keep the "int ret" in one line by itself and then do a ret =
wl->if_ops... on another one.Fixed.
Quoted 4 lines
Quoted 4 lines
+static int
wl1271_sdio_power_on(struct wl1271 *wl){ struct sdio_func *func = wl_to_func(wl);Quoted 9 lines
drivers/net/wireless/wl12xx/wl1271_sdio.c static void wl1271_sdio_raw_write(struct wl1271 *wl, int addr, void *buf, · line 171
Quoted 6 lines
sdio_claim_host(func); sdio_enable_func(func); sdio_release_host(func);drivers/net/wireless/wl12xx/wl1271_sdio.c +2
-0+ +return 0 ; }You seem to always return 0, so the whole chain to pass the value up seems unnecessary. Is this just a preparation for a future patch?
Yes, it's soon going to be:
static int
wl1271_sdio_power_on(struct wl1271 *wl){ struct sdio_func *func = wl_to_func(wl); int ret; ret = pm_runtime_get_sync(&func->dev); if (ret) goto out; sdio_claim_host(func); sdio_enable_func(func); sdio_release_host(func);
Quoted 4 lines
out:
return ret; }
Ok, that was the only explanation I could think of ;)
Signature · 2 lines
Cheers, Luca.