From patchwork Sat Sep 17 16:06:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 9337301 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 23D9560839 for ; Sat, 17 Sep 2016 16:06:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1738528AA3 for ; Sat, 17 Sep 2016 16:06:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C2D828AC7; Sat, 17 Sep 2016 16:06:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38A9D28AA3 for ; Sat, 17 Sep 2016 16:06:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753935AbcIQQGn (ORCPT ); Sat, 17 Sep 2016 12:06:43 -0400 Received: from muru.com ([72.249.23.125]:42586 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753761AbcIQQGl (ORCPT ); Sat, 17 Sep 2016 12:06:41 -0400 Received: from sampyla.monkeybrains.net (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 717AF83C5; Sat, 17 Sep 2016 16:06:58 +0000 (UTC) From: Tony Lindgren To: Kalle Valo Cc: Eyal Reizer , Guy Mishol , Luca Coelho , Maital Hahn , Maxim Altshul , Shahar Patury , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH 1/5] wlcore: Prepare family to fix nvs file handling Date: Sat, 17 Sep 2016 09:06:29 -0700 Message-Id: <20160917160633.8767-2-tony@atomide.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160917160633.8767-1-tony@atomide.com> References: <20160917160633.8767-1-tony@atomide.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move struct wilink_family_data to be available for all TI WLAN variants. And fix familiy typo, it should be just family. Looks like wl12xx use two different nvs.bin files and wl18xx uses a different conf.bin file. Signed-off-by: Tony Lindgren --- drivers/net/wireless/ti/wlcore/spi.c | 12 ++++-------- drivers/net/wireless/ti/wlcore/wlcore_i.h | 7 +++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ti/wlcore/spi.c b/drivers/net/wireless/ti/wlcore/spi.c --- a/drivers/net/wireless/ti/wlcore/spi.c +++ b/drivers/net/wireless/ti/wlcore/spi.c @@ -80,17 +80,13 @@ ((SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) + 1) -struct wilink_familiy_data { - char name[8]; -}; - -static const struct wilink_familiy_data *wilink_data; +static const struct wilink_family_data *wilink_data; -static const struct wilink_familiy_data wl18xx_data = { +static const struct wilink_family_data wl18xx_data = { .name = "wl18xx", }; -static const struct wilink_familiy_data wl12xx_data = { +static const struct wilink_family_data wl12xx_data = { .name = "wl12xx", }; @@ -461,7 +457,7 @@ static int wlcore_probe_of(struct spi_device *spi, struct wl12xx_spi_glue *glue, return -ENODEV; wilink_data = of_id->data; - dev_info(&spi->dev, "selected chip familiy is %s\n", + dev_info(&spi->dev, "selected chip family is %s\n", wilink_data->name); if (of_find_property(dt_node, "clock-xtal", NULL)) diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h --- a/drivers/net/wireless/ti/wlcore/wlcore_i.h +++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h @@ -42,6 +42,12 @@ */ #define WL12XX_NVS_NAME "ti-connectivity/wl1271-nvs.bin" +struct wilink_family_data { + const char *name; + const char *nvs_name; /* wl12xx nvs file */ + const char *cfg_name; /* wl18xx cfg file */ +}; + #define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff)) #define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff)) #define WL1271_TX_SQN_POST_RECOVERY_PADDING 0xff @@ -208,6 +214,7 @@ struct wl1271_if_operations { struct wlcore_platdev_data { struct wl1271_if_operations *if_ops; + const struct wilink_family_data *family; bool ref_clock_xtal; /* specify whether the clock is XTAL or not */ u32 ref_clock_freq; /* in Hertz */