From patchwork Mon Dec 16 17:03:42 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: 11294705 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 6A245930 for ; Mon, 16 Dec 2019 17:05:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A83020726 for ; Mon, 16 Dec 2019 17:05:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="iiMzplUG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727229AbfLPRFD (ORCPT ); Mon, 16 Dec 2019 12:05:03 -0500 Received: from mail-eopbgr700045.outbound.protection.outlook.com ([40.107.70.45]:49121 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727014AbfLPRD5 (ORCPT ); Mon, 16 Dec 2019 12:03:57 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NJC1zfVCBsud4b2F0spUt7h9MLBz+SBQN+PChhhqh+ppfIAv78SIEJbBVjiIIfb9OtIgejzU7mZ3x1dfNrH/Uo0kxv75eWBR3e3O6hwZohm1dNa/um9Qbz3scIAHvpVTNm2ZH+LnuvwmfIED8XZixHdQDzLEKNcbumM8ROjK0V7wUVCwFb0c7E9MjYpn1h78bAR7VXDtOAieFzD31I1TwDSbdL2BkKXZDmOZ17hcvstrw09X9hnfW+xmGscB4Vb3xNZc4z70OE3jN1PRqnVA2ma/JKcdH+7v+/JZXc64NvYqCWFWsxXqJam5RxYhjE8swY+TzYlxfaDNTJnE73UFkw== 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=WBQvaAN7T/oh4yuJy8t0W5XVBFMQQF3pkgjJtSY5LsQ=; b=celenVDz2D6tE9lYomQOWvyTF7BvOtM4eWd9vXOqQP4esvMlwjCJsXWcz/dC4K6/myl6fsaOm5Z6/SeIK3vqJ+4H9hUk0TgSz8cK38NgOJs3RpKUT4flpU/pUhA7+lKzaFVyepEnpgRBHQWF99tY2ygJOrNC9zNgkttdyaVdEJp/hZidrW0uuxxDH3qiyVihMa4EoUe8rID09hvr/tfn7tqXAJYGMl+eb+Gq5ijRfMStdoOSUOe3xxmb8J9cQVvOeyt51wU9cSHdTvEZmlgXPkcfNOLwcnBL0cHFR5XhIMmeF9GJ4xRV+NddXB+ekHV80JiYfohqo38Ej30bYP90GQ== 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=WBQvaAN7T/oh4yuJy8t0W5XVBFMQQF3pkgjJtSY5LsQ=; b=iiMzplUG3NgtTvVTYzXXIh4pHbzduZ3piuULYy77UqHVim9jsJFIj1q7oyclIcKC7YbDiJc4k3fX5Xp2zMpTRwpFVH1Q36M95NMYAjGp5jx9BS4AiJ+5OeLI9rmTHvqCF6u8VYsn+jne24XT+mLTXLY0up2rUCoIvF2MKPJVTVs= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4351.namprd11.prod.outlook.com (52.135.39.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.19; Mon, 16 Dec 2019 17:03:50 +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; Mon, 16 Dec 2019 17:03:50 +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 17/55] staging: wfx: use meaningful names for CFG_BYTE_ORDER_* Thread-Topic: [PATCH 17/55] staging: wfx: use meaningful names for CFG_BYTE_ORDER_* Thread-Index: AQHVtDLE78zIHJwiN0ma3+cloHitWw== Date: Mon, 16 Dec 2019 17:03:42 +0000 Message-ID: <20191216170302.29543-18-Jerome.Pouiller@silabs.com> References: <20191216170302.29543-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20191216170302.29543-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: 95037123-30b6-4ac8-868a-08d78249ec26 x-ms-traffictypediagnostic: MN2PR11MB4351: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2150; x-forefront-prvs: 02530BD3AA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(376002)(346002)(396003)(39860400002)(199004)(189003)(66556008)(66446008)(64756008)(66476007)(76116006)(85202003)(91956017)(66946007)(54906003)(107886003)(4326008)(478600001)(110136005)(71200400001)(6512007)(81156014)(8676002)(81166006)(186003)(36756003)(2906002)(85182001)(6666004)(66574012)(1076003)(316002)(6506007)(5660300002)(86362001)(26005)(2616005)(6486002)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:MN2PR11MB4351;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: bLTnrt7UNQAXoKib7mYy5xjko4lbTHMh7i/3tTrM1uibqqHBSNinmz4HyfxAEl6L4k/cWTzd7ZetPXUupymIkncja9G++RGQA48gl0fjsFbQqx/wYmVPUzAHDAzCwEZcHyktJZgiPduwNBqAlwAdJCZaWsICCsHwMaK/DSjiIR6GiMu+xDF1OflXH/K5+bx0mziiF775gCQG/EUsbaf1W7DFDOrtmFa75aXmz3szt7Kw2kWodTuolGZdsesVYEXPg75HquVKXtzhYJdV0tBFjCwHz7N82sUTPjixz5pbxFg8xhzPzNeOnhAOIuVibW1E056LCjmo2j42rth2o4nhuu81ACl72KP/dgeuLM+WSMh2qBDEZCWAhH7nDIRaJ8l8ntvVbG3E7oylouB2AAatOqS3i1HyVVST9VpFU8sj0Sc7EZMHde8qogbOgbuBwk3I Content-ID: <9207438124E92F4EB4716A2485A0211F@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 95037123-30b6-4ac8-868a-08d78249ec26 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Dec 2019 17:03:42.3141 (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: s/XMg2IwmcibGByA3kC9pDY4L98Ndmm6p8QNZoulpOg5Y2XAX8miXQPG388DPy0lZBooPD3YA4xf8ptU5+BJAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4351 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