Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304460
b: refs/heads/master
c: 3e699ed
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Apr 24, 2012
1 parent 8eedff7 commit f36f45a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 43 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: 1b18bbb580e96af4e12788fcc1758f68a5cebf86
refs/heads/master: 3e699ed17040f7c8474bbeaf834077f78d301e13
78 changes: 36 additions & 42 deletions trunk/drivers/staging/comedi/drivers/8255.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,31 +107,6 @@ struct subdev_8255_struct {
#define CALLBACK_FUNC (((struct subdev_8255_struct *)s->private)->cb_func)
#define subdevpriv ((struct subdev_8255_struct *)s->private)

static int dev_8255_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int dev_8255_detach(struct comedi_device *dev);
static struct comedi_driver driver_8255 = {
.driver_name = "8255",
.module = THIS_MODULE,
.attach = dev_8255_attach,
.detach = dev_8255_detach,
};

static int __init driver_8255_init_module(void)
{
return comedi_driver_register(&driver_8255);
}

static void __exit driver_8255_cleanup_module(void)
{
comedi_driver_unregister(&driver_8255);
}

module_init(driver_8255_init_module);
module_exit(driver_8255_cleanup_module);

static void do_config(struct comedi_device *dev, struct comedi_subdevice *s);

void subdev_8255_interrupt(struct comedi_device *dev,
struct comedi_subdevice *s)
{
Expand Down Expand Up @@ -185,6 +160,23 @@ static int subdev_8255_insn(struct comedi_device *dev,
return 2;
}

static void do_config(struct comedi_device *dev, struct comedi_subdevice *s)
{
int config;

config = CR_CW;
/* 1 in io_bits indicates output, 1 in config indicates input */
if (!(s->io_bits & 0x0000ff))
config |= CR_A_IO;
if (!(s->io_bits & 0x00ff00))
config |= CR_B_IO;
if (!(s->io_bits & 0x0f0000))
config |= CR_C_LO_IO;
if (!(s->io_bits & 0xf00000))
config |= CR_C_HI_IO;
CALLBACK_FUNC(1, _8255_CR, config, CALLBACK_ARG);
}

static int subdev_8255_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
Expand Down Expand Up @@ -222,23 +214,6 @@ static int subdev_8255_insn_config(struct comedi_device *dev,
return 1;
}

static void do_config(struct comedi_device *dev, struct comedi_subdevice *s)
{
int config;

config = CR_CW;
/* 1 in io_bits indicates output, 1 in config indicates input */
if (!(s->io_bits & 0x0000ff))
config |= CR_A_IO;
if (!(s->io_bits & 0x00ff00))
config |= CR_B_IO;
if (!(s->io_bits & 0x0f0000))
config |= CR_C_LO_IO;
if (!(s->io_bits & 0xf00000))
config |= CR_C_HI_IO;
CALLBACK_FUNC(1, _8255_CR, config, CALLBACK_ARG);
}

static int subdev_8255_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
Expand Down Expand Up @@ -462,6 +437,25 @@ static int dev_8255_detach(struct comedi_device *dev)
return 0;
}

static struct comedi_driver driver_8255 = {
.driver_name = "8255",
.module = THIS_MODULE,
.attach = dev_8255_attach,
.detach = dev_8255_detach,
};

static int __init driver_8255_init_module(void)
{
return comedi_driver_register(&driver_8255);
}
module_init(driver_8255_init_module);

static void __exit driver_8255_cleanup_module(void)
{
comedi_driver_unregister(&driver_8255);
}
module_exit(driver_8255_cleanup_module);

MODULE_AUTHOR("Comedi http://www.comedi.org");
MODULE_DESCRIPTION("Comedi low-level driver");
MODULE_LICENSE("GPL");

0 comments on commit f36f45a

Please sign in to comment.