Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1404464

[PATCH 05/20] staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxBA values

From Ian Abbott <abbotti@mev.co.uk>
Newsgroups linux.kernel
Subject [PATCH 05/20] staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxBA values
Date 2016-05-20 16:00 +0200
Message-ID <rAT87-6ck-41@gated-at.bofh.it> (permalink)
References <rASYp-68P-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Replace the existing macros in "plx9080.h" that define values for the
LAS0BA and LAS1BA registers.  Use the prefix `PLX_LASBA_` for the
macros.  Make use of the `BIT(x)` and `GENMASK(h,l)` macros to define
the macros.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/drivers/cb_pcidas64.c |  4 ++--
 drivers/staging/comedi/drivers/plx9080.h     | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index 59d81e8..f997c1f 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -4006,13 +4006,13 @@ static int auto_attach(struct comedi_device *dev,
 	local_range = readl(devpriv->plx9080_iobase + PLX_REG_LAS0RR) &
 		      PLX_LASRR_MEM_MASK;
 	local_decode = readl(devpriv->plx9080_iobase + PLX_REG_LAS0BA) &
-		       local_range & LMAP_MEM_MASK;
+		       local_range & PLX_LASBA_MEM_MASK;
 	devpriv->local0_iobase = ((uint32_t)devpriv->main_phys_iobase &
 				  ~local_range) | local_decode;
 	local_range = readl(devpriv->plx9080_iobase + PLX_REG_LAS1RR) &
 		      PLX_LASRR_MEM_MASK;
 	local_decode = readl(devpriv->plx9080_iobase + PLX_REG_LAS1BA) &
-		       local_range & LMAP_MEM_MASK;
+		       local_range & PLX_LASBA_MEM_MASK;
 	devpriv->local1_iobase = ((uint32_t)devpriv->dio_counter_phys_iobase &
 				  ~local_range) | local_decode;
 
diff --git a/drivers/staging/comedi/drivers/plx9080.h b/drivers/staging/comedi/drivers/plx9080.h
index 8788117..140135c 100644
--- a/drivers/staging/comedi/drivers/plx9080.h
+++ b/drivers/staging/comedi/drivers/plx9080.h
@@ -70,11 +70,11 @@ struct plx_dma_desc {
 /* Local Address Space 1 Local Base Address (Remap) Register */
 #define PLX_REG_LAS1BA		0x00f4
 
-#define  LMAP_EN           0x00000001	/* Enable slave decode */
-/*  bits that specify decode for memory io */
-#define  LMAP_MEM_MASK     0xfffffff0
-/*  bits that specify decode bits for normal io */
-#define  LMAP_IO_MASK     0xfffffffc
+#define PLX_LASBA_EN		BIT(0)		/* Enable slave decode */
+/* bits that specify local base address for memory space */
+#define PLX_LASBA_MEM_MASK	GENMASK(31, 4)
+/* bits that specify local base address for i/o space */
+#define PLX_LASBA_IO_MASK	GENMASK(31, 2)
 
 /* Mode/Arbitration Register */
 #define PLX_REG_MARBR		0x0008
-- 
2.8.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/20] staging: comedi: re-do drivers/plx9080.h Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 15:50 +0200
  [PATCH 20/20] staging: comedi: plx9080.h: include headers for declarations Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 16/20] staging: comedi: drivers: re-do PLX PCI 9080 DMACSRx register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 14/20] staging: comedi: drivers: re-do PLX PCI 9080 DMAMODEx register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 18/20] staging: comedi: plx9080.h: tidy up some comments Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 15/20] staging: comedi: drivers: re-do PLX PCI 9080 DMADPRx register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 13/20] staging: comedi: plx9080.h: add hard-coded PCIHIDR register value Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 01/20] staging: comedi: plx9080.h: correct LRNG_IO_MASK and LMAP_IO_MASK Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 09/20] staging: comedi: drivers: re-do PLX PCI 9080 DMPBAM register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 07/20] staging: comedi: drivers: re-do PLX PCI 9080 BIGEND register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 06/20] staging: comedi: drivers: re-do PLX PCI 9080 MARBR register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 05/20] staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxBA values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 19/20] staging: comedi: plx9080.h: Add kerneldoc comments Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 12/20] staging: comedi: drivers: re-do PLX PCI 9080 CNTRL register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 10/20] staging: comedi: drivers: re-do PLX PCI 9080 DMCFGA register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 11/20] staging: comedi: drivers: re-do PLX PCI 9080 INTCSR register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 17/20] staging: comedi: drivers: add PLX PCI 9080 DMATHR register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 08/20] staging: comedi: drivers: re-do PLX PCI 9080 LBRDx register values Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
  [PATCH 03/20] staging: comedi: drivers: rename PLX PCI 9080 register offsets Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 16:00 +0200
    RE: [PATCH 03/20] staging: comedi: drivers: rename PLX PCI 9080  register offsets Hartley Sweeten <HartleyS@visionengravers.com> - 2016-05-20 18:30 +0200
      Re: [PATCH 03/20] staging: comedi: drivers: rename PLX PCI 9080  register offsets Ian Abbott <abbotti@mev.co.uk> - 2016-05-20 18:40 +0200
        RE: [PATCH 03/20] staging: comedi: drivers: rename PLX PCI 9080  register offsets Hartley Sweeten <HartleyS@visionengravers.com> - 2016-05-20 19:00 +0200

csiph-web