staging: comedi: adv_pci_dio: move and rename the MAX_*_SUBDEV[SG] defines
For aesthetics, move these defines after the register defines and rename them to have namespace associated with the driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2b60bbde04
commit
a54b6e60f3
@ -31,11 +31,6 @@
|
|||||||
#include "8255.h"
|
#include "8255.h"
|
||||||
#include "comedi_8254.h"
|
#include "comedi_8254.h"
|
||||||
|
|
||||||
#define MAX_DI_SUBDEVS 2 /* max number of DI subdevices per card */
|
|
||||||
#define MAX_DO_SUBDEVS 2 /* max number of DO subdevices per card */
|
|
||||||
#define MAX_DIO_SUBDEVG 2 /* max number of DIO subdevices group per
|
|
||||||
* card */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Register offset definitions
|
* Register offset definitions
|
||||||
*/
|
*/
|
||||||
@ -61,6 +56,11 @@
|
|||||||
/* PCI-1762 interrupt control registers */
|
/* PCI-1762 interrupt control registers */
|
||||||
#define PCI1762_INT_REG 0x06 /* R/W: status/control */
|
#define PCI1762_INT_REG 0x06 /* R/W: status/control */
|
||||||
|
|
||||||
|
/* maximum number of subdevice descriptions in the boardinfo */
|
||||||
|
#define PCI_DIO_MAX_DI_SUBDEVS 2 /* 2 x 8/16/32 input channels max */
|
||||||
|
#define PCI_DIO_MAX_DO_SUBDEVS 2 /* 2 x 8/16/32 output channels max */
|
||||||
|
#define PCI_DIO_MAX_DIO_SUBDEVG 2 /* 2 x any number of 8255 devices max */
|
||||||
|
|
||||||
enum pci_dio_boardid {
|
enum pci_dio_boardid {
|
||||||
TYPE_PCI1730,
|
TYPE_PCI1730,
|
||||||
TYPE_PCI1733,
|
TYPE_PCI1733,
|
||||||
@ -86,9 +86,9 @@ struct diosubd_data {
|
|||||||
struct dio_boardtype {
|
struct dio_boardtype {
|
||||||
const char *name; /* board name */
|
const char *name; /* board name */
|
||||||
int nsubdevs;
|
int nsubdevs;
|
||||||
struct diosubd_data sdi[MAX_DI_SUBDEVS]; /* DI chans */
|
struct diosubd_data sdi[PCI_DIO_MAX_DI_SUBDEVS];
|
||||||
struct diosubd_data sdo[MAX_DO_SUBDEVS]; /* DO chans */
|
struct diosubd_data sdo[PCI_DIO_MAX_DO_SUBDEVS];
|
||||||
struct diosubd_data sdio[MAX_DIO_SUBDEVG]; /* DIO 8255 chans */
|
struct diosubd_data sdio[PCI_DIO_MAX_DIO_SUBDEVG];
|
||||||
unsigned long id_reg;
|
unsigned long id_reg;
|
||||||
unsigned long timer_regbase;
|
unsigned long timer_regbase;
|
||||||
unsigned int is_16bit:1;
|
unsigned int is_16bit:1;
|
||||||
@ -385,7 +385,7 @@ static int pci_dio_auto_attach(struct comedi_device *dev,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
subdev = 0;
|
subdev = 0;
|
||||||
for (i = 0; i < MAX_DI_SUBDEVS; i++) {
|
for (i = 0; i < PCI_DIO_MAX_DI_SUBDEVS; i++) {
|
||||||
d = &board->sdi[i];
|
d = &board->sdi[i];
|
||||||
if (d->chans) {
|
if (d->chans) {
|
||||||
s = &dev->subdevices[subdev++];
|
s = &dev->subdevices[subdev++];
|
||||||
@ -401,7 +401,7 @@ static int pci_dio_auto_attach(struct comedi_device *dev,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAX_DO_SUBDEVS; i++) {
|
for (i = 0; i < PCI_DIO_MAX_DO_SUBDEVS; i++) {
|
||||||
d = &board->sdo[i];
|
d = &board->sdo[i];
|
||||||
if (d->chans) {
|
if (d->chans) {
|
||||||
s = &dev->subdevices[subdev++];
|
s = &dev->subdevices[subdev++];
|
||||||
@ -432,7 +432,7 @@ static int pci_dio_auto_attach(struct comedi_device *dev,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAX_DIO_SUBDEVG; i++) {
|
for (i = 0; i < PCI_DIO_MAX_DIO_SUBDEVG; i++) {
|
||||||
d = &board->sdio[i];
|
d = &board->sdio[i];
|
||||||
for (j = 0; j < d->chans; j++) {
|
for (j = 0; j < d->chans; j++) {
|
||||||
s = &dev->subdevices[subdev++];
|
s = &dev->subdevices[subdev++];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user