Merge remote-tracking branch 'asoc/fix/max98357a' into asoc-linus
[linux-2.6-block.git] / drivers / staging / comedi / drivers / amplc_dio200.c
index 17d2e20663cbd42801d4a1f197432000edafa5b0..4fe118380218b479b1642a2fadb703c36db0f68a 100644 (file)
  */
 static const struct dio200_board dio200_isa_boards[] = {
        {
-               .name = "pc212e",
-               .bustype = isa_bustype,
-               .mainsize = DIO200_IO_SIZE,
-               .layout = {
-                       .n_subdevs = 6,
-                       .sdtype = {sd_8255, sd_8254, sd_8254, sd_8254, sd_8254,
-                                  sd_intr},
-                       .sdinfo = {0x00, 0x08, 0x0C, 0x10, 0x14, 0x3F},
-                       .has_int_sce = true,
-                       .has_clk_gat_sce = true,
+               .name           = "pc212e",
+               .n_subdevs      = 6,
+               .sdtype         = {
+                       sd_8255, sd_8254, sd_8254, sd_8254, sd_8254, sd_intr
                },
-       },
-       {
-               .name = "pc214e",
-               .bustype = isa_bustype,
-               .mainsize = DIO200_IO_SIZE,
-               .layout = {
-                       .n_subdevs = 4,
-                       .sdtype = {sd_8255, sd_8255, sd_8254, sd_intr},
-                       .sdinfo = {0x00, 0x08, 0x10, 0x01},
+               .sdinfo         = { 0x00, 0x08, 0x0c, 0x10, 0x14, 0x3f },
+               .has_int_sce    = true,
+               .has_clk_gat_sce = true,
+       }, {
+               .name           = "pc214e",
+               .n_subdevs      = 4,
+               .sdtype         = {
+                       sd_8255, sd_8255, sd_8254, sd_intr
                },
-       },
-       {
-               .name = "pc215e",
-               .bustype = isa_bustype,
-               .mainsize = DIO200_IO_SIZE,
-               .layout = {
-                       .n_subdevs = 5,
-                       .sdtype = {sd_8255, sd_8255, sd_8254, sd_8254, sd_intr},
-                       .sdinfo = {0x00, 0x08, 0x10, 0x14, 0x3F},
-                       .has_int_sce = true,
-                       .has_clk_gat_sce = true,
+               .sdinfo         = { 0x00, 0x08, 0x10, 0x01 },
+       }, {
+               .name           = "pc215e",
+               .n_subdevs      = 5,
+               .sdtype         = {
+                       sd_8255, sd_8255, sd_8254, sd_8254, sd_intr
                },
-       },
-       {
-               .name = "pc218e",
-               .bustype = isa_bustype,
-               .mainsize = DIO200_IO_SIZE,
-               .layout = {
-                       .n_subdevs = 7,
-                       .sdtype = {sd_8254, sd_8254, sd_8255, sd_8254, sd_8254,
-                                  sd_intr},
-                       .sdinfo = {0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x3F},
-                       .has_int_sce = true,
-                       .has_clk_gat_sce = true,
+               .sdinfo         = { 0x00, 0x08, 0x10, 0x14, 0x3f },
+               .has_int_sce    = true,
+               .has_clk_gat_sce = true,
+       }, {
+               .name           = "pc218e",
+               .n_subdevs      = 7,
+               .sdtype         = {
+                       sd_8254, sd_8254, sd_8255, sd_8254, sd_8254, sd_intr
                },
-       },
-       {
-               .name = "pc272e",
-               .bustype = isa_bustype,
-               .mainsize = DIO200_IO_SIZE,
-               .layout = {
-                       .n_subdevs = 4,
-                       .sdtype = {sd_8255, sd_8255, sd_8255, sd_intr},
-                       .sdinfo = {0x00, 0x08, 0x10, 0x3F},
-                       .has_int_sce = true,
+               .sdinfo         = { 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14, 0x3f },
+               .has_int_sce    = true,
+               .has_clk_gat_sce = true,
+       }, {
+               .name           = "pc272e",
+               .n_subdevs      = 4,
+               .sdtype         = {
+                       sd_8255, sd_8255, sd_8255, sd_intr
                },
+               .sdinfo         = { 0x00, 0x08, 0x10, 0x3f },
+               .has_int_sce = true,
        },
 };
 
 static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
-       const struct dio200_board *thisboard = comedi_board(dev);
-       struct dio200_private *devpriv;
-       unsigned int irq;
        int ret;
 
-       irq = it->options[1];
-
-       devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
-       if (!devpriv)
-               return -ENOMEM;
-
-       ret = comedi_request_region(dev, it->options[0], thisboard->mainsize);
+       ret = comedi_request_region(dev, it->options[0], 0x20);
        if (ret)
                return ret;
 
-       return amplc_dio200_common_attach(dev, irq, 0);
-}
-
-static void dio200_detach(struct comedi_device *dev)
-{
-       amplc_dio200_common_detach(dev);
-       comedi_legacy_detach(dev);
+       return amplc_dio200_common_attach(dev, it->options[1], 0);
 }
 
 static struct comedi_driver amplc_dio200_driver = {
-       .driver_name = "amplc_dio200",
-       .module = THIS_MODULE,
-       .attach = dio200_attach,
-       .detach = dio200_detach,
-       .board_name = &dio200_isa_boards[0].name,
-       .offset = sizeof(struct dio200_board),
-       .num_names = ARRAY_SIZE(dio200_isa_boards),
+       .driver_name    = "amplc_dio200",
+       .module         = THIS_MODULE,
+       .attach         = dio200_attach,
+       .detach         = comedi_legacy_detach,
+       .board_name     = &dio200_isa_boards[0].name,
+       .offset         = sizeof(struct dio200_board),
+       .num_names      = ARRAY_SIZE(dio200_isa_boards),
 };
 module_comedi_driver(amplc_dio200_driver);