Commit e053b241 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: addi_apci_3xxx: introduce a private boardinfo definition

The struct addi_board definition from the addi-data "common" code is
very bloated. Introduce a private struct apci3xxx_boardinfo that just
has the data needed by this driver.

Move the #include "addi-data/hwdrv_apci3xxx.c" so it will have the new
struct definition.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b9671585
......@@ -114,7 +114,7 @@ static int i_APCI3XXX_AnalogInputConfigOperatingMode(struct comedi_device *dev,
struct comedi_insn *insn,
unsigned int *data)
{
const struct addi_board *this_board = comedi_board(dev);
const struct apci3xxx_boardinfo *this_board = comedi_board(dev);
struct addi_private *devpriv = dev->private;
int i_ReturnValue = insn->n;
unsigned char b_TimeBase = 0;
......@@ -365,7 +365,7 @@ static int i_APCI3XXX_InsnReadAnalogInput(struct comedi_device *dev,
struct comedi_insn *insn,
unsigned int *data)
{
const struct addi_board *this_board = comedi_board(dev);
const struct apci3xxx_boardinfo *this_board = comedi_board(dev);
struct addi_private *devpriv = dev->private;
int i_ReturnValue = insn->n;
unsigned char b_Configuration = (unsigned char) CR_RANGE(insn->chanspec);
......@@ -595,7 +595,7 @@ static int i_APCI3XXX_InsnWriteAnalogOutput(struct comedi_device *dev,
struct comedi_insn *insn,
unsigned int *data)
{
const struct addi_board *board = comedi_board(dev);
const struct apci3xxx_boardinfo *board = comedi_board(dev);
struct addi_private *devpriv = dev->private;
unsigned char b_Range = (unsigned char) CR_RANGE(insn->chanspec);
unsigned char b_Channel = (unsigned char) CR_CHAN(insn->chanspec);
......
......@@ -6,8 +6,6 @@
#include "addi-data/addi_common.h"
#include "addi-data/hwdrv_apci3xxx.c"
#ifndef COMEDI_SUBD_TTLIO
#define COMEDI_SUBD_TTLIO 11 /* Digital Input Output But TTL */
#endif
......@@ -60,7 +58,23 @@ enum apci3xxx_boardid {
BOARD_APCI3500,
};
static const struct addi_board apci3xxx_boardtypes[] = {
struct apci3xxx_boardinfo {
const char *pc_DriverName;
int i_IorangeBase1;
int i_NbrAiChannel;
int i_NbrAiChannelDiff;
int i_AiChannelList;
int i_NbrAoChannel;
int i_AiMaxdata;
int i_AoMaxdata;
int i_NbrDiChannel;
int i_NbrDoChannel;
int i_NbrTTLChannel;
unsigned char b_AvailableConvertUnit;
unsigned int ui_MinAcquisitiontimeNs;
};
static const struct apci3xxx_boardinfo apci3xxx_boardtypes[] = {
[BOARD_APCI3000_16] = {
.pc_DriverName = "apci3000-16",
.i_IorangeBase1 = 256,
......@@ -370,6 +384,8 @@ static const struct addi_board apci3xxx_boardtypes[] = {
},
};
#include "addi-data/hwdrv_apci3xxx.c"
static irqreturn_t apci3xxx_irq_handler(int irq, void *d)
{
struct comedi_device *dev = d;
......@@ -473,7 +489,7 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
unsigned long context)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
const struct addi_board *board = NULL;
const struct apci3xxx_boardinfo *board = NULL;
struct addi_private *devpriv;
struct comedi_subdevice *s;
int ret, n_subdevices;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment