Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324648
b: refs/heads/master
c: b1da494
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Sep 4, 2012
1 parent 6330ea3 commit a5bd7ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 27 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: f1e5aa75e72a301be2c0e3da448c970bca368225
refs/heads/master: b1da49430bb2e78616769623638f869c513e6ec1
31 changes: 5 additions & 26 deletions trunk/drivers/staging/comedi/drivers/comedi_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ zero volts).
#include "comedi_fc.h"
#include <linux/timer.h>

/* Board descriptions */
struct waveform_board {
const char *name;
int ai_chans;
int ai_bits;
int have_dio;
};

#define N_CHANS 8

/* Data unique to this driver */
Expand Down Expand Up @@ -434,15 +426,14 @@ static int waveform_ao_insn_write(struct comedi_device *dev,
static int waveform_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
const struct waveform_board *board = comedi_board(dev);
struct waveform_private *devpriv;
struct comedi_subdevice *s;
int amplitude = it->options[0];
int period = it->options[1];
int i;
int ret;

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

ret = alloc_private(dev, sizeof(*devpriv));
if (ret < 0)
Expand All @@ -467,8 +458,8 @@ static int waveform_attach(struct comedi_device *dev,
/* analog input subdevice */
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_CMD_READ;
s->n_chan = board->ai_chans;
s->maxdata = (1 << board->ai_bits) - 1;
s->n_chan = N_CHANS;
s->maxdata = 0xffff;
s->range_table = &waveform_ai_ranges;
s->len_chanlist = s->n_chan * 2;
s->insn_read = waveform_ai_insn_read;
Expand All @@ -481,8 +472,8 @@ static int waveform_attach(struct comedi_device *dev,
/* analog output subdevice (loopback) */
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND;
s->n_chan = board->ai_chans;
s->maxdata = (1 << board->ai_bits) - 1;
s->n_chan = N_CHANS;
s->maxdata = 0xffff;
s->range_table = &waveform_ai_ranges;
s->len_chanlist = s->n_chan * 2;
s->insn_write = waveform_ao_insn_write;
Expand Down Expand Up @@ -512,23 +503,11 @@ static void waveform_detach(struct comedi_device *dev)
waveform_ai_cancel(dev, dev->read_subdev);
}

static const struct waveform_board waveform_boards[] = {
{
.name = "comedi_test",
.ai_chans = N_CHANS,
.ai_bits = 16,
.have_dio = 0,
},
};

static struct comedi_driver waveform_driver = {
.driver_name = "comedi_test",
.module = THIS_MODULE,
.attach = waveform_attach,
.detach = waveform_detach,
.board_name = &waveform_boards[0].name,
.offset = sizeof(struct waveform_board),
.num_names = ARRAY_SIZE(waveform_boards),
};
module_comedi_driver(waveform_driver);

Expand Down

0 comments on commit a5bd7ec

Please sign in to comment.