Move the PCI Bar 1 register map defines to the main driver source file. For aesthetics, rename the defines. Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx> Cc: Ian Abbott <abbotti@xxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- .../comedi/drivers/addi-data/hwdrv_apci1500.c | 21 ++++++++------------- drivers/staging/comedi/drivers/addi_apci_1500.c | 7 +++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c index e265bff..3b0d27f 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c @@ -26,12 +26,9 @@ /* DIGITAL INPUT-OUTPUT DEFINE */ -#define APCI1500_DIGITAL_OP 2 -#define APCI1500_DIGITAL_IP 0 #define APCI1500_AND 2 #define APCI1500_OR 4 #define APCI1500_OR_PRIORITY 6 -#define APCI1500_CLK_SELECT 0 #define COUNTER1 0 #define COUNTER2 1 #define COUNTER3 2 @@ -585,7 +582,7 @@ static int apci1500_di_insn_bits(struct comedi_device *dev, { struct apci1500_private *devpriv = dev->private; - data[1] = inw(devpriv->addon + APCI1500_DIGITAL_IP); + data[1] = inw(devpriv->addon + APCI1500_DI_REG); return insn->n; } @@ -626,7 +623,7 @@ static int apci1500_do_write(struct comedi_device *dev, if (data[3] == 0) { if (data[1] == 0) { data[0] = (data[0] << ui_NoOfChannel) | ui_Temp; - outw(data[0], devpriv->addon + APCI1500_DIGITAL_OP); + outw(data[0], devpriv->addon + APCI1500_DO_REG); } else { if (data[1] == 1) { switch (ui_NoOfChannel) { @@ -660,8 +657,7 @@ static int apci1500_do_write(struct comedi_device *dev, } - outw(data[0], - devpriv->addon + APCI1500_DIGITAL_OP); + outw(data[0], devpriv->addon + APCI1500_DO_REG); } else { dev_warn(dev->class_dev, "Specified channel not supported\n"); @@ -679,8 +675,7 @@ static int apci1500_do_write(struct comedi_device *dev, (data[0] << ui_NoOfChannel) ^ 0xffffffff; data[0] = data[0] & ui_Temp; - outw(data[0], - devpriv->addon + APCI1500_DIGITAL_OP); + outw(data[0], devpriv->addon + APCI1500_DO_REG); } else { if (data[1] == 1) { switch (ui_NoOfChannel) { @@ -734,8 +729,8 @@ static int apci1500_do_write(struct comedi_device *dev, } - outw(data[0], devpriv->addon + - APCI1500_DIGITAL_OP); + outw(data[0], + devpriv->addon + APCI1500_DO_REG); } else { dev_warn(dev->class_dev, "Specified channel not supported\n"); @@ -778,7 +773,7 @@ static int apci1500_timer_config(struct comedi_device *dev, /* Selection of the input clock */ if (data[0] == 0 || data[0] == 1 || data[0] == 2) { - outw(data[0], devpriv->addon + APCI1500_CLK_SELECT); + outw(data[0], devpriv->addon + APCI1500_CLK_SEL_REG); } else { if (data[0] != 3) { dev_warn(dev->class_dev, @@ -1611,7 +1606,7 @@ static int apci1500_reset(struct comedi_device *dev) z8536_reset(dev); /* reset all the digital outputs */ - outw(0x0, devpriv->addon + APCI1500_DIGITAL_OP); + outw(0x0, devpriv->addon + APCI1500_DO_REG); /* Deactivates all interrupts */ z8536_write(dev, 0x00, APCI1500_RW_MASTER_INTERRUPT_CONTROL); diff --git a/drivers/staging/comedi/drivers/addi_apci_1500.c b/drivers/staging/comedi/drivers/addi_apci_1500.c index 3238c48..40b3c5c 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1500.c +++ b/drivers/staging/comedi/drivers/addi_apci_1500.c @@ -20,6 +20,13 @@ #define APCI1500_Z8536_PORTA_REG 0x02 #define APCI1500_Z8536_CTRL_REG 0x03 +/* + * PCI Bar 2 Register map (devpriv->addon) + */ +#define APCI1500_CLK_SEL_REG 0x00 +#define APCI1500_DI_REG 0x00 +#define APCI1500_DO_REG 0x02 + struct apci1500_private { unsigned long amcc; unsigned long addon; -- 2.0.3 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel