Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337090
b: refs/heads/master
c: 22201ce
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent 8312414 commit e994dfa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 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: 8c12ec2616d18e9c6f6a6884a8738586be5a15d9
refs/heads/master: 22201ceaeb4f8c3a97b27cd421d9318566089b8c
17 changes: 13 additions & 4 deletions trunk/drivers/staging/comedi/drivers/poc.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,18 @@ struct boarddef_struct {
const struct comedi_lrange *range;
};

struct poc_private {
unsigned int ao_readback[32];
};

static int readback_insn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct poc_private *devpriv = dev->private;
int chan;

chan = CR_CHAN(insn->chanspec);
data[0] = ((unsigned int *)dev->private)[chan];
data[0] = devpriv->ao_readback[chan];

return 1;
}
Expand All @@ -75,12 +80,13 @@ static int readback_insn(struct comedi_device *dev, struct comedi_subdevice *s,
static int dac02_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct poc_private *devpriv = dev->private;
int temp;
int chan;
int output;

chan = CR_CHAN(insn->chanspec);
((unsigned int *)dev->private)[chan] = data[0];
devpriv->ao_readback[chan] = data[0];
output = data[0];
#ifdef wrong
/* convert to complementary binary if range is bipolar */
Expand Down Expand Up @@ -131,6 +137,7 @@ static int pcl734_insn_bits(struct comedi_device *dev,
static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
{
const struct boarddef_struct *board = comedi_board(dev);
struct poc_private *devpriv;
struct comedi_subdevice *s;
unsigned long iobase;
unsigned int iosize;
Expand Down Expand Up @@ -160,8 +167,10 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (ret)
return ret;

if (alloc_private(dev, sizeof(unsigned int) * board->n_chan) < 0)
return -ENOMEM;
ret = alloc_private(dev, sizeof(*devpriv));
if (ret)
return ret;
devpriv = dev->private;

/* analog output subdevice */
s = &dev->subdevices[0];
Expand Down

0 comments on commit e994dfa

Please sign in to comment.