From patchwork Tue Dec 17 16:14:52 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: 11298183 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 758DE14B7 for ; Tue, 17 Dec 2019 16:20:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 495C321582 for ; Tue, 17 Dec 2019 16:20:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="mroMfKXp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728634AbfLQQO4 (ORCPT ); Tue, 17 Dec 2019 11:14:56 -0500 Received: from mail-co1nam11on2040.outbound.protection.outlook.com ([40.107.220.40]:6107 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728611AbfLQQOz (ORCPT ); Tue, 17 Dec 2019 11:14:55 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k7qc12X7GSOUBvetG+6GZPzWCKT/3xxx78OJrjWcPibud0gBNBMAPVmqVGqruAJodXEMi84lXizHxP/uca3tB5W0dBpMg1zAxmejw6zt9F4F1DPUkYDFpsDEAzddYSwpOf53m10sGEbLxX+tYba4p4YgL6dgrMdaQFTLFteOk32oeS4YVo489s2uFNjGoOKQyy4CZGmPdm31bS3h43rm3qGltXkFuzb7zfZjAROusqzbhgcFYcWW+Fjp06k70SS+IdEKViezfos4a2OJ5Ww2Bf2P8ex93xEeN5evIO/IZ18zHk1dQCvjKYj70Tp5vJsqK3akFyrs23lKjiDQTN5swA== 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=qSt5Bj9pM1rKsJLNKstOG6EMbm9bl0x5ZrOupIor3mU=; b=dbM57SeNbKEDFqm9y8Bnaa8FxjXDCR7Sscheu1Mm804QgRFB/0+hb/Wp3/kXojGbmBMEVE57SLxmEelsJqKEIMw1mn4G+fL3LXqka3ln/zbE8T2VDvOWAJ/254WksjwamYDB/wp30hSIEegSHuz9WtLfb4aSrap53xu/VktpQzoPEYKCfyesdXwfUVYDYyvUomLxqfCGKWee+BoKtcbvl98w9g3eFHrZYQ9KLXzbfKucie7T80Y2qrnQ+2DHD1wszpMfeOe/5zgRgrEKrhjHZr4OquorhiualXQoJuR/v2F/UX2T0iEy8GzU/Jt2oUBf8ruK48IoVwMBs0U8I1NAOQ== 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=qSt5Bj9pM1rKsJLNKstOG6EMbm9bl0x5ZrOupIor3mU=; b=mroMfKXpb/mAD6ea6kpM3oEXOo7Kd1hAiEXHSkCkzqgqHevIDPano0mzaqGXjwsybljm4tKMODk7QE6U5PY9EPKuWw/HT3vLluXIv9HnyTIclAYbVg2CA6GX51gQlE3758LpsjlJUxsDpENS82qxfy7bWXhJDQq5gZEDFBdwpt4= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3678.namprd11.prod.outlook.com (20.178.254.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.16; Tue, 17 Dec 2019 16:14:53 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2538.019; Tue, 17 Dec 2019 16:14:53 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= 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" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH v2 17/55] staging: wfx: use meaningful names for CFG_BYTE_ORDER_* Thread-Topic: [PATCH v2 17/55] staging: wfx: use meaningful names for CFG_BYTE_ORDER_* Thread-Index: AQHVtPUdMqjBxa9920eBAwh9rliraA== Date: Tue, 17 Dec 2019 16:14:52 +0000 Message-ID: <20191217161318.31402-18-Jerome.Pouiller@silabs.com> References: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191217161318.31402-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR0P264CA0174.FRAP264.PROD.OUTLOOK.COM (2603:10a6:100:1c::18) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.24.0 x-originating-ip: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cda2db70-e93a-4419-3de9-08d7830c3fb0 x-ms-traffictypediagnostic: MN2PR11MB3678: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2150; x-forefront-prvs: 02543CD7CD x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(396003)(366004)(39860400002)(136003)(199004)(189003)(6512007)(66574012)(1076003)(478600001)(86362001)(8936002)(110136005)(316002)(2616005)(26005)(6506007)(5660300002)(36756003)(6486002)(66946007)(66476007)(66556008)(64756008)(66446008)(71200400001)(52116002)(85182001)(81166006)(81156014)(8676002)(54906003)(107886003)(2906002)(4326008)(186003)(85202003);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB3678;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: BCL:0; x-microsoft-antispam-message-info: WFTMkEmbXnKP+iWb/R45yfuJaz2xPzS0MbbaPTYKrazTxOY3CDRTwjYe+pYhn0Xj9FBjrNAnqDw4JFF4VOgI2VVch/1OjzbiQ0tzwv4Cdw4jkKxKzFfFMtPevgXU21wiW2vVfUvkdGp62B3c2wRXZjnIqFMzA7nUaiOtP2//1QhSJpBFkZY8OLDCdPtfr4AJ4sYUDWLo7eC94x1/JvFeynRp5bMEq5gEFQGk0kuwuiqOraWPfF9GQ1d6UdKLihyFFfLW2A3dHwfW55W5DJ2ki6wMc1dA4gaUm6ea9m+3fVLKFpWeyjYro6gPgtcoUPMBIgKQ9GrnOVlOX6bZOIvpz5qK0omSG7Gzu4J53k5MEoHWJ095NdaV+4h+DexvhV7d+G9YIfftaYN0dP4M2fTkCHxsZij3Li85yuYrDXi1c8+gN7mLJBxV5ap6YekLqOfB Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: cda2db70-e93a-4419-3de9-08d7830c3fb0 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2019 16:14:52.9224 (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: sCyQfBFUExA8ieK/HqEwJHwcay4Cr31yr7THbEQ4Ao3jfEf42S0Gim9DUAd3Tw3Ja4HwiAg7QT/SusKDSpto1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3678 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller This new naming allows to save a comment. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bus_spi.c | 2 ++ drivers/staging/wfx/fwio.c | 2 +- drivers/staging/wfx/hwio.h | 15 +++++---------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c index 0a055c4041af..40bc33035de2 100644 --- a/drivers/staging/wfx/bus_spi.c +++ b/drivers/staging/wfx/bus_spi.c @@ -107,6 +107,8 @@ static int wfx_spi_copy_to_io(void *priv, unsigned int addr, cpu_to_le16s(®addr); + // Register address and CONFIG content always use 16bit big endian + // ("BADC" order) if (bus->need_swab) swab16s(®addr); if (bus->need_swab && addr == WFX_REG_CONFIG) diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c index 47e627bf0f8e..9d61082c1e6c 100644 --- a/drivers/staging/wfx/fwio.c +++ b/drivers/staging/wfx/fwio.c @@ -339,7 +339,7 @@ int wfx_init_device(struct wfx_dev *wdev) ktime_t now, start; u32 reg; - reg = CFG_DIRECT_ACCESS_MODE | CFG_CPU_RESET | CFG_WORD_MODE2; + reg = CFG_DIRECT_ACCESS_MODE | CFG_CPU_RESET | CFG_BYTE_ORDER_ABCD; if (wdev->pdata.use_rising_clk) reg |= CFG_CLK_RISE_EDGE; ret = config_reg_write(wdev, reg); diff --git a/drivers/staging/wfx/hwio.h b/drivers/staging/wfx/hwio.h index b2c1a66de963..4b6ef061b40b 100644 --- a/drivers/staging/wfx/hwio.h +++ b/drivers/staging/wfx/hwio.h @@ -37,16 +37,11 @@ int ahb_reg_write(struct wfx_dev *wdev, u32 addr, u32 val); #define CFG_ERR_HOST_NO_IN_QUEUE 0x00000040 #define CFG_ERR_HOST_CRC_MISS 0x00000080 // only with SDIO #define CFG_SPI_IGNORE_CS 0x00000080 // only with SPI -/* Bytes ordering (only writable in SPI): */ -#define CFG_WORD_MODE_MASK 0x00000300 -/* - * B1,B0,B3,B2 (In SPI, register address and - * CONFIG data always use this mode) - */ -#define CFG_WORD_MODE0 0x00000000 -#define CFG_WORD_MODE1 0x00000100 // B3,B2,B1,B0 -#define CFG_WORD_MODE2 0x00000200 // B0,B1,B2,B3 (SDIO) -#define CFG_DIRECT_ACCESS_MODE 0x00000400 // Direct or queue access mode +#define CFG_BYTE_ORDER_MASK 0x00000300 // only writable with SPI +#define CFG_BYTE_ORDER_BADC 0x00000000 +#define CFG_BYTE_ORDER_DCBA 0x00000100 +#define CFG_BYTE_ORDER_ABCD 0x00000200 // SDIO always use this value +#define CFG_DIRECT_ACCESS_MODE 0x00000400 #define CFG_PREFETCH_AHB 0x00000800 #define CFG_DISABLE_CPU_CLK 0x00001000 #define CFG_PREFETCH_SRAM 0x00002000