From patchwork Thu Sep 19 14:25:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 11152707 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBF1114ED for ; Thu, 19 Sep 2019 14:28:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74BA6218AF for ; Thu, 19 Sep 2019 14:28:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="B5AT1H5V" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388966AbfISOZq (ORCPT ); Thu, 19 Sep 2019 10:25:46 -0400 Received: from mail-eopbgr780041.outbound.protection.outlook.com ([40.107.78.41]:35720 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727642AbfISOZo (ORCPT ); Thu, 19 Sep 2019 10:25:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aJZKb0TVslxQsUluE8n/zE+2Z3hCiymDoNlRparFGu16FsJvnVbOuFpHcIjcifB812mUXmwIjTL4mU7gmitJcqxsDymvD9bESVZF3gJd0NRmQjzfRSGor5EeW7K5jooGJPcWiyuop7kOS5jDian01ZDzorgT4H6QX8APhnjC7BWqKZvNqSQZtpNCCRK0NFoOZTszbjV8ZcChfDmxKvb51QAchO7TYn6Qbwl+aFNDTiJdNAsOl1KVbKZkDTaA/PvzJGyq3xRhtcFVJ/a1pYJJWz9rfTF4QLl1ldUwLngCm6Fna0/U+oAyMvIGeqLqB/SyGE2Vw2gp9leyUYuO0tndLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2/2oNExjSHSNHvF1MmWrlwqjV8PdDop16t+mxVg/hE4=; b=MMVcWyjOSn43VdcNfhnSXBtk3CPfOgj4qwdUQ+boxjS6Rzlgn9og0hCJfFsJXtKbxLge0UBBOqVZSyrumtKqTar7vJ4J+9y8106AkgffwJt1/KdBbqueTmMmZ3RO32sliGDP1hlViHfxXUqeZm7UwNWxoYIZnDTE0ZAmMLW+86z9nkcpN3n2+0vDC/HHz4J6LnRrFsj/EvjnGHFCEFjIas2UVkyBcM2EPv4RWADlbk+sinAu+eIj/bwGhGHID9cYBp205BwGc7eCC8FqfO3wu5731fw5lqlkxCjgJKOmixct2Vnzi5Xh9Tf1kz+qy7mr+mUIR1mS+wCh/KeNKuBCXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2/2oNExjSHSNHvF1MmWrlwqjV8PdDop16t+mxVg/hE4=; b=B5AT1H5VDp6ue+so14phwfD4uCEdi4qGf//DpdQoBBscW1wUNwOjbqiIWcuOrtRgbMz/xHFd6MsOUydGdCAdQXmKd7OtNqToKeB29bCUSJY+RYe7Ri5fwSJMu8sYo6NIGtdrscOFn43+OQg6fOMM76YBZcwG2wRSY6AXsyqu/gU= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (20.179.149.217) by MN2PR11MB4207.namprd11.prod.outlook.com (52.135.37.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2263.24; Thu, 19 Sep 2019 14:25:37 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::45dc:e073:4446:4bf8]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::45dc:e073:4446:4bf8%3]) with mapi id 15.20.2263.023; Thu, 19 Sep 2019 14:25:37 +0000 From: Jerome Pouiller To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , David Le Goff , Jerome Pouiller Subject: [PATCH v3 01/20] staging: wfx: add infrastructure for new driver Thread-Topic: [PATCH v3 01/20] staging: wfx: add infrastructure for new driver Thread-Index: AQHVbvYacYIZ8DmG8k+m6MJmn/gLTw== Date: Thu, 19 Sep 2019 14:25:36 +0000 Message-ID: <20190919142527.31797-2-Jerome.Pouiller@silabs.com> References: <20190919142527.31797-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20190919142527.31797-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2d48187c-32a5-444a-ee26-08d73d0d3d74 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600167)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:MN2PR11MB4207; x-ms-traffictypediagnostic: MN2PR11MB4207: x-ms-exchange-purlcount: 1 x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 016572D96D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(376002)(39850400004)(366004)(396003)(136003)(199004)(189003)(2501003)(71200400001)(71190400001)(99286004)(4326008)(478600001)(25786009)(6512007)(6306002)(107886003)(3846002)(6116002)(14444005)(14454004)(256004)(30864003)(6486002)(2906002)(1076003)(966005)(86362001)(6436002)(66574012)(2616005)(476003)(26005)(316002)(446003)(36756003)(8676002)(81166006)(81156014)(11346002)(54906003)(110136005)(8936002)(102836004)(186003)(5660300002)(7736002)(305945005)(91956017)(76176011)(66066001)(66946007)(6506007)(486006)(76116006)(66476007)(66446008)(64756008)(66556008);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4207;H:MN2PR11MB4063.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: UkPoHEq1vVjBe+ZJa/VEJv3mR5bUUbDaTgzL2NnmN6bmWo8+z8jkuWc+hWvEtUEYbStumQGzQVysan8Q36Ej2Cn+Nc70Aqc/CySBxWbv5oGdfZyWYh0rJaC0m8HXTqJNuquc09IkuCaCpmB45O+JFTtiLGwj2W7BxhIPZJC6SHNEZwVMsBHfN+JCWV5n1jY6Hq29cW8eXjSVNlxFaD0RZtivc2QmMrWhI7Wx7MUV1szahv490gIxHZUF5vgj1YsRj1DeJSp0Avck6OK2eQT87BEXomqu2XcyaKDUTvaorfg7ZSF07XUxhaUu6Y/LVUUTJfhFuwOCb7ni22+BkqJwnqXQxazZjhfbE4wfuokLInqDzU40e6nvuRtZ3z9P7R7KQqUSlLcY+2fbb7mqs5adUjbozQzl+CyQ2DxZrOfWXgM= Content-ID: <4EC01921CDC2D24DB113BDDD4B75630C@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2d48187c-32a5-444a-ee26-08d73d0d3d74 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Sep 2019 14:25:36.7539 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sDXjeYBRY3nb5AJ+w+B/zV8oTfowmn+SRq2PGXwxuthv+2ViXPfgPQVP7hzX4KyVmYO7Sb/Yi0iQGm3hAbjYhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4207 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller 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: Jérôme Pouiller --- MAINTAINERS | 5 + drivers/staging/Kconfig | 2 + drivers/staging/Makefile | 1 + .../bindings/net/wireless/siliabs,wfx.txt | 97 +++++++++++++++++++ drivers/staging/wfx/Kconfig | 7 ++ drivers/staging/wfx/Makefile | 8 ++ drivers/staging/wfx/TODO | 20 ++++ drivers/staging/wfx/bus.h | 17 ++++ drivers/staging/wfx/bus_sdio.c | 70 +++++++++++++ drivers/staging/wfx/bus_spi.c | 53 ++++++++++ drivers/staging/wfx/main.c | 47 +++++++++ drivers/staging/wfx/wfx_version.h | 3 + 12 files changed, 330 insertions(+) create mode 100644 drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt create mode 100644 drivers/staging/wfx/Kconfig create mode 100644 drivers/staging/wfx/Makefile create mode 100644 drivers/staging/wfx/TODO create mode 100644 drivers/staging/wfx/bus.h create mode 100644 drivers/staging/wfx/bus_sdio.c create mode 100644 drivers/staging/wfx/bus_spi.c create mode 100644 drivers/staging/wfx/main.c create mode 100644 drivers/staging/wfx/wfx_version.h diff --git a/MAINTAINERS b/MAINTAINERS index b2326dece28e..0ad6fbde3ac9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14755,6 +14755,11 @@ S: Maintained F: drivers/input/touchscreen/silead.c F: drivers/platform/x86/touchscreen_dmi.c +SILICON LABS WIRELESS DRIVERS (for WFxxx series) +M: Jérôme Pouiller +S: Supported +F: drivers/staging/wfx/ + SILICON MOTION SM712 FRAME BUFFER DRIVER M: Sudip Mukherjee M: Teddy Wang diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig index 6f1fa4c849a1..a490141a0e88 100644 --- a/drivers/staging/Kconfig +++ b/drivers/staging/Kconfig @@ -125,4 +125,6 @@ source "drivers/staging/exfat/Kconfig" source "drivers/staging/qlge/Kconfig" +source "drivers/staging/wfx/Kconfig" + endif # STAGING diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile index a90f9b308c8d..4cb548a0ff87 100644 --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile @@ -53,3 +53,4 @@ obj-$(CONFIG_UWB) += uwb/ obj-$(CONFIG_USB_WUSB) += wusbcore/ obj-$(CONFIG_EXFAT_FS) += exfat/ obj-$(CONFIG_QLGE) += qlge/ +obj-$(CONFIG_WFX) += wfx/ diff --git a/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt b/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt new file mode 100644 index 000000000000..15965c9b4180 --- /dev/null +++ b/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt @@ -0,0 +1,97 @@ +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 + diff --git a/drivers/staging/wfx/Kconfig b/drivers/staging/wfx/Kconfig new file mode 100644 index 000000000000..9b8a1c7a9e90 --- /dev/null +++ b/drivers/staging/wfx/Kconfig @@ -0,0 +1,7 @@ +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. diff --git a/drivers/staging/wfx/Makefile b/drivers/staging/wfx/Makefile new file mode 100644 index 000000000000..74939a5a0a1c --- /dev/null +++ b/drivers/staging/wfx/Makefile @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0 + +wfx-y := \ + main.o +wfx-$(CONFIG_SPI) += bus_spi.o +wfx-$(subst m,y,$(CONFIG_MMC)) += bus_sdio.o + +obj-$(CONFIG_WFX) += wfx.o diff --git a/drivers/staging/wfx/TODO b/drivers/staging/wfx/TODO new file mode 100644 index 000000000000..be990e8f18b1 --- /dev/null +++ b/drivers/staging/wfx/TODO @@ -0,0 +1,20 @@ +This is a list of things that need to be done to get this driver out of the +staging directory. + + - wfx_version.h is still there in order to ensure synchronization with github. + It can be dropped as soon as development is entirely in kernel + + - I have to take a decision about secure link support. I can: + - drop completely + - keep it in an external patch (my preferred option) + - replace call to mbedtls with kernel crypto API (necessitate a + bunch of work) + - pull mbedtls in kernel (non-realistic) + + - mac80211 interface does not (yet) have expected quality to be placed + outside of staging: + - Some processings are redundant with mac80211 ones + - Many members from wfx_dev/wfx_vif can be retrieved from mac80211 + structures + - Some functions are too complex + - ... diff --git a/drivers/staging/wfx/bus.h b/drivers/staging/wfx/bus.h new file mode 100644 index 000000000000..8ce871a8a9ff --- /dev/null +++ b/drivers/staging/wfx/bus.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Common bus abstraction layer. + * + * Copyright (c) 2017-2018, Silicon Laboratories, Inc. + * Copyright (c) 2010, ST-Ericsson + */ +#ifndef WFX_BUS_H +#define WFX_BUS_H + +#include +#include + +extern struct sdio_driver wfx_sdio_driver; +extern struct spi_driver wfx_spi_driver; + +#endif diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c new file mode 100644 index 000000000000..4b26c994f43c --- /dev/null +++ b/drivers/staging/wfx/bus_sdio.c @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * SDIO interface. + * + * Copyright (c) 2017-2019, Silicon Laboratories, Inc. + * Copyright (c) 2010, ST-Ericsson + */ +#include +#include +#include +#include + +#include "bus.h" + +static const struct of_device_id wfx_sdio_of_match[]; +static int wfx_sdio_probe(struct sdio_func *func, + const struct sdio_device_id *id) +{ + struct device_node *np = func->dev.of_node; + + if (func->num != 1) { + dev_err(&func->dev, "SDIO function number is %d while it should always be 1 (unsupported chip?)\n", func->num); + return -ENODEV; + } + + if (np) { + if (!of_match_node(wfx_sdio_of_match, np)) { + dev_warn(&func->dev, "no compatible device found in DT\n"); + return -ENODEV; + } + } else { + dev_warn(&func->dev, "device is not declared in DT, features will be limited\n"); + // FIXME: ignore VID/PID and only rely on device tree + // return -ENODEV; + } + return -EIO; // FIXME: not yet supported +} + +static void wfx_sdio_remove(struct sdio_func *func) +{ +} + +#define SDIO_VENDOR_ID_SILABS 0x0000 +#define SDIO_DEVICE_ID_SILABS_WF200 0x1000 +static const struct sdio_device_id wfx_sdio_ids[] = { + { SDIO_DEVICE(SDIO_VENDOR_ID_SILABS, SDIO_DEVICE_ID_SILABS_WF200) }, + // FIXME: ignore VID/PID and only rely on device tree + // { SDIO_DEVICE(SDIO_ANY_ID, SDIO_ANY_ID) }, + { }, +}; +MODULE_DEVICE_TABLE(sdio, wfx_sdio_ids); + +#ifdef CONFIG_OF +static const struct of_device_id wfx_sdio_of_match[] = { + { .compatible = "silabs,wfx-sdio" }, + { }, +}; +MODULE_DEVICE_TABLE(of, wfx_sdio_of_match); +#endif + +struct sdio_driver wfx_sdio_driver = { + .name = "wfx-sdio", + .id_table = wfx_sdio_ids, + .probe = wfx_sdio_probe, + .remove = wfx_sdio_remove, + .drv = { + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(wfx_sdio_of_match), + } +}; diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c new file mode 100644 index 000000000000..574b60f513e9 --- /dev/null +++ b/drivers/staging/wfx/bus_spi.c @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * SPI interface. + * + * Copyright (c) 2017-2019, Silicon Laboratories, Inc. + * Copyright (c) 2011, Sagrad Inc. + * Copyright (c) 2010, ST-Ericsson + */ +#include +#include +#include + +#include "bus.h" + +static int wfx_spi_probe(struct spi_device *func) +{ + return -EIO; +} + +/* Disconnect Function to be called by SPI stack when device is disconnected */ +static int wfx_spi_disconnect(struct spi_device *func) +{ + return 0; +} + +/* + * For dynamic driver binding, kernel does not use OF to match driver. It only + * use modalias and modalias is a copy of 'compatible' DT node with vendor + * stripped. + */ +static const struct spi_device_id wfx_spi_id[] = { + { "wfx-spi", 0 }, + { }, +}; +MODULE_DEVICE_TABLE(spi, wfx_spi_id); + +#ifdef CONFIG_OF +static const struct of_device_id wfx_spi_of_match[] = { + { .compatible = "silabs,wfx-spi" }, + { }, +}; +MODULE_DEVICE_TABLE(of, wfx_spi_of_match); +#endif + +struct spi_driver wfx_spi_driver = { + .driver = { + .name = "wfx-spi", + .of_match_table = of_match_ptr(wfx_spi_of_match), + }, + .id_table = wfx_spi_id, + .probe = wfx_spi_probe, + .remove = wfx_spi_disconnect, +}; diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c new file mode 100644 index 000000000000..cd69f955f531 --- /dev/null +++ b/drivers/staging/wfx/main.c @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Device probe and register. + * + * Copyright (c) 2017-2019, Silicon Laboratories, Inc. + * Copyright (c) 2010, ST-Ericsson + * Copyright (c) 2008, Johannes Berg + * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (c) 2007-2009, Christian Lamparter + * Copyright (c) 2006, Michael Wu + * Copyright (c) 2004-2006 Jean-Baptiste Note , et al. + */ +#include +#include +#include +#include + +#include "bus.h" +#include "wfx_version.h" + +MODULE_DESCRIPTION("Silicon Labs 802.11 Wireless LAN driver for WFx"); +MODULE_AUTHOR("Jérôme Pouiller "); +MODULE_LICENSE("GPL"); +MODULE_VERSION(WFX_LABEL); + +static int __init wfx_core_init(void) +{ + int ret = 0; + + pr_info("wfx: Silicon Labs " WFX_LABEL "\n"); + + if (IS_ENABLED(CONFIG_SPI)) + ret = spi_register_driver(&wfx_spi_driver); + if (IS_ENABLED(CONFIG_MMC) && !ret) + ret = sdio_register_driver(&wfx_sdio_driver); + return ret; +} +module_init(wfx_core_init); + +static void __exit wfx_core_exit(void) +{ + if (IS_ENABLED(CONFIG_MMC)) + sdio_unregister_driver(&wfx_sdio_driver); + if (IS_ENABLED(CONFIG_SPI)) + spi_unregister_driver(&wfx_spi_driver); +} +module_exit(wfx_core_exit); diff --git a/drivers/staging/wfx/wfx_version.h b/drivers/staging/wfx/wfx_version.h new file mode 100644 index 000000000000..6e7f30207c73 --- /dev/null +++ b/drivers/staging/wfx/wfx_version.h @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT! */ +#define WFX_LABEL "2.3.1"