Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325463
b: refs/heads/master
c: 3d9083b
h: refs/heads/master
i:
  325461: 1670ffb
  325459: ce90d5c
  325455: 067161e
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 21, 2012
1 parent 28a9322 commit fe55ea8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 44 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c7817891dbc44612ac59a7d627716fae240b3a7
refs/heads/master: 3d9083b27a960e10a744b8d35694b70abae9a830
54 changes: 11 additions & 43 deletions trunk/drivers/staging/comedi/drivers/s526.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,30 +138,6 @@ struct s526GPCTConfig {
int data[MAX_GPCT_CONFIG_DATA];
};

struct s526_board {
const char *name;
int gpct_chans;
int gpct_bits;
int ad_chans;
int ad_bits;
int da_chans;
int da_bits;
int have_dio;
};

static const struct s526_board s526_boards[] = {
{
.name = "s526",
.gpct_chans = 4,
.gpct_bits = 24,
.ad_chans = 8,
.ad_bits = 16,
.da_chans = 4,
.da_bits = 16,
.have_dio = 1,
}
};

struct s526_private {
unsigned int ao_readback[2];
struct s526GPCTConfig s526_gpct_config[4];
Expand Down Expand Up @@ -611,21 +587,20 @@ static int s526_dio_insn_config(struct comedi_device *dev,

static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
const struct s526_board *board = comedi_board(dev);
struct s526_private *devpriv;
struct comedi_subdevice *s;
int iobase;
int ret;

dev->board_name = dev->driver->driver_name;

iobase = it->options[0];
if (!iobase || !request_region(iobase, S526_IOSIZE, board->name)) {
if (!iobase || !request_region(iobase, S526_IOSIZE, dev->board_name)) {
comedi_error(dev, "I/O port conflict");
return -EIO;
}
dev->iobase = iobase;

dev->board_name = board->name;

ret = alloc_private(dev, sizeof(*devpriv));
if (ret)
return ret;
Expand All @@ -639,7 +614,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* GENERAL-PURPOSE COUNTER/TIME (GPCT) */
s->type = COMEDI_SUBD_COUNTER;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_LSAMPL;
s->n_chan = board->gpct_chans;
s->n_chan = 4;
s->maxdata = 0x00ffffff; /* 24 bit counter */
s->insn_read = s526_gpct_rinsn;
s->insn_config = s526_gpct_insn_config;
Expand Down Expand Up @@ -670,17 +645,13 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)

s = &dev->subdevices[3];
/* digital i/o subdevice */
if (board->have_dio) {
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = 8;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = s526_dio_insn_bits;
s->insn_config = s526_dio_insn_config;
} else {
s->type = COMEDI_SUBD_UNUSED;
}
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = 8;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = s526_dio_insn_bits;
s->insn_config = s526_dio_insn_config;

dev_info(dev->class_dev, "%s attached\n", dev->board_name);

Expand All @@ -698,9 +669,6 @@ static struct comedi_driver s526_driver = {
.module = THIS_MODULE,
.attach = s526_attach,
.detach = s526_detach,
.board_name = &s526_boards[0].name,
.offset = sizeof(struct s526_board),
.num_names = ARRAY_SIZE(s526_boards),
};
module_comedi_driver(s526_driver);

Expand Down

0 comments on commit fe55ea8

Please sign in to comment.