From: Ian Abbott Date: Fri, 20 May 2016 13:49:07 +0000 (+0100) Subject: staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxBA values X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5eaa593dbf4830cb7e2513dbbcf5bbb274da0ccd;p=linux-beck.git staging: comedi: drivers: re-do macros for PLX PCI 9080 LASxBA values 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c index 59d81e86a79c..f997c1f85c86 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 8788117f91eb..140135c68308 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