Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317366
b: refs/heads/master
c: f218d9f
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jun 14, 2012
1 parent 6e9ccda commit 303fff8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 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: e64fb55b1a519a7d0fda51f40ab668830d6475ac
refs/heads/master: f218d9f57b472848da34beac3e8097b054dcb2fe
23 changes: 13 additions & 10 deletions trunk/drivers/staging/comedi/drivers/8255.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ void subdev_8255_interrupt(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct subdev_8255_private *spriv = s->private;
unsigned long iobase = spriv->iobase;
short d;

d = spriv->io(0, _8255_DATA, 0, spriv->iobase);
d |= (spriv->io(0, _8255_DATA + 1, 0, spriv->iobase) << 8);
d = spriv->io(0, _8255_DATA, 0, iobase);
d |= (spriv->io(0, _8255_DATA + 1, 0, iobase) << 8);

comedi_buf_put(s->async, d);
s->async->events |= COMEDI_CB_EOS;
Expand All @@ -133,32 +134,33 @@ static int subdev_8255_insn(struct comedi_device *dev,
struct comedi_insn *insn, unsigned int *data)
{
struct subdev_8255_private *spriv = s->private;
unsigned long iobase = spriv->iobase;

if (data[0]) {
s->state &= ~data[0];
s->state |= (data[0] & data[1]);

if (data[0] & 0xff)
spriv->io(1, _8255_DATA, s->state & 0xff,
spriv->iobase);
spriv->io(1, _8255_DATA, s->state & 0xff, iobase);
if (data[0] & 0xff00)
spriv->io(1, _8255_DATA + 1,
(s->state >> 8) & 0xff, spriv->iobase);
(s->state >> 8) & 0xff, iobase);
if (data[0] & 0xff0000)
spriv->io(1, _8255_DATA + 2,
(s->state >> 16) & 0xff, spriv->iobase);
(s->state >> 16) & 0xff, iobase);
}

data[1] = spriv->io(0, _8255_DATA, 0, spriv->iobase);
data[1] |= (spriv->io(0, _8255_DATA + 1, 0, spriv->iobase) << 8);
data[1] |= (spriv->io(0, _8255_DATA + 2, 0, spriv->iobase) << 16);
data[1] = spriv->io(0, _8255_DATA, 0, iobase);
data[1] |= (spriv->io(0, _8255_DATA + 1, 0, iobase) << 8);
data[1] |= (spriv->io(0, _8255_DATA + 2, 0, iobase) << 16);

return 2;
}

static void do_config(struct comedi_device *dev, struct comedi_subdevice *s)
{
struct subdev_8255_private *spriv = s->private;
unsigned long iobase = spriv->iobase;
int config;

config = CR_CW;
Expand All @@ -171,7 +173,8 @@ static void do_config(struct comedi_device *dev, struct comedi_subdevice *s)
config |= CR_C_LO_IO;
if (!(s->io_bits & 0xf00000))
config |= CR_C_HI_IO;
spriv->io(1, _8255_CR, config, spriv->iobase);

spriv->io(1, _8255_CR, config, iobase);
}

static int subdev_8255_insn_config(struct comedi_device *dev,
Expand Down

0 comments on commit 303fff8

Please sign in to comment.