From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755957AbcETNtx (ORCPT ); Fri, 20 May 2016 09:49:53 -0400 Received: from smtp137.dfw.emailsrvr.com ([67.192.241.137]:45723 "EHLO smtp137.dfw.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755498AbcETNtv (ORCPT ); Fri, 20 May 2016 09:49:51 -0400 X-Auth-ID: abbotti@mev.co.uk X-Sender-Id: abbotti@mev.co.uk From: Ian Abbott To: devel@driverdev.osuosl.org Cc: Greg Kroah-Hartman , Ian Abbott , H Hartley Sweeten , linux-kernel@vger.kernel.org Subject: [PATCH 07/20] staging: comedi: drivers: re-do PLX PCI 9080 BIGEND register values Date: Fri, 20 May 2016 14:49:09 +0100 Message-Id: <1463752162-15181-8-git-send-email-abbotti@mev.co.uk> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1463752162-15181-1-git-send-email-abbotti@mev.co.uk> References: <1463752162-15181-1-git-send-email-abbotti@mev.co.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace `enum bigend_bits` in "plx9080.h" with a bunch of macros defining values for the BIGEND register. Use the prefix `PLX_BIGEND_` for the macro names. Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define the values. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/cb_pcidas64.c | 2 +- drivers/staging/comedi/drivers/gsc_hpdi.c | 2 +- drivers/staging/comedi/drivers/plx9080.h | 33 +++++++++++++++------------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c index f997c1f..4a8e88a 100644 --- a/drivers/staging/comedi/drivers/cb_pcidas64.c +++ b/drivers/staging/comedi/drivers/cb_pcidas64.c @@ -1294,7 +1294,7 @@ static void init_plx9080(struct comedi_device *dev) readl(devpriv->plx9080_iobase + PLX_REG_CNTRL); #ifdef __BIG_ENDIAN - bits = BIGEND_DMA0 | BIGEND_DMA1; + bits = PLX_BIGEND_DMA0 | PLX_BIGEND_DMA1; #else bits = 0; #endif diff --git a/drivers/staging/comedi/drivers/gsc_hpdi.c b/drivers/staging/comedi/drivers/gsc_hpdi.c index e2831e1..536bebe 100644 --- a/drivers/staging/comedi/drivers/gsc_hpdi.c +++ b/drivers/staging/comedi/drivers/gsc_hpdi.c @@ -547,7 +547,7 @@ static void gsc_hpdi_init_plx9080(struct comedi_device *dev) void __iomem *plx_iobase = devpriv->plx9080_mmio; #ifdef __BIG_ENDIAN - bits = BIGEND_DMA0 | BIGEND_DMA1; + bits = PLX_BIGEND_DMA0 | PLX_BIGEND_DMA1; #else bits = 0; #endif diff --git a/drivers/staging/comedi/drivers/plx9080.h b/drivers/staging/comedi/drivers/plx9080.h index 0bcdbad..84dd366 100644 --- a/drivers/staging/comedi/drivers/plx9080.h +++ b/drivers/staging/comedi/drivers/plx9080.h @@ -125,21 +125,24 @@ struct plx_dma_desc { /* Big/Little Endian Descriptor Register */ #define PLX_REG_BIGEND 0x000c -enum bigend_bits { - /* use big endian ordering for configuration register accesses */ - BIGEND_CONFIG = 0x1, - BIGEND_DIRECT_MASTER = 0x2, - BIGEND_DIRECT_SLAVE_LOCAL0 = 0x4, - BIGEND_ROM = 0x8, - /* - * use byte lane consisting of most significant bits instead of - * least significant - */ - BIGEND_BYTE_LANE = 0x10, - BIGEND_DIRECT_SLAVE_LOCAL1 = 0x20, - BIGEND_DMA1 = 0x40, - BIGEND_DMA0 = 0x80, -}; +/* Configuration Register Big Endian Mode */ +#define PLX_BIGEND_CONFIG BIT(0) +/* Direct Master Big Endian Mode */ +#define PLX_BIGEND_DM BIT(1) +/* Direct Slave Address Space 0 Big Endian Mode */ +#define PLX_BIGEND_DSAS0 BIT(2) +/* Direct Slave Expansion ROM Big Endian Mode */ +#define PLX_BIGEND_EROM BIT(3) +/* Big Endian Byte Lane Mode - use most significant byte lanes */ +#define PLX_BIGEND_BEBLM BIT(4) +/* Direct Slave Address Space 1 Big Endian Mode */ +#define PLX_BIGEND_DSAS1 BIT(5) +/* DMA Channel 1 Big Endian Mode */ +#define PLX_BIGEND_DMA1 BIT(6) +/* DMA Channel 0 Big Endian Mode */ +#define PLX_BIGEND_DMA0 BIT(7) +/* DMA Channel N Big Endian Mode (N <= 1) */ +#define PLX_BIGEND_DMA(n) ((n) ? PLX_BIGEND_DMA1 : PLX_BIGEND_DMA0) /* ** Note: The Expansion ROM stuff is only relevant to the PC environment. -- 2.8.1