summaryrefslogtreecommitdiff
path: root/drivers/staging/wfx/bus_spi.c
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2019-09-19 17:25:38 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-04 11:43:39 +0300
commit652b4afb240e5dc196995597942309e89e89c767 (patch)
tree87485071d34ff3cd36ea1a0e4a39df2fa3d6f137 /drivers/staging/wfx/bus_spi.c
parentfee695e3e30f72a18d4631b8d7589cf413282c7c (diff)
downloadlinux-652b4afb240e5dc196995597942309e89e89c767.tar.xz
staging: wfx: load firmware
A firmware is necessary to run the chip. wfx_init_device() is in charge of loading firmware on chip and doing low level initialization. Firmwares for WF200 are available here: https://github.com/SiliconLabs/wfx-firmware/ Note that firmware are encrypted. Driver checks that key used to encrypt firmware match with key burned into chip. Currently, "C0" key is used for production chips. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20190919142527.31797-6-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/bus_spi.c')
-rw-r--r--drivers/staging/wfx/bus_spi.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c
index 5e8f84baf2ca..b73b9416273f 100644
--- a/drivers/staging/wfx/bus_spi.c
+++ b/drivers/staging/wfx/bus_spi.c
@@ -27,6 +27,8 @@ MODULE_PARM_DESC(gpio_reset, "gpio number for reset. -1 for none.");
#define SET_READ 0x8000 /* usage: or operation */
static const struct wfx_platform_data wfx_spi_pdata = {
+ .file_fw = "wfm_wf200",
+ .use_rising_clk = true,
};
struct wfx_spi_priv {
@@ -205,6 +207,10 @@ static int wfx_spi_probe(struct spi_device *func)
if (!bus->core)
return -EIO;
+ ret = wfx_probe(bus->core);
+ if (ret)
+ wfx_free_common(bus->core);
+
return ret;
}
@@ -213,6 +219,7 @@ static int wfx_spi_disconnect(struct spi_device *func)
{
struct wfx_spi_priv *bus = spi_get_drvdata(func);
+ wfx_release(bus->core);
wfx_free_common(bus->core);
// A few IRQ will be sent during device release. Hopefully, no IRQ
// should happen after wdev/wvif are released.