Commit a7a91ca5 authored by Jérôme Pouiller's avatar Jérôme Pouiller Committed by Greg Kroah-Hartman
Browse files

staging: wfx: add infrastructure for new driver

Instantiate build infrastructure WFx driver. This driver provides support
for Wifi chipset Silicon Labs WF200 and further:

   https://www.silabs.com/documents/public/data-sheets/wf200-datasheet.pdf



This chip support SPI and SDIO bus.

SDIO interface has two particularities:
    1. Some parameters may be useful for end user (I will talk about
       gpio_wakeup later).
    2. The SDIO VID and PID of WF200 are 0000:0001 which are too much
       generic to rely on.

So, current code checks VID/PID and looks for a node in DT (since WF200
targets embedded platforms, I don't think it is a problem to rely on
DT). DT can also be used to define to parameters for driver. Currently,
if no node is found, a warning is emitted, but it could be changed in
error.

Signed-off-by: default avatarJérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20190919142527.31797-2-Jerome.Pouiller@silabs.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d98bb9c2
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -14802,6 +14802,11 @@ S: Maintained
F:	drivers/input/touchscreen/silead.c
F:	drivers/input/touchscreen/silead.c
F:	drivers/platform/x86/touchscreen_dmi.c
F:	drivers/platform/x86/touchscreen_dmi.c
SILICON LABS WIRELESS DRIVERS (for WFxxx series)
M:	Jérôme Pouiller <jerome.pouiller@silabs.com>
S:	Supported
F:	drivers/staging/wfx/
SILICON MOTION SM712 FRAME BUFFER DRIVER
SILICON MOTION SM712 FRAME BUFFER DRIVER
M:	Sudip Mukherjee <sudipm.mukherjee@gmail.com>
M:	Sudip Mukherjee <sudipm.mukherjee@gmail.com>
M:	Teddy Wang <teddy.wang@siliconmotion.com>
M:	Teddy Wang <teddy.wang@siliconmotion.com>
+2 −0
Original line number Original line Diff line number Diff line
@@ -125,4 +125,6 @@ source "drivers/staging/exfat/Kconfig"


source "drivers/staging/qlge/Kconfig"
source "drivers/staging/qlge/Kconfig"


source "drivers/staging/wfx/Kconfig"

endif # STAGING
endif # STAGING
+1 −0
Original line number Original line Diff line number Diff line
@@ -53,3 +53,4 @@ obj-$(CONFIG_UWB) += uwb/
obj-$(CONFIG_USB_WUSB)		+= wusbcore/
obj-$(CONFIG_USB_WUSB)		+= wusbcore/
obj-$(CONFIG_EXFAT_FS)		+= exfat/
obj-$(CONFIG_EXFAT_FS)		+= exfat/
obj-$(CONFIG_QLGE)		+= qlge/
obj-$(CONFIG_QLGE)		+= qlge/
obj-$(CONFIG_WFX)		+= wfx/
+97 −0
Original line number Original line Diff line number Diff line
The WFxxx chip series can be connected via SPI or via SDIO.

SPI
---

You have to declare the WFxxx chip in your device tree.

Required properties:
 - compatible: Should be "silabs,wfx-spi"
 - reg: Chip select address of device
 - spi-max-frequency: Maximum SPI clocking speed of device in Hz
 - interrupts-extended: Should contain interrupt line (interrupt-parent +
   interrupt can also been used). Trigger should be `IRQ_TYPE_EDGE_RISING`.

Optional properties:
 - reset-gpios: phandle of gpio that will be used to reset chip during probe.
   Without this property, you may encounter issues with warm boot.

Please consult Documentation/devicetree/bindings/spi/spi-bus.txt for optional
SPI connection related properties,

Example:

&spi1 {
	wfx {
		compatible = "silabs,wfx-spi";
		pinctrl-names = "default";
		pinctrl-0 = <&wfx_irq &wfx_gpios>;
		interrupts-extended = <&gpio 16 IRQ_TYPE_EDGE_RISING>;
		wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
		reg = <0>;
		spi-max-frequency = <42000000>;
	};
};


SDIO
----

The driver is able to detect a WFxxx chip on SDIO bus by matching its Vendor ID
and Product ID. However, driver will only provide limited features in this
case. Thus declaring WFxxx chip in device tree is strongly recommended (and may
become mandatory in the future).

Required properties:
 - compatible: Should be "silabs,wfx-sdio"
 - reg: Should be 1

In addition, it is recommended to declare a mmc-pwrseq on SDIO host above WFx.
Without it, you may encounter issues with warm boot. mmc-pwrseq should be
compatible with mmc-pwrseq-simple. Please consult
Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.txt for more
information.

Example:

/ {
	wfx_pwrseq: wfx_pwrseq {
		compatible = "mmc-pwrseq-simple";
		pinctrl-names = "default";
		pinctrl-0 = <&wfx_reset>;
		reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
	};
};

&mmc1 {
	mmc-pwrseq = <&wfx_pwrseq>;
	#address-size = <1>;
	#size = <0>;

	mmc@1 {
		compatible = "silabs,wfx-sdio";
		reg = <1>;
		pinctrl-names = "default";
		pinctrl-0 = <&wfx_wakeup>;
		wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
	};
};

Note that #address-size and #size shoud already be defined in node mmc1, but it
is rarely the case.

Common properties
-----------------

Some properties are recognized either by SPI and SDIO versions:
 - wakeup-gpios: phandle of gpio that will be used to wake-up chip. Without
   this property, driver will disable most of power saving features.
 - config-file: Use an alternative file as PDS. Default is `wf200.pds`. Only
   necessary for development/debug purpose.
 - slk_key: String representing hexdecimal value of secure link key to use.
   Must contains 64 hexadecimal digits. Not supported in current version.

WFx driver also supports `mac-address` and `local-mac-address` as described in
Documentation/devicetree/binding/net/ethernet.txt
+7 −0
Original line number Original line Diff line number Diff line
config WFX
	tristate "Silicon Labs wireless chips WF200 and further"
	depends on MAC80211
	depends on (SPI || MMC)
	help
	  This is a driver for Silicons Labs WFxxx series (WF200 and further)
	  chipsets. This chip can be found on SPI or SDIO buses.
Loading