staging: comedi: pcl724: tidy up the boardinfo struct definition
Remove the unnecessary comments and reorder the variables a bit. Change the 'is_*' and 'can_*' flags to bit fields. Remove the '*_SIZE' defines and open code the values. Reorder the boardinfo declaration to follow the definition. 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
0d4dd7d61b
commit
0a0c2cb96b
1 changed files with 16 additions and 23 deletions
|
@ -46,58 +46,51 @@ See the source for configuration details.
|
||||||
|
|
||||||
#include "8255.h"
|
#include "8255.h"
|
||||||
|
|
||||||
#define PCL722_SIZE 32
|
|
||||||
#define PCL722_96_SIZE 16
|
|
||||||
#define PCL724_SIZE 4
|
|
||||||
#define PCL731_SIZE 8
|
|
||||||
#define PET48_SIZE 2
|
|
||||||
|
|
||||||
#define SIZE_8255 4
|
#define SIZE_8255 4
|
||||||
|
|
||||||
struct pcl724_board {
|
struct pcl724_board {
|
||||||
|
const char *name;
|
||||||
const char *name; /* board name */
|
unsigned int io_range;
|
||||||
int dio; /* num of DIO */
|
unsigned int can_have96:1;
|
||||||
int numofports; /* num of 8255 subdevices */
|
unsigned int is_pet48:1;
|
||||||
unsigned int io_range; /* len of IO space */
|
int dio;
|
||||||
char can_have96;
|
int numofports;
|
||||||
char is_pet48;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct pcl724_board boardtypes[] = {
|
static const struct pcl724_board boardtypes[] = {
|
||||||
{
|
{
|
||||||
.name = "pcl724",
|
.name = "pcl724",
|
||||||
|
.io_range = 0x04,
|
||||||
.dio = 24,
|
.dio = 24,
|
||||||
.numofports = 1,
|
.numofports = 1,
|
||||||
.io_range = PCL724_SIZE,
|
|
||||||
}, {
|
}, {
|
||||||
.name = "pcl722",
|
.name = "pcl722",
|
||||||
|
.io_range = 0x20,
|
||||||
|
.can_have96 = 1,
|
||||||
.dio = 144,
|
.dio = 144,
|
||||||
.numofports = 6,
|
.numofports = 6,
|
||||||
.io_range = PCL722_SIZE,
|
|
||||||
.can_have96 = 1,
|
|
||||||
}, {
|
}, {
|
||||||
.name = "pcl731",
|
.name = "pcl731",
|
||||||
|
.io_range = 0x08,
|
||||||
.dio = 48,
|
.dio = 48,
|
||||||
.numofports = 2,
|
.numofports = 2,
|
||||||
.io_range = PCL731_SIZE,
|
|
||||||
}, {
|
}, {
|
||||||
.name = "acl7122",
|
.name = "acl7122",
|
||||||
|
.io_range = 0x20,
|
||||||
|
.can_have96 = 1,
|
||||||
.dio = 144,
|
.dio = 144,
|
||||||
.numofports = 6,
|
.numofports = 6,
|
||||||
.io_range = PCL722_SIZE,
|
|
||||||
.can_have96 = 1,
|
|
||||||
}, {
|
}, {
|
||||||
.name = "acl7124",
|
.name = "acl7124",
|
||||||
|
.io_range = 0x04,
|
||||||
.dio = 24,
|
.dio = 24,
|
||||||
.numofports = 1,
|
.numofports = 1,
|
||||||
.io_range = PCL724_SIZE,
|
|
||||||
}, {
|
}, {
|
||||||
.name = "pet48dio",
|
.name = "pet48dio",
|
||||||
|
.io_range = 0x02,
|
||||||
|
.is_pet48 = 1,
|
||||||
.dio = 48,
|
.dio = 48,
|
||||||
.numofports = 2,
|
.numofports = 2,
|
||||||
.io_range = PET48_SIZE,
|
|
||||||
.is_pet48 = 1,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -140,7 +133,7 @@ static int pcl724_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||||
iorange = board->io_range;
|
iorange = board->io_range;
|
||||||
if ((board->can_have96) &&
|
if ((board->can_have96) &&
|
||||||
((it->options[1] == 1) || (it->options[1] == 96)))
|
((it->options[1] == 1) || (it->options[1] == 96)))
|
||||||
iorange = PCL722_96_SIZE; /* PCL-724 in 96 DIO configuration */
|
iorange = 0x10; /* PCL-724 in 96 DIO configuration */
|
||||||
ret = comedi_request_region(dev, it->options[0], iorange);
|
ret = comedi_request_region(dev, it->options[0], iorange);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Reference in a new issue