linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: devel@driverdev.osuosl.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ian Abbott <abbotti@mev.co.uk>,
	H Hartley Sweeten <hsweeten@visionengravers.com>,
	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	[thread overview]
Message-ID: <1463752162-15181-8-git-send-email-abbotti@mev.co.uk> (raw)
In-Reply-To: <1463752162-15181-1-git-send-email-abbotti@mev.co.uk>

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 <abbotti@mev.co.uk>
---
 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

  parent reply	other threads:[~2016-05-20 13:49 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20 13:49 [PATCH 00/20] staging: comedi: re-do drivers/plx9080.h Ian Abbott
2016-05-20 13:49 ` [PATCH 01/20] staging: comedi: plx9080.h: correct LRNG_IO_MASK and LMAP_IO_MASK Ian Abbott
2016-05-20 13:49 ` [PATCH 02/20] staging: comedi: plx9080.h: remove Power-Up Test Suite stuff Ian Abbott
2016-05-20 13:49 ` [PATCH 03/20] staging: comedi: drivers: rename PLX PCI 9080 register offsets Ian Abbott
2016-05-20 16:21   ` Hartley Sweeten
2016-05-20 16:30     ` Ian Abbott
2016-05-20 16:51       ` Hartley Sweeten
2016-05-20 13:49 ` [PATCH 04/20] staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxRR values Ian Abbott
2016-05-20 16:37   ` Hartley Sweeten
2016-05-20 17:17     ` Ian Abbott
2016-05-20 17:52       ` Hartley Sweeten
2016-05-23 11:21         ` Ian Abbott
2016-05-20 13:49 ` [PATCH 05/20] staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxBA values Ian Abbott
2016-05-20 13:49 ` [PATCH 06/20] staging: comedi: drivers: re-do PLX PCI 9080 MARBR register values Ian Abbott
2016-05-20 13:49 ` Ian Abbott [this message]
2016-05-20 13:49 ` [PATCH 08/20] staging: comedi: drivers: re-do PLX PCI 9080 LBRDx " Ian Abbott
2016-05-20 13:49 ` [PATCH 09/20] staging: comedi: drivers: re-do PLX PCI 9080 DMPBAM " Ian Abbott
2016-05-20 13:49 ` [PATCH 10/20] staging: comedi: drivers: re-do PLX PCI 9080 DMCFGA " Ian Abbott
2016-05-20 13:49 ` [PATCH 11/20] staging: comedi: drivers: re-do PLX PCI 9080 INTCSR " Ian Abbott
2016-05-20 13:49 ` [PATCH 12/20] staging: comedi: drivers: re-do PLX PCI 9080 CNTRL " Ian Abbott
2016-05-20 13:49 ` [PATCH 13/20] staging: comedi: plx9080.h: add hard-coded PCIHIDR register value Ian Abbott
2016-05-20 13:49 ` [PATCH 14/20] staging: comedi: drivers: re-do PLX PCI 9080 DMAMODEx register values Ian Abbott
2016-05-20 13:49 ` [PATCH 15/20] staging: comedi: drivers: re-do PLX PCI 9080 DMADPRx " Ian Abbott
2016-05-20 13:49 ` [PATCH 16/20] staging: comedi: drivers: re-do PLX PCI 9080 DMACSRx " Ian Abbott
2016-05-20 13:49 ` [PATCH 17/20] staging: comedi: drivers: add PLX PCI 9080 DMATHR " Ian Abbott
2016-05-20 13:49 ` [PATCH 18/20] staging: comedi: plx9080.h: tidy up some comments Ian Abbott
2016-05-20 13:49 ` [PATCH 19/20] staging: comedi: plx9080.h: Add kerneldoc comments Ian Abbott
2016-05-20 13:49 ` [PATCH 20/20] staging: comedi: plx9080.h: include headers for declarations Ian Abbott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463752162-15181-8-git-send-email-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).