Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186662
b: refs/heads/master
c: 23d53b1
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Adolphi authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 6c09a3b commit 2ad75e8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 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: d2e01434fd9c01687a7cace957f182594cccc829
refs/heads/master: 23d53b1768f9396d0e259a9b4e62bfcc03122bab
57 changes: 28 additions & 29 deletions trunk/drivers/staging/comedi/drivers/c6xdigio.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This driver will not work with a 2.4 kernel.
#include <linux/interrupt.h>
#include <linux/timex.h>
#include <linux/timer.h>
#include <asm/io.h>
#include <linux/io.h>
#include <linux/pnp.h>

#include "../comedidev.h"
Expand Down Expand Up @@ -220,11 +220,11 @@ static int C6X_encInput(unsigned long baseAddr, unsigned channel)
/* printk("Inside C6X_encInput\n"); */

enc.value = 0;
if (channel == 0) {
if (channel == 0)
ppcmd = 0x48;
} else {
else
ppcmd = 0x50;
}

WriteByteToHwPort(baseAddr, ppcmd);
tmp = ReadByteFromHwPort(baseAddr + 1);
while (((tmp & 0x80) == 0) && (timeout < C6XDIGIO_TIME_OUT)) {
Expand Down Expand Up @@ -391,9 +391,8 @@ static int c6xdigio_ei_insn_read(struct comedi_device *dev,
int n;
int chan = CR_CHAN(insn->chanspec);

for (n = 0; n < insn->n; n++) {
for (n = 0; n < insn->n; n++)
data[n] = (C6X_encInput(dev->iobase, chan) & 0xffffff);
}

return n;
}
Expand All @@ -420,9 +419,9 @@ static void board_init(struct comedi_device *dev)

static const struct pnp_device_id c6xdigio_pnp_tbl[] = {
/* Standard LPT Printer Port */
{.id = "PNP0400",.driver_data = 0},
{.id = "PNP0400", .driver_data = 0},
/* ECP Printer Port */
{.id = "PNP0401",.driver_data = 0},
{.id = "PNP0401", .driver_data = 0},
{}
};

Expand Down Expand Up @@ -452,15 +451,14 @@ static int c6xdigio_attach(struct comedi_device *dev,
if (result < 0)
return result;

/* Make sure that PnP ports gets activated */
/* Make sure that PnP ports get activated */
pnp_register_driver(&c6xdigio_pnp_driver);

irq = it->options[1];
if (irq > 0) {
if (irq > 0)
printk("comedi%d: irq = %u ignored\n", dev->minor, irq);
} else if (irq == 0) {
else if (irq == 0)
printk("comedi%d: no irq\n", dev->minor);
}

s = dev->subdevices + 0;
/* pwm output subdevice */
Expand All @@ -483,36 +481,37 @@ static int c6xdigio_attach(struct comedi_device *dev,
s->maxdata = 0xffffff;
s->range_table = &range_unknown;

/* s = dev->subdevices + 2; */
/* s = dev->subdevices + 2; */
/* pwm output subdevice */
/* s->type = COMEDI_SUBD_COUNTER; // Not sure what to put here */
/* s->subdev_flags = SDF_WRITEABLE; */
/* s->n_chan = 1; */
/* s->trig[0] = c6xdigio_ei_init; */
/* s->insn_read = c6xdigio_ei_init_insn_read; */
/* s->insn_write = c6xdigio_ei_init_insn_write; */
/* s->maxdata = 0xFFFF; // Really just a don't care */
/* s->range_table = &range_unknown; // Not sure what to put here */

/* I will call this init anyway but more than likely the DSP board will not be connect */
/* when device driver is loaded. */
/* s->type = COMEDI_SUBD_COUNTER; // Not sure what to put here */
/* s->subdev_flags = SDF_WRITEABLE; */
/* s->n_chan = 1; */
/* s->trig[0] = c6xdigio_ei_init; */
/* s->insn_read = c6xdigio_ei_init_insn_read; */
/* s->insn_write = c6xdigio_ei_init_insn_write; */
/* s->maxdata = 0xFFFF; // Really just a don't care */
/* s->range_table = &range_unknown; // Not sure what to put here */

/* I will call this init anyway but more than likely the DSP board */
/* will not be connected when device driver is loaded. */
board_init(dev);

return 0;
}

static int c6xdigio_detach(struct comedi_device *dev)
{
/* board_halt(dev); may not need this */
/* board_halt(dev); may not need this */

printk("comedi%d: c6xdigio: remove\n", dev->minor);

if (dev->iobase) {
if (dev->iobase)
release_region(dev->iobase, C6XDIGIO_SIZE);
}
if (dev->irq) {

/* Not using IRQ so I am not sure if I need this */
if (dev->irq)
free_irq(dev->irq, dev);
} /* Not using IRQ so I am not sure if I need this */

pnp_unregister_driver(&c6xdigio_pnp_driver);

return 0;
Expand Down

0 comments on commit 2ad75e8

Please sign in to comment.