Commit a9c254a7 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: drivers: re-do PLX PCI 9080 BIGEND register values

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: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b5dcdcea
...@@ -1294,7 +1294,7 @@ static void init_plx9080(struct comedi_device *dev) ...@@ -1294,7 +1294,7 @@ static void init_plx9080(struct comedi_device *dev)
readl(devpriv->plx9080_iobase + PLX_REG_CNTRL); readl(devpriv->plx9080_iobase + PLX_REG_CNTRL);
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
bits = BIGEND_DMA0 | BIGEND_DMA1; bits = PLX_BIGEND_DMA0 | PLX_BIGEND_DMA1;
#else #else
bits = 0; bits = 0;
#endif #endif
......
...@@ -547,7 +547,7 @@ static void gsc_hpdi_init_plx9080(struct comedi_device *dev) ...@@ -547,7 +547,7 @@ static void gsc_hpdi_init_plx9080(struct comedi_device *dev)
void __iomem *plx_iobase = devpriv->plx9080_mmio; void __iomem *plx_iobase = devpriv->plx9080_mmio;
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
bits = BIGEND_DMA0 | BIGEND_DMA1; bits = PLX_BIGEND_DMA0 | PLX_BIGEND_DMA1;
#else #else
bits = 0; bits = 0;
#endif #endif
......
...@@ -125,21 +125,24 @@ struct plx_dma_desc { ...@@ -125,21 +125,24 @@ struct plx_dma_desc {
/* Big/Little Endian Descriptor Register */ /* Big/Little Endian Descriptor Register */
#define PLX_REG_BIGEND 0x000c #define PLX_REG_BIGEND 0x000c
enum bigend_bits { /* Configuration Register Big Endian Mode */
/* use big endian ordering for configuration register accesses */ #define PLX_BIGEND_CONFIG BIT(0)
BIGEND_CONFIG = 0x1, /* Direct Master Big Endian Mode */
BIGEND_DIRECT_MASTER = 0x2, #define PLX_BIGEND_DM BIT(1)
BIGEND_DIRECT_SLAVE_LOCAL0 = 0x4, /* Direct Slave Address Space 0 Big Endian Mode */
BIGEND_ROM = 0x8, #define PLX_BIGEND_DSAS0 BIT(2)
/* /* Direct Slave Expansion ROM Big Endian Mode */
* use byte lane consisting of most significant bits instead of #define PLX_BIGEND_EROM BIT(3)
* least significant /* Big Endian Byte Lane Mode - use most significant byte lanes */
*/ #define PLX_BIGEND_BEBLM BIT(4)
BIGEND_BYTE_LANE = 0x10, /* Direct Slave Address Space 1 Big Endian Mode */
BIGEND_DIRECT_SLAVE_LOCAL1 = 0x20, #define PLX_BIGEND_DSAS1 BIT(5)
BIGEND_DMA1 = 0x40, /* DMA Channel 1 Big Endian Mode */
BIGEND_DMA0 = 0x80, #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. ** Note: The Expansion ROM stuff is only relevant to the PC environment.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment