2015-06-05 17:30:51

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 00/32] staging: comedi: das08: tidy up

Clean up the Comedi "das08" module a bit, mostly for consistent naming
of things.

01) staging: comedi: das08.h: reformat copyright comment
02) staging: comedi: das08.h: change description in copyright header
comment
03) staging: comedi: das08.h: reformat remaining comments
04) staging: comedi: das08: use indexed initializer for AI range table
types
05) staging: comedi: das08: improve test for programmable gain
06) staging: comedi: das08.h: make self-reliant
07) staging: comedi: das08: rename DAS08_LSB and DAS08_MSB
08) staging: comedi: das08: rename DAS08_TRIG_12BIT
09) staging: comedi: das08: rename DAS08_STATUS
10) staging: comedi: das08: rename and rewrite DAS08_EOC
11) staging: comedi: das08: rename and rewrite DAS08_IRQ
12) staging: comedi: das08: rename and rewrite DAS08_IP
13) staging: comedi: das08: rename DAS08_CONTROL
14) staging: comedi: das08: rename DAS08_MUX() and DAS08_MUX_MASK
15) staging: comedi: das08: rename and rewrite DAS08_INTE
16) staging: comedi: das08: rename DAS08_OP() and DAS08_DO_MASK
17) staging: comedi: das08: rename and split DAS08JR_DIO
18) staging: comedi: das08: rename DAS08JR_AO_LSB() and DAS08JR_AO_MSB()
19) staging: comedi: das08: add DAS08JR_AO_UPDATE_REG
20) staging: comedi: das08: replace DAS08AO_GAIN_CONTROL/STATUS
21) staging: comedi: das08: rename DAS08AO_AO_LSB() and DAS08AO_AO_MSB()
22) staging: comedi: das08: rename DAS08AO_AO_UPDATE
23) staging: comedi: das08: remove board register map comments
24) staging: comedi: das08.c: reformat copyright comment
25) staging: comedi: das08.c: reformat remaining comments
26) staging: comedi: das08: rename ai range tables
27) staging: comedi: das08: rename the gainlist variables
28) staging: comedi: das08: rename das08_ai_rinsn()
29) staging: comedi: das08: rename das08_di_rbits() & das08jr_di_rbits()
30) staging: comedi: das08: rename das08_do_wbits() & das08jr_do_wbits()
31) staging: comedi: das08: clarify sign-magnitude conversion
32) staging: comedi: das08: use better MODULE_DESCRIPTION()

drivers/staging/comedi/drivers/das08.c | 333 ++++++++++++++++-----------------
drivers/staging/comedi/drivers/das08.h | 48 ++---
2 files changed, 188 insertions(+), 193 deletions(-)


2015-06-05 17:39:31

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 01/32] staging: comedi: das08.h: reformat copyright comment

Reformat the copyright comment at the top of the file to use the
preferred block comment style.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.h | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.h b/drivers/staging/comedi/drivers/das08.h
index f86167da..57c7640 100644
--- a/drivers/staging/comedi/drivers/das08.h
+++ b/drivers/staging/comedi/drivers/das08.h
@@ -1,20 +1,20 @@
/*
- das08.h
-
- Header for das08.c and das08_cs.c
-
- Copyright (C) 2003 Frank Mori Hess <[email protected]>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-*/
+ * das08.h
+ *
+ * Header for das08.c and das08_cs.c
+ *
+ * Copyright (C) 2003 Frank Mori Hess <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */

#ifndef _DAS08_H
#define _DAS08_H
--
2.1.4

2015-06-05 17:30:54

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 02/32] staging: comedi: das08.h: change description in copyright header comment

The copyright header comment includes a single-line description saying
it is for "das08.c" and "das08_cs.c". However, it is also used by
"das08_isa.c" and "das08_pci.c". Update the description to say it is
for common DAS08 support, similar to description in "das08.c" (the
common module for the DAS08 ISA/PCI/PCMCIA drivers).

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/das08.h b/drivers/staging/comedi/drivers/das08.h
index 57c7640..388855e 100644
--- a/drivers/staging/comedi/drivers/das08.h
+++ b/drivers/staging/comedi/drivers/das08.h
@@ -1,7 +1,7 @@
/*
* das08.h
*
- * Header for das08.c and das08_cs.c
+ * Header for common DAS08 support (used by ISA/PCI/PCMCIA drivers)
*
* Copyright (C) 2003 Frank Mori Hess <[email protected]>
*
--
2.1.4

2015-06-05 17:30:58

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 03/32] staging: comedi: das08.h: reformat remaining comments

Reformat remaining comments to use the preferred style for single-line
and block comments.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.h | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.h b/drivers/staging/comedi/drivers/das08.h
index 388855e..b904b5e 100644
--- a/drivers/staging/comedi/drivers/das08.h
+++ b/drivers/staging/comedi/drivers/das08.h
@@ -36,13 +36,12 @@ struct das08_board_struct {
unsigned int do_nchan;
unsigned int i8255_offset;
unsigned int i8254_offset;
- unsigned int iosize; /* number of ioports used */
+ unsigned int iosize; /* number of ioports used */
};

struct das08_private_struct {
- unsigned int do_mux_bits; /* bits for do/mux register on boards
- * without separate do register
- */
+ /* bits for do/mux register on boards without separate do register */
+ unsigned int do_mux_bits;
const unsigned int *pg_gainlist;
};

--
2.1.4

2015-06-05 17:39:04

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 04/32] staging: comedi: das08: use indexed initializer for AI range table types

The "das08" common module for DAS08 ISA, PCI, and PCMCIA drivers
includes a predefined set of AI range tables. The static board data (of
type `struct das08_board_struct`) for a particular board contains an
index in its `ai_pg` member (of type `enum das08_lrange`) indicating
which of the predefined AI range tables to use. The "das08" common
module looks up this index in `das08_ai_lranges[]` to get a pointer to
the predefined range table for the board. The same index is also looked
up in `das08_gainlists[]` to get a corresponding pointer to a list of
hardware gain values for each range supported by the board (NULL for
boards without programmable gain).

To make this clearer, used indexed initializers for `das08_ai_lranges[]`
and `das08_gainlists[]`, using the enumerated constants from `enum
das08_lrange` as the indices. Also add a short comment to the
definition of `enum das08_lrange`.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 20 ++++++++++----------
drivers/staging/comedi/drivers/das08.h | 5 +++--
2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 73f4c8d..b1cd6ea 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -165,11 +165,11 @@ static const struct comedi_lrange range_das08_pgm = {
*/

static const struct comedi_lrange *const das08_ai_lranges[] = {
- &range_unknown,
- &range_bipolar5,
- &range_das08_pgh,
- &range_das08_pgl,
- &range_das08_pgm,
+ [das08_pg_none] = &range_unknown,
+ [das08_bipolar5] = &range_bipolar5,
+ [das08_pgh] = &range_das08_pgh,
+ [das08_pgl] = &range_das08_pgl,
+ [das08_pgm] = &range_das08_pgm,
};

static const int das08_pgh_gainlist[] = {
@@ -179,11 +179,11 @@ static const int das08_pgl_gainlist[] = { 8, 0, 2, 4, 6, 1, 3, 5, 7 };
static const int das08_pgm_gainlist[] = { 8, 0, 10, 12, 14, 9, 11, 13, 15 };

static const int *const das08_gainlists[] = {
- NULL,
- NULL,
- das08_pgh_gainlist,
- das08_pgl_gainlist,
- das08_pgm_gainlist,
+ [das08_pg_none] = NULL,
+ [das08_bipolar5] = NULL,
+ [das08_pgh] = das08_pgh_gainlist,
+ [das08_pgl] = das08_pgl_gainlist,
+ [das08_pgm] = das08_pgm_gainlist,
};

static int das08_ai_eoc(struct comedi_device *dev,
diff --git a/drivers/staging/comedi/drivers/das08.h b/drivers/staging/comedi/drivers/das08.h
index b904b5e..8b1c1a9 100644
--- a/drivers/staging/comedi/drivers/das08.h
+++ b/drivers/staging/comedi/drivers/das08.h
@@ -21,8 +21,9 @@

/* different ways ai data is encoded in first two registers */
enum das08_ai_encoding { das08_encode12, das08_encode16, das08_pcm_encode12 };
-enum das08_lrange { das08_pg_none, das08_bipolar5, das08_pgh, das08_pgl,
- das08_pgm
+/* types of ai range table used by different boards */
+enum das08_lrange {
+ das08_pg_none, das08_bipolar5, das08_pgh, das08_pgl, das08_pgm
};

struct das08_board_struct {
--
2.1.4

2015-06-05 17:38:42

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 05/32] staging: comedi: das08: improve test for programmable gain

`das08_ai_rinsn()` handles Comedi `INSN_READ` instructions for the AI
subdevice. This programs the gain for the analog input channel if the
board has support for that, and acquires data from the channel. If
programmable gain is supported, the gain code is read from the array
pointed to by `devpriv->pg_gainlist` indexed by the range index. The
function assumes that programmable gain is supported if the AI
subdevice's range table supports more than one range. Replace that with
a more direct test for `devpriv->pg_gainlist` being non-NULL, as it is
only initialized to a non-NULL pointer for boards that support
programmable gain.

This will also allow range tables to be included for convenience for
those boards that support multiple ranges by DIP switches. Those boards
are currently initialized to use a single "unknown" range.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index b1cd6ea..2521352 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -225,7 +225,7 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
outb(devpriv->do_mux_bits, dev->iobase + DAS08_CONTROL);
spin_unlock(&dev->spinlock);

- if (s->range_table->length > 1) {
+ if (devpriv->pg_gainlist) {
/* set gain/range */
range = CR_RANGE(insn->chanspec);
outb(devpriv->pg_gainlist[range],
--
2.1.4

2015-06-05 17:31:01

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 06/32] staging: comedi: das08.h: make self-reliant

The Comedi "das08.h" header file is included by drivers for the
ComputerBoards/MeasurementComputing and Keithley Metrabyte boards in the
DAS08 series. It does not compile cleanly when it is the first header
included by the ".c" file. It uses `struct comedi_device *` in the
parameter list of a function prototype, so just declare `struct
comedi_device` as an incomplete type. It also uses `bool`, so include
<linux/types.h> to declare it.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.h | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/staging/comedi/drivers/das08.h b/drivers/staging/comedi/drivers/das08.h
index 8b1c1a9..d27044c 100644
--- a/drivers/staging/comedi/drivers/das08.h
+++ b/drivers/staging/comedi/drivers/das08.h
@@ -19,6 +19,10 @@
#ifndef _DAS08_H
#define _DAS08_H

+#include <linux/types.h>
+
+struct comedi_device;
+
/* different ways ai data is encoded in first two registers */
enum das08_ai_encoding { das08_encode12, das08_encode16, das08_pcm_encode12 };
/* types of ai range table used by different boards */
--
2.1.4

2015-06-05 17:38:31

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 07/32] staging: comedi: das08: rename DAS08_LSB and DAS08_MSB

The `DAS08_LSB` and `DAS08_MSB` macros contain the offsets to the
least-significant and most-significant analog input data registers.
Rename them to `DAS08_AI_LSB_REG` and `DAS08_AI_MSB_REG` respectively
and add comments to document them.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 2521352..1d9e6a6 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -42,8 +42,20 @@

*/

-#define DAS08_LSB 0
-#define DAS08_MSB 1
+/*
+ * Data format of DAS08_AI_LSB_REG and DAS08_AI_MSB_REG depends on
+ * 'ai_encoding' member of board structure:
+ *
+ * das08_encode12 : DATA[11..4] = MSB[7..0], DATA[3..0] = LSB[7..4].
+ * das08_pcm_encode12 : DATA[11..8] = MSB[3..0], DATA[7..9] = LSB[7..0].
+ * das08_encode16 : SIGN = MSB[7], MAGNITUDE[14..8] = MSB[6..0],
+ * MAGNITUDE[7..0] = LSB[7..0].
+ * SIGN==0 for negative input, SIGN==1 for positive input.
+ * Note: when read a second time after conversion
+ * complete, MSB[7] is an "over-range" bit.
+ */
+#define DAS08_AI_LSB_REG 0x00 /* (R) AI least significant bits */
+#define DAS08_AI_MSB_REG 0x01 /* (R) AI most significant bits */
#define DAS08_TRIG_12BIT 1
#define DAS08_STATUS 2
#define DAS08_EOC (1<<7)
@@ -214,8 +226,8 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
range = CR_RANGE(insn->chanspec);

/* clear crap */
- inb(dev->iobase + DAS08_LSB);
- inb(dev->iobase + DAS08_MSB);
+ inb(dev->iobase + DAS08_AI_LSB_REG);
+ inb(dev->iobase + DAS08_AI_MSB_REG);

/* set multiplexer */
/* lock to prevent race with digital output */
@@ -235,7 +247,7 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
for (n = 0; n < insn->n; n++) {
/* clear over-range bits for 16-bit boards */
if (thisboard->ai_nbits == 16)
- if (inb(dev->iobase + DAS08_MSB) & 0x80)
+ if (inb(dev->iobase + DAS08_AI_MSB_REG) & 0x80)
dev_info(dev->class_dev, "over-range\n");

/* trigger conversion */
@@ -245,8 +257,8 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
if (ret)
return ret;

- msb = inb(dev->iobase + DAS08_MSB);
- lsb = inb(dev->iobase + DAS08_LSB);
+ msb = inb(dev->iobase + DAS08_AI_MSB_REG);
+ lsb = inb(dev->iobase + DAS08_AI_LSB_REG);
if (thisboard->ai_encoding == das08_encode12) {
data[n] = (lsb >> 4) | (msb << 4);
} else if (thisboard->ai_encoding == das08_pcm_encode12) {
--
2.1.4

2015-06-05 17:38:09

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 08/32] staging: comedi: das08: rename DAS08_TRIG_12BIT

The `DAS08_TRIG_12BIT` macro contains the offset to the write-only
software trigger register for 12-bit or 16-bit analog-to-digital
conversions. Rename the macro to `DAS08_AI_TRIG_REG` and add a comment.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 1d9e6a6..fa14fa10 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -56,7 +56,7 @@
*/
#define DAS08_AI_LSB_REG 0x00 /* (R) AI least significant bits */
#define DAS08_AI_MSB_REG 0x01 /* (R) AI most significant bits */
-#define DAS08_TRIG_12BIT 1
+#define DAS08_AI_TRIG_REG 0x01 /* (W) AI software trigger */
#define DAS08_STATUS 2
#define DAS08_EOC (1<<7)
#define DAS08_IRQ (1<<3)
@@ -251,7 +251,7 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
dev_info(dev->class_dev, "over-range\n");

/* trigger conversion */
- outb_p(0, dev->iobase + DAS08_TRIG_12BIT);
+ outb_p(0, dev->iobase + DAS08_AI_TRIG_REG);

ret = comedi_timeout(dev, s, insn, das08_ai_eoc, 0);
if (ret)
--
2.1.4

2015-06-05 17:37:34

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 09/32] staging: comedi: das08: rename DAS08_STATUS

The `DAS08_STATUS` macro contains the offset to the read-only status
register. Rename it to `DAS08_STATUS_REG` and add a comment.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index fa14fa10..eecbf4d 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -57,7 +57,7 @@
#define DAS08_AI_LSB_REG 0x00 /* (R) AI least significant bits */
#define DAS08_AI_MSB_REG 0x01 /* (R) AI most significant bits */
#define DAS08_AI_TRIG_REG 0x01 /* (W) AI software trigger */
-#define DAS08_STATUS 2
+#define DAS08_STATUS_REG 0x02 /* (R) status */
#define DAS08_EOC (1<<7)
#define DAS08_IRQ (1<<3)
#define DAS08_IP(x) (((x)>>4)&0x7)
@@ -205,7 +205,7 @@ static int das08_ai_eoc(struct comedi_device *dev,
{
unsigned int status;

- status = inb(dev->iobase + DAS08_STATUS);
+ status = inb(dev->iobase + DAS08_STATUS_REG);
if ((status & DAS08_EOC) == 0)
return 0;
return -EBUSY;
@@ -282,7 +282,7 @@ static int das08_di_rbits(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
data[0] = 0;
- data[1] = DAS08_IP(inb(dev->iobase + DAS08_STATUS));
+ data[1] = DAS08_IP(inb(dev->iobase + DAS08_STATUS_REG));

return insn->n;
}
--
2.1.4

2015-06-05 17:37:30

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 10/32] staging: comedi: das08: rename and rewrite DAS08_EOC

The `DAS08_EOC` macro contains a mask for the "end of A/D conversion"
bit in the status register. The logic is reverse sense in that the bit
is set to 1 while the conversion is in progress and set to 0 when the
conversion is complete. Rename the macro to `DAS08_STATUS_AI_BUSY` and
add a comment. Also make use of the `BIT()` macro to define the value.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index eecbf4d..0484308 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -58,7 +58,7 @@
#define DAS08_AI_MSB_REG 0x01 /* (R) AI most significant bits */
#define DAS08_AI_TRIG_REG 0x01 /* (W) AI software trigger */
#define DAS08_STATUS_REG 0x02 /* (R) status */
-#define DAS08_EOC (1<<7)
+#define DAS08_STATUS_AI_BUSY BIT(7) /* AI conversion in progress */
#define DAS08_IRQ (1<<3)
#define DAS08_IP(x) (((x)>>4)&0x7)
#define DAS08_CONTROL 2
@@ -206,7 +206,7 @@ static int das08_ai_eoc(struct comedi_device *dev,
unsigned int status;

status = inb(dev->iobase + DAS08_STATUS_REG);
- if ((status & DAS08_EOC) == 0)
+ if ((status & DAS08_STATUS_AI_BUSY) == 0)
return 0;
return -EBUSY;
}
--
2.1.4

2015-06-05 17:37:06

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 11/32] staging: comedi: das08: rename and rewrite DAS08_IRQ

The `DAS08_IRQ` macro contains a mask for the "IRQ" status bit. This is
set to 1 when a rising edge is detected on the external interrupt input
pin of the external connector (which may be jumpered to a pacer output).
It is cleared by setting the "INTE" control bit to 0. It is not used on
"JR" boards. Rename the macro to `DAS08_STATUS_IRQ` and add a comment.
Also use the `BIT()` macro to define the value.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 0484308..935bbfb 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -59,7 +59,12 @@
#define DAS08_AI_TRIG_REG 0x01 /* (W) AI software trigger */
#define DAS08_STATUS_REG 0x02 /* (R) status */
#define DAS08_STATUS_AI_BUSY BIT(7) /* AI conversion in progress */
-#define DAS08_IRQ (1<<3)
+/*
+ * The IRQ status bit is set to 1 by a rising edge on the external interrupt
+ * input (which may be jumpered to the pacer output). It is cleared by
+ * setting the INTE control bit to 0. Not present on "JR" boards.
+ */
+#define DAS08_STATUS_IRQ BIT(3) /* latched interrupt input */
#define DAS08_IP(x) (((x)>>4)&0x7)
#define DAS08_CONTROL 2
#define DAS08_MUX_MASK 0x7
--
2.1.4

2015-06-05 17:31:08

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 12/32] staging: comedi: das08: rename and rewrite DAS08_IP

The `DAS08_IP()` macro takes a value read from the status register and
returns the state of the three digital input channels (except on "JR"
boards). Rename it to `DAS08_STATUS_DI()` and add a comment. Also
re-arrange the expression used to extract the state of the digital
inputs for consistency with other register macros.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 935bbfb..eef0456 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -65,7 +65,8 @@
* setting the INTE control bit to 0. Not present on "JR" boards.
*/
#define DAS08_STATUS_IRQ BIT(3) /* latched interrupt input */
-#define DAS08_IP(x) (((x)>>4)&0x7)
+/* digital inputs (not "JR" boards) */
+#define DAS08_STATUS_DI(x) (((x) & 0x70) >> 4)
#define DAS08_CONTROL 2
#define DAS08_MUX_MASK 0x7
#define DAS08_MUX(x) ((x) & DAS08_MUX_MASK)
@@ -287,7 +288,7 @@ static int das08_di_rbits(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
data[0] = 0;
- data[1] = DAS08_IP(inb(dev->iobase + DAS08_STATUS_REG));
+ data[1] = DAS08_STATUS_DI(inb(dev->iobase + DAS08_STATUS_REG));

return insn->n;
}
--
2.1.4

2015-06-05 17:36:24

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 13/32] staging: comedi: das08: rename DAS08_CONTROL

The `DAS08_CONTROL` macro contains the offset to the write-only control
register. Rename it to `DAS08_CONTROL_REG` and add a comment.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index eef0456..b43bc2d 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -67,7 +67,7 @@
#define DAS08_STATUS_IRQ BIT(3) /* latched interrupt input */
/* digital inputs (not "JR" boards) */
#define DAS08_STATUS_DI(x) (((x) & 0x70) >> 4)
-#define DAS08_CONTROL 2
+#define DAS08_CONTROL_REG 0x02 /* (W) control */
#define DAS08_MUX_MASK 0x7
#define DAS08_MUX(x) ((x) & DAS08_MUX_MASK)
#define DAS08_INTE (1<<3)
@@ -240,7 +240,7 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
spin_lock(&dev->spinlock);
devpriv->do_mux_bits &= ~DAS08_MUX_MASK;
devpriv->do_mux_bits |= DAS08_MUX(chan);
- outb(devpriv->do_mux_bits, dev->iobase + DAS08_CONTROL);
+ outb(devpriv->do_mux_bits, dev->iobase + DAS08_CONTROL_REG);
spin_unlock(&dev->spinlock);

if (devpriv->pg_gainlist) {
@@ -305,7 +305,7 @@ static int das08_do_wbits(struct comedi_device *dev,
spin_lock(&dev->spinlock);
devpriv->do_mux_bits &= ~DAS08_DO_MASK;
devpriv->do_mux_bits |= DAS08_OP(s->state);
- outb(devpriv->do_mux_bits, dev->iobase + DAS08_CONTROL);
+ outb(devpriv->do_mux_bits, dev->iobase + DAS08_CONTROL_REG);
spin_unlock(&dev->spinlock);
}

--
2.1.4

2015-06-05 17:36:21

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 14/32] staging: comedi: das08: rename DAS08_MUX() and DAS08_MUX_MASK

The `DAS08_MUX_MASK` macro is a bitmask for the control register
corresponding to the analog input multiplexor channel selection bits.
Rename it to `DAS08_CONTROL_MUX_MASK` and add a comment. Note that the
current setting of the multiplexor can also be read from the same bit
positions in the status register, but the driver does not use it. Add a
comment to that effect.

The `DAS08_MUX(x)` macro takes an analog input channel number and
returns the corresponding analog input multiplexor channel selection
bits for the control register. Rename it to `DAS08_CONTROL_MUX(x)` and
add a comment.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index b43bc2d..f0ee617 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -68,8 +68,12 @@
/* digital inputs (not "JR" boards) */
#define DAS08_STATUS_DI(x) (((x) & 0x70) >> 4)
#define DAS08_CONTROL_REG 0x02 /* (W) control */
-#define DAS08_MUX_MASK 0x7
-#define DAS08_MUX(x) ((x) & DAS08_MUX_MASK)
+/*
+ * Note: The AI multiplexor channel can also be read from status register using
+ * the same mask.
+ */
+#define DAS08_CONTROL_MUX_MASK 0x7 /* multiplexor channel mask */
+#define DAS08_CONTROL_MUX(x) ((x) & DAS08_CONTROL_MUX_MASK) /* mux channel */
#define DAS08_INTE (1<<3)
#define DAS08_DO_MASK 0xf0
#define DAS08_OP(x) (((x) << 4) & DAS08_DO_MASK)
@@ -238,8 +242,8 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
/* set multiplexer */
/* lock to prevent race with digital output */
spin_lock(&dev->spinlock);
- devpriv->do_mux_bits &= ~DAS08_MUX_MASK;
- devpriv->do_mux_bits |= DAS08_MUX(chan);
+ devpriv->do_mux_bits &= ~DAS08_CONTROL_MUX_MASK;
+ devpriv->do_mux_bits |= DAS08_CONTROL_MUX(chan);
outb(devpriv->do_mux_bits, dev->iobase + DAS08_CONTROL_REG);
spin_unlock(&dev->spinlock);

--
2.1.4

2015-06-05 17:31:12

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 15/32] staging: comedi: das08: rename and rewrite DAS08_INTE

The `DAS08_INTE` macro contains a mask for the "INTE" bit in the control
register (except on "JR" boards). Setting it to 1 enables interrupts.
Setting it to 0 disables interrupts and clears the "IRQ" bit in the
status register. Rename the macro to `DAS08_CONTROL_INTE` and add a
comment. Also use the `BIT()` macro to define its value. (Note: the
driver does not currently enable interrupts.)

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index f0ee617..9898ac0 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -74,7 +74,7 @@
*/
#define DAS08_CONTROL_MUX_MASK 0x7 /* multiplexor channel mask */
#define DAS08_CONTROL_MUX(x) ((x) & DAS08_CONTROL_MUX_MASK) /* mux channel */
-#define DAS08_INTE (1<<3)
+#define DAS08_CONTROL_INTE BIT(3) /* interrupt enable (not "JR" boards) */
#define DAS08_DO_MASK 0xf0
#define DAS08_OP(x) (((x) << 4) & DAS08_DO_MASK)

--
2.1.4

2015-06-05 17:36:19

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 16/32] staging: comedi: das08: rename DAS08_OP() and DAS08_DO_MASK

The `DAS08_DO_MASK` macro is a bitmask for the control register
corresponding to the digital output channels (except on "JR" boards).
Rename it to `DAS08_CONTROL_DO_MASK` and add a comment.

The `DAS08_OP(x)` macro takes a bitvector of the desired digital output
channel states and returns the corresponding bits for the control
register (except on "JR" boards). Rename it to `DAS08_CONTROL_DO(x)`
and add a comment.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 9898ac0..76e35d4 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -75,8 +75,9 @@
#define DAS08_CONTROL_MUX_MASK 0x7 /* multiplexor channel mask */
#define DAS08_CONTROL_MUX(x) ((x) & DAS08_CONTROL_MUX_MASK) /* mux channel */
#define DAS08_CONTROL_INTE BIT(3) /* interrupt enable (not "JR" boards) */
-#define DAS08_DO_MASK 0xf0
-#define DAS08_OP(x) (((x) << 4) & DAS08_DO_MASK)
+#define DAS08_CONTROL_DO_MASK 0xf0 /* digital outputs mask (not "JR") */
+/* digital outputs (not "JR" boards) */
+#define DAS08_CONTROL_DO(x) (((x) << 4) & DAS08_CONTROL_DO_MASK)

/*
cio-das08jr.pdf
@@ -307,8 +308,8 @@ static int das08_do_wbits(struct comedi_device *dev,
if (comedi_dio_update_state(s, data)) {
/* prevent race with setting of analog input mux */
spin_lock(&dev->spinlock);
- devpriv->do_mux_bits &= ~DAS08_DO_MASK;
- devpriv->do_mux_bits |= DAS08_OP(s->state);
+ devpriv->do_mux_bits &= ~DAS08_CONTROL_DO_MASK;
+ devpriv->do_mux_bits |= DAS08_CONTROL_DO(s->state);
outb(devpriv->do_mux_bits, dev->iobase + DAS08_CONTROL_REG);
spin_unlock(&dev->spinlock);
}
--
2.1.4

2015-06-05 17:36:00

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 17/32] staging: comedi: das08: rename and split DAS08JR_DIO

The `DAS08JR_DIO` macro contains the offset to the read-only digital
input register and write-only digital output register on the "JR"
boards. Replace the macro with two new macros (with the same numeric
value) named `DAS08JR_DI_REG` for the digital input register and
`DAS08JR_DO_REG` for the digital output register, and add some comments.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 76e35d4..c015bb6 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -95,7 +95,8 @@

*/

-#define DAS08JR_DIO 3
+#define DAS08JR_DI_REG 0x03 /* (R) digital inputs ("JR" boards) */
+#define DAS08JR_DO_REG 0x03 /* (W) digital outputs ("JR" boards) */
#define DAS08JR_AO_LSB(x) ((x) ? 6 : 4)
#define DAS08JR_AO_MSB(x) ((x) ? 7 : 5)

@@ -324,7 +325,7 @@ static int das08jr_di_rbits(struct comedi_device *dev,
struct comedi_insn *insn, unsigned int *data)
{
data[0] = 0;
- data[1] = inb(dev->iobase + DAS08JR_DIO);
+ data[1] = inb(dev->iobase + DAS08JR_DI_REG);

return insn->n;
}
@@ -335,7 +336,7 @@ static int das08jr_do_wbits(struct comedi_device *dev,
unsigned int *data)
{
if (comedi_dio_update_state(s, data))
- outb(s->state, dev->iobase + DAS08JR_DIO);
+ outb(s->state, dev->iobase + DAS08JR_DO_REG);

data[1] = s->state;

@@ -355,7 +356,7 @@ static void das08_ao_set_data(struct comedi_device *dev,
outb(lsb, dev->iobase + DAS08JR_AO_LSB(chan));
outb(msb, dev->iobase + DAS08JR_AO_MSB(chan));
/* load DACs */
- inb(dev->iobase + DAS08JR_DIO);
+ inb(dev->iobase + DAS08JR_DI_REG);
} else {
outb(lsb, dev->iobase + DAS08AO_AO_LSB(chan));
outb(msb, dev->iobase + DAS08AO_AO_MSB(chan));
--
2.1.4

2015-06-05 17:35:39

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 18/32] staging: comedi: das08: rename DAS08JR_AO_LSB() and DAS08JR_AO_MSB()

The `DAS08JR_AO_LSB(x)` macro returns the offset to the analog output
low byte register for channel x (0 or 1) for "JR" boards with analog
output support. The `DAS08JR_AO_MSB(x)` macro returns the offset to the
corresponding high byte register. Rename the macros to
`DAS08JR_AO_LSB_REG(x)` and `DAS08JR_AO_MSB_REG(x)` respectively, and
add some comments.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index c015bb6..51637b1 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -97,8 +97,10 @@

#define DAS08JR_DI_REG 0x03 /* (R) digital inputs ("JR" boards) */
#define DAS08JR_DO_REG 0x03 /* (W) digital outputs ("JR" boards) */
-#define DAS08JR_AO_LSB(x) ((x) ? 6 : 4)
-#define DAS08JR_AO_MSB(x) ((x) ? 7 : 5)
+/* (W) analog output l.s.b. registers for 2 channels ("JR" boards) */
+#define DAS08JR_AO_LSB_REG(x) ((x) ? 0x06 : 0x04)
+/* (W) analog output m.s.b. registers for 2 channels ("JR" boards) */
+#define DAS08JR_AO_MSB_REG(x) ((x) ? 0x07 : 0x05)

/*
cio-das08_aox.pdf
@@ -353,8 +355,8 @@ static void das08_ao_set_data(struct comedi_device *dev,
lsb = data & 0xff;
msb = (data >> 8) & 0xff;
if (thisboard->is_jr) {
- outb(lsb, dev->iobase + DAS08JR_AO_LSB(chan));
- outb(msb, dev->iobase + DAS08JR_AO_MSB(chan));
+ outb(lsb, dev->iobase + DAS08JR_AO_LSB_REG(chan));
+ outb(msb, dev->iobase + DAS08JR_AO_MSB_REG(chan));
/* load DACs */
inb(dev->iobase + DAS08JR_DI_REG);
} else {
--
2.1.4

2015-06-05 17:31:16

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 19/32] staging: comedi: das08: add DAS08JR_AO_UPDATE_REG

"JR" boards with analog output channels have a jumper that controls
whether analog output channels are updated simultaneously or
individually. When set to update individually, individual channels are
updated when the high byte register is written. When set to update
simultaneously, channels are not updated until the digital inputs
register is read. The driver doesn't know how the jumper is set and is
not interested in the simultaneous output feature, so it updates a
channel by writing the low byte, then the high byte, then reading the
digital inputs register. To make the code more explicit, add a macro
`DAS08JR_AO_UPDATE_REG` with the same value as the `DAS08JR_DI_REG`
macro (for digital inputs) and use it when reading the register to
update the analog outputs.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 51637b1..4e8756a 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -101,6 +101,11 @@
#define DAS08JR_AO_LSB_REG(x) ((x) ? 0x06 : 0x04)
/* (W) analog output m.s.b. registers for 2 channels ("JR" boards) */
#define DAS08JR_AO_MSB_REG(x) ((x) ? 0x07 : 0x05)
+/*
+ * (R) update analog outputs ("JR" boards set for simultaneous output)
+ * (same register as digital inputs)
+ */
+#define DAS08JR_AO_UPDATE_REG 0x03

/*
cio-das08_aox.pdf
@@ -358,7 +363,7 @@ static void das08_ao_set_data(struct comedi_device *dev,
outb(lsb, dev->iobase + DAS08JR_AO_LSB_REG(chan));
outb(msb, dev->iobase + DAS08JR_AO_MSB_REG(chan));
/* load DACs */
- inb(dev->iobase + DAS08JR_DI_REG);
+ inb(dev->iobase + DAS08JR_AO_UPDATE_REG);
} else {
outb(lsb, dev->iobase + DAS08AO_AO_LSB(chan));
outb(msb, dev->iobase + DAS08AO_AO_MSB(chan));
--
2.1.4

2015-06-05 17:35:17

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 20/32] staging: comedi: das08: replace DAS08AO_GAIN_CONTROL/STATUS

The `DAS08AO_GAIN_CONTROL` and `DAS08AO_GAIN_STATUS` macros hold the
offset to the "programmable gain" register on "PGL", "PGM", "PGH",
"AOL", "AOM" and "AOH" boards. Writing a code to this register sets the
gain for the current analog input channel (selected in the main control
register). The written value can be read back in bits 3..0 of the
register. Other bits of the register are read-only and not used by the
driver. Rename `DAS08AO_GAIN_CONTROL` to `DAS08_GAIN_REG` and add a
comment. Remove `DAS08AO_GAIN_STATUS` as the driver does not use it and
the read-only parts of the register are documented in the comment.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 4e8756a..8aa8011 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -78,6 +78,13 @@
#define DAS08_CONTROL_DO_MASK 0xf0 /* digital outputs mask (not "JR") */
/* digital outputs (not "JR" boards) */
#define DAS08_CONTROL_DO(x) (((x) << 4) & DAS08_CONTROL_DO_MASK)
+/*
+ * (R/W) programmable AI gain ("PGx" and "AOx" boards):
+ * + bits 3..0 (R/W) show/set the gain for the current AI mux channel
+ * + bits 6..4 (R) show the current AI mux channel
+ * + bit 7 (R) not unused
+ */
+#define DAS08_GAIN_REG 0x03

/*
cio-das08jr.pdf
@@ -127,9 +134,6 @@
cdef 8255
*/

-#define DAS08AO_GAIN_CONTROL 3
-#define DAS08AO_GAIN_STATUS 3
-
#define DAS08AO_AO_LSB(x) ((x) ? 0xa : 8)
#define DAS08AO_AO_MSB(x) ((x) ? 0xb : 9)
#define DAS08AO_AO_UPDATE 8
@@ -260,7 +264,7 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
/* set gain/range */
range = CR_RANGE(insn->chanspec);
outb(devpriv->pg_gainlist[range],
- dev->iobase + DAS08AO_GAIN_CONTROL);
+ dev->iobase + DAS08_GAIN_REG);
}

for (n = 0; n < insn->n; n++) {
--
2.1.4

2015-06-05 17:34:41

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 21/32] staging: comedi: das08: rename DAS08AO_AO_LSB() and DAS08AO_AO_MSB()

The `DAS08AO_AO_LSB(x)` macro returns the offset to the analog output
low byte register for channel x (0 or 1) for "AOL", "AOM", and "AOH"
boards. The `DAS08AO_AO_MSB(x)` macro returns the offset to the
corresponding high byte register. Rename the macros to
`DAS08AOX_AO_LSB_REG(x)` and `DAS08AOX_AO_MSB_REG(x)` respectively, and
add some comments.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 8aa8011..005a7ef 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -134,8 +134,10 @@
cdef 8255
*/

-#define DAS08AO_AO_LSB(x) ((x) ? 0xa : 8)
-#define DAS08AO_AO_MSB(x) ((x) ? 0xb : 9)
+/* (W) analog output l.s.b. registers for 2 channels ("AOx" boards) */
+#define DAS08AOX_AO_LSB_REG(x) ((x) ? 0x0a : 0x08)
+/* (W) analog output m.s.b. registers for 2 channels ("AOx" boards) */
+#define DAS08AOX_AO_MSB_REG(x) ((x) ? 0x0b : 0x09)
#define DAS08AO_AO_UPDATE 8

/* gainlist same as _pgx_ below */
@@ -369,8 +371,8 @@ static void das08_ao_set_data(struct comedi_device *dev,
/* load DACs */
inb(dev->iobase + DAS08JR_AO_UPDATE_REG);
} else {
- outb(lsb, dev->iobase + DAS08AO_AO_LSB(chan));
- outb(msb, dev->iobase + DAS08AO_AO_MSB(chan));
+ outb(lsb, dev->iobase + DAS08AOX_AO_LSB_REG(chan));
+ outb(msb, dev->iobase + DAS08AOX_AO_MSB_REG(chan));
/* load DACs */
inb(dev->iobase + DAS08AO_AO_UPDATE);
}
--
2.1.4

2015-06-05 17:34:20

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 22/32] staging: comedi: das08: rename DAS08AO_AO_UPDATE

"AOL", "AOM", and "AOH" boards have a jumper that controls whether
analog output channels are updated simultaneously or individually. When
set to update individually, individual channels are updated when the
high byte register is written. When set to update simultaneously,
channels are not updated until any of the analog output registers are
read. The driver doesn't know the jumper setting and is not interested
in the simultaneous update feature, so it updates a channel by writing
the low byte register, the high byte register, and then reading channel
0's low byte register.

The `DAS08AO_AO_UPDATE` macro contains the offset to the low byte
register for analog output channel 0 on the "AOL", "AOM", and "AOH"
boards, which the driver reads to update the analog outputs. Rename the
macro to `DAS08AOX_AO_UPDATE_REG` and add a comment.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 005a7ef..837c968 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -138,7 +138,11 @@
#define DAS08AOX_AO_LSB_REG(x) ((x) ? 0x0a : 0x08)
/* (W) analog output m.s.b. registers for 2 channels ("AOx" boards) */
#define DAS08AOX_AO_MSB_REG(x) ((x) ? 0x0b : 0x09)
-#define DAS08AO_AO_UPDATE 8
+/*
+ * (R) update analog outputs ("AOx" boards set for simultaneous output)
+ * (any of the analog output registers could be used for this)
+ */
+#define DAS08AOX_AO_UPDATE_REG 0x08

/* gainlist same as _pgx_ below */

@@ -374,7 +378,7 @@ static void das08_ao_set_data(struct comedi_device *dev,
outb(lsb, dev->iobase + DAS08AOX_AO_LSB_REG(chan));
outb(msb, dev->iobase + DAS08AOX_AO_MSB_REG(chan));
/* load DACs */
- inb(dev->iobase + DAS08AO_AO_UPDATE);
+ inb(dev->iobase + DAS08AOX_AO_UPDATE_REG);
}
}

--
2.1.4

2015-06-05 17:33:52

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 23/32] staging: comedi: das08: remove board register map comments

The "das08" module contains some comments outlining the register maps
for some of the ISA boards supported by this module in combination with
the "das08_isa" module. The comments are somewhat sporadically placed,
don't detail all the boards, and don't use the preferred block comment
style. If anywhere, they should probably be in the "das08_isa" module.
Just remove them. The comments for the register macros indicate which
boards they apply to anyway, so we don't lose much information.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 68 +---------------------------------
1 file changed, 1 insertion(+), 67 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 837c968..a4b21c6 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -27,22 +27,6 @@
#include "das08.h"

/*
- cio-das08.pdf
-
- "isa-das08"
-
- 0 a/d bits 0-3 start 8 bit
- 1 a/d bits 4-11 start 12 bit
- 2 eoc, ip1-3, irq, mux op1-4, inte, mux
- 3 unused unused
- 4567 8254
- 89ab 8255
-
- requires hard-wiring for async ai
-
-*/
-
-/*
* Data format of DAS08_AI_LSB_REG and DAS08_AI_MSB_REG depends on
* 'ai_encoding' member of board structure:
*
@@ -86,22 +70,6 @@
*/
#define DAS08_GAIN_REG 0x03

-/*
- cio-das08jr.pdf
-
- "das08/jr-ao"
-
- 0 a/d bits 0-3 unused
- 1 a/d bits 4-11 start 12 bit
- 2 eoc, mux mux
- 3 di do
- 4 unused ao0_lsb
- 5 unused ao0_msb
- 6 unused ao1_lsb
- 7 unused ao1_msb
-
-*/
-
#define DAS08JR_DI_REG 0x03 /* (R) digital inputs ("JR" boards) */
#define DAS08JR_DO_REG 0x03 /* (W) digital outputs ("JR" boards) */
/* (W) analog output l.s.b. registers for 2 channels ("JR" boards) */
@@ -114,26 +82,6 @@
*/
#define DAS08JR_AO_UPDATE_REG 0x03

-/*
- cio-das08_aox.pdf
-
- "das08-aoh"
- "das08-aol"
- "das08-aom"
-
- 0 a/d bits 0-3 start 8 bit
- 1 a/d bits 4-11 start 12 bit
- 2 eoc, ip1-3, irq, mux op1-4, inte, mux
- 3 mux, gain status gain control
- 4567 8254
- 8 unused ao0_lsb
- 9 unused ao0_msb
- a unused ao1_lsb
- b unused ao1_msb
- 89ab
- cdef 8255
-*/
-
/* (W) analog output l.s.b. registers for 2 channels ("AOx" boards) */
#define DAS08AOX_AO_LSB_REG(x) ((x) ? 0x0a : 0x08)
/* (W) analog output m.s.b. registers for 2 channels ("AOx" boards) */
@@ -189,21 +137,7 @@ static const struct comedi_lrange range_das08_pgm = {
UNI_RANGE(0.1),
UNI_RANGE(0.01)
}
-}; /*
- cio-das08jr.pdf
-
- "das08/jr-ao"
-
- 0 a/d bits 0-3 unused
- 1 a/d bits 4-11 start 12 bit
- 2 eoc, mux mux
- 3 di do
- 4 unused ao0_lsb
- 5 unused ao0_msb
- 6 unused ao1_lsb
- 7 unused ao1_msb
-
- */
+};

static const struct comedi_lrange *const das08_ai_lranges[] = {
[das08_pg_none] = &range_unknown,
--
2.1.4

2015-06-05 17:33:49

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 24/32] staging: comedi: das08.c: reformat copyright comment

Replace double spaces with single spaces at the start of each line in
the copyright comment at the top of the file.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index a4b21c6..898622f 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -1,21 +1,21 @@
/*
- * comedi/drivers/das08.c
- * comedi module for common DAS08 support (used by ISA/PCI/PCMCIA drivers)
+ * comedi/drivers/das08.c
+ * comedi module for common DAS08 support (used by ISA/PCI/PCMCIA drivers)
*
- * COMEDI - Linux Control and Measurement Device Interface
- * Copyright (C) 2000 David A. Schleef <[email protected]>
- * Copyright (C) 2001,2002,2003 Frank Mori Hess <[email protected]>
- * Copyright (C) 2004 Salvador E. Tropea <[email protected]> <[email protected]>
+ * COMEDI - Linux Control and Measurement Device Interface
+ * Copyright (C) 2000 David A. Schleef <[email protected]>
+ * Copyright (C) 2001,2002,2003 Frank Mori Hess <[email protected]>
+ * Copyright (C) 2004 Salvador E. Tropea <[email protected]> <[email protected]>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*/

#include <linux/module.h>
--
2.1.4

2015-06-05 17:33:28

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 25/32] staging: comedi: das08.c: reformat remaining comments

Use the preferred style for block comments. Squash double spaces after
the comment opening sequence for single-line comments.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 898622f..4bde52a 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -193,7 +193,7 @@ static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
inb(dev->iobase + DAS08_AI_MSB_REG);

/* set multiplexer */
- /* lock to prevent race with digital output */
+ /* lock to prevent race with digital output */
spin_lock(&dev->spinlock);
devpriv->do_mux_bits &= ~DAS08_CONTROL_MUX_MASK;
devpriv->do_mux_bits |= DAS08_CONTROL_MUX(chan);
@@ -354,7 +354,8 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase)
/* ai */
if (thisboard->ai_nbits) {
s->type = COMEDI_SUBD_AI;
- /* XXX some boards actually have differential
+ /*
+ * XXX some boards actually have differential
* inputs instead of single ended.
* The driver does nothing with arefs though,
* so it's no big deal.
--
2.1.4

2015-06-05 17:33:10

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 26/32] staging: comedi: das08: rename ai range tables

The `range_das08_pgl`, `range_das08_pgm`, and `range_das08_pgh`
variables define the analog input ranges for the "PGL", "PGM", and "PGH"
board variants, and are also used for the "AOL", "AOM", and "AOH" board
variants. Rename them to use the `das08_` prefix for consistency.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 4bde52a..9f2113c 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -94,7 +94,7 @@

/* gainlist same as _pgx_ below */

-static const struct comedi_lrange range_das08_pgl = {
+static const struct comedi_lrange das08_pgl_ai_range = {
9, {
BIP_RANGE(10),
BIP_RANGE(5),
@@ -108,7 +108,7 @@ static const struct comedi_lrange range_das08_pgl = {
}
};

-static const struct comedi_lrange range_das08_pgh = {
+static const struct comedi_lrange das08_pgh_ai_range = {
12, {
BIP_RANGE(10),
BIP_RANGE(5),
@@ -125,7 +125,7 @@ static const struct comedi_lrange range_das08_pgh = {
}
};

-static const struct comedi_lrange range_das08_pgm = {
+static const struct comedi_lrange das08_pgm_ai_range = {
9, {
BIP_RANGE(10),
BIP_RANGE(5),
@@ -142,9 +142,9 @@ static const struct comedi_lrange range_das08_pgm = {
static const struct comedi_lrange *const das08_ai_lranges[] = {
[das08_pg_none] = &range_unknown,
[das08_bipolar5] = &range_bipolar5,
- [das08_pgh] = &range_das08_pgh,
- [das08_pgl] = &range_das08_pgl,
- [das08_pgm] = &range_das08_pgm,
+ [das08_pgh] = &das08_pgh_ai_range,
+ [das08_pgl] = &das08_pgl_ai_range,
+ [das08_pgm] = &das08_pgm_ai_range,
};

static const int das08_pgh_gainlist[] = {
--
2.1.4

2015-06-05 17:31:21

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 27/32] staging: comedi: das08: rename the gainlist variables

`das08_pgh_gainlist[]`, `das08_pgl_gainlist[]`, and
`das08_pgm_gainlist[]` hold the gain codes indexed by range index for
various boards that support programmable gain. `das08_gainlist[]` is a
look-up table to find the appropriate gain list for a board. These are
all associated with the analog input Comedi subdevice. Rename the
variables to reflect that.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 9f2113c..ec0998b 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -147,18 +147,18 @@ static const struct comedi_lrange *const das08_ai_lranges[] = {
[das08_pgm] = &das08_pgm_ai_range,
};

-static const int das08_pgh_gainlist[] = {
+static const int das08_pgh_ai_gainlist[] = {
8, 0, 10, 2, 12, 4, 14, 6, 1, 3, 5, 7
};
-static const int das08_pgl_gainlist[] = { 8, 0, 2, 4, 6, 1, 3, 5, 7 };
-static const int das08_pgm_gainlist[] = { 8, 0, 10, 12, 14, 9, 11, 13, 15 };
+static const int das08_pgl_ai_gainlist[] = { 8, 0, 2, 4, 6, 1, 3, 5, 7 };
+static const int das08_pgm_ai_gainlist[] = { 8, 0, 10, 12, 14, 9, 11, 13, 15 };

-static const int *const das08_gainlists[] = {
+static const int *const das08_ai_gainlists[] = {
[das08_pg_none] = NULL,
[das08_bipolar5] = NULL,
- [das08_pgh] = das08_pgh_gainlist,
- [das08_pgl] = das08_pgl_gainlist,
- [das08_pgm] = das08_pgm_gainlist,
+ [das08_pgh] = das08_pgh_ai_gainlist,
+ [das08_pgl] = das08_pgl_ai_gainlist,
+ [das08_pgm] = das08_pgm_ai_gainlist,
};

static int das08_ai_eoc(struct comedi_device *dev,
@@ -365,7 +365,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase)
s->maxdata = (1 << thisboard->ai_nbits) - 1;
s->range_table = das08_ai_lranges[thisboard->ai_pg];
s->insn_read = das08_ai_rinsn;
- devpriv->pg_gainlist = das08_gainlists[thisboard->ai_pg];
+ devpriv->pg_gainlist = das08_ai_gainlists[thisboard->ai_pg];
} else {
s->type = COMEDI_SUBD_UNUSED;
}
--
2.1.4

2015-06-05 17:32:42

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 28/32] staging: comedi: das08: rename das08_ai_rinsn()

`das08_ai_rinsn()` is the handler for Comedi `INSN_READ` instructions
for the AI subdevice. Rename the function to `das08_ai_insn_read()` for
consistency.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index ec0998b..98df718 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -174,8 +174,9 @@ static int das08_ai_eoc(struct comedi_device *dev,
return -EBUSY;
}

-static int das08_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
- struct comedi_insn *insn, unsigned int *data)
+static int das08_ai_insn_read(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn, unsigned int *data)
{
const struct das08_board_struct *thisboard = dev->board_ptr;
struct das08_private_struct *devpriv = dev->private;
@@ -364,7 +365,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase)
s->n_chan = 8;
s->maxdata = (1 << thisboard->ai_nbits) - 1;
s->range_table = das08_ai_lranges[thisboard->ai_pg];
- s->insn_read = das08_ai_rinsn;
+ s->insn_read = das08_ai_insn_read;
devpriv->pg_gainlist = das08_ai_gainlists[thisboard->ai_pg];
} else {
s->type = COMEDI_SUBD_UNUSED;
--
2.1.4

2015-06-05 17:32:40

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 29/32] staging: comedi: das08: rename das08_di_rbits() & das08jr_di_rbits()

`das08_di_rbits()` and `das08jr_di_rbits()` are handlers for the Comedi
`INSN_BITS` instruction for the digital input subdevice on "non-JR" and
"JR" boards, respectively. Rename them to `das08_di_insn_bits()` and
`das08jr_di_insn_bits()` respectively for consistency.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 98df718..5590f11 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -242,8 +242,9 @@ static int das08_ai_insn_read(struct comedi_device *dev,
return n;
}

-static int das08_di_rbits(struct comedi_device *dev, struct comedi_subdevice *s,
- struct comedi_insn *insn, unsigned int *data)
+static int das08_di_insn_bits(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn, unsigned int *data)
{
data[0] = 0;
data[1] = DAS08_STATUS_DI(inb(dev->iobase + DAS08_STATUS_REG));
@@ -272,9 +273,9 @@ static int das08_do_wbits(struct comedi_device *dev,
return insn->n;
}

-static int das08jr_di_rbits(struct comedi_device *dev,
- struct comedi_subdevice *s,
- struct comedi_insn *insn, unsigned int *data)
+static int das08jr_di_insn_bits(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn, unsigned int *data)
{
data[0] = 0;
data[1] = inb(dev->iobase + DAS08JR_DI_REG);
@@ -402,8 +403,8 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase)
s->n_chan = thisboard->di_nchan;
s->maxdata = 1;
s->range_table = &range_digital;
- s->insn_bits =
- thisboard->is_jr ? das08jr_di_rbits : das08_di_rbits;
+ s->insn_bits = thisboard->is_jr ? das08jr_di_insn_bits :
+ das08_di_insn_bits;
} else {
s->type = COMEDI_SUBD_UNUSED;
}
--
2.1.4

2015-06-05 17:32:23

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 30/32] staging: comedi: das08: rename das08_do_wbits() & das08jr_do_wbits()

`das08_do_wbits()` and `das08jr_do_wbits()` are handlers for the Comedi
`INSN_BITS` instruction for the digital output subdevice on "non-JR" and
"JR" boards, respectively. Rename them to `das08_do_insn_bits()` and
`das08jr_do_insn_bits()` respectively for consistency.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 5590f11..f74c4b0 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -252,10 +252,9 @@ static int das08_di_insn_bits(struct comedi_device *dev,
return insn->n;
}

-static int das08_do_wbits(struct comedi_device *dev,
- struct comedi_subdevice *s,
- struct comedi_insn *insn,
- unsigned int *data)
+static int das08_do_insn_bits(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn, unsigned int *data)
{
struct das08_private_struct *devpriv = dev->private;

@@ -283,10 +282,9 @@ static int das08jr_di_insn_bits(struct comedi_device *dev,
return insn->n;
}

-static int das08jr_do_wbits(struct comedi_device *dev,
- struct comedi_subdevice *s,
- struct comedi_insn *insn,
- unsigned int *data)
+static int das08jr_do_insn_bits(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_insn *insn, unsigned int *data)
{
if (comedi_dio_update_state(s, data))
outb(s->state, dev->iobase + DAS08JR_DO_REG);
@@ -417,8 +415,8 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase)
s->n_chan = thisboard->do_nchan;
s->maxdata = 1;
s->range_table = &range_digital;
- s->insn_bits =
- thisboard->is_jr ? das08jr_do_wbits : das08_do_wbits;
+ s->insn_bits = thisboard->is_jr ? das08jr_do_insn_bits :
+ das08_do_insn_bits;
} else {
s->type = COMEDI_SUBD_UNUSED;
}
--
2.1.4

2015-06-05 17:31:30

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 31/32] staging: comedi: das08: clarify sign-magnitude conversion

For DAS08/JR/16 and DAS08/JR/AO-16 boards, the 16-bit analog input
readings are assumed to be in a sign-magnitude format and need
converting to the COMEDI unsigned sample format. The expressions to do
the conversion look a little messy. Use a local variable `magnitude` to
make it easier to follow.

Also, there seems to be some discrepancy between the manual for these
boards and the COMEDI code. The manual implies that 0 is full-scale
negative and 65535 is full-scale positive. However, the COMEDI code has
used the sign-magnitude conversion for these boards since these two
boards were initially supported by a patch from an external contributor
to the COMEDI project back in 2001. Assume the code is correct for now,
but add a comment to mention the discrepancy.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index f74c4b0..6c9bd10 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -228,11 +228,26 @@ static int das08_ai_insn_read(struct comedi_device *dev,
} else if (thisboard->ai_encoding == das08_pcm_encode12) {
data[n] = (msb << 8) + lsb;
} else if (thisboard->ai_encoding == das08_encode16) {
- /* FPOS 16-bit boards are sign-magnitude */
+ /*
+ * "JR" 16-bit boards are sign-magnitude.
+ *
+ * XXX The manual seems to imply that 0 is full-scale
+ * negative and 65535 is full-scale positive, but the
+ * original COMEDI patch to add support for the
+ * DAS08/JR/16 and DAS08/JR/16-AO boards have it
+ * encoded as sign-magnitude. Assume the original
+ * COMEDI code is correct for now.
+ */
+ unsigned int magnitude = lsb | ((msb & 0x7f) << 8);
+
+ /*
+ * MSB bit 7 is 0 for negative, 1 for positive voltage.
+ * COMEDI 16-bit bipolar data value for 0V is 0x8000.
+ */
if (msb & 0x80)
- data[n] = (1 << 15) | lsb | ((msb & 0x7f) << 8);
+ data[n] = (1 << 15) + magnitude;
else
- data[n] = (1 << 15) - (lsb | (msb & 0x7f) << 8);
+ data[n] = (1 << 15) - magnitude;
} else {
dev_err(dev->class_dev, "bug! unknown ai encoding\n");
return -1;
--
2.1.4

2015-06-05 17:31:27

by Ian Abbott

[permalink] [raw]
Subject: [PATCH 32/32] staging: comedi: das08: use better MODULE_DESCRIPTION()

Replace the boiler-plate Comedi module description string with something
more specific.

Signed-off-by: Ian Abbott <[email protected]>
---
drivers/staging/comedi/drivers/das08.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/das08.c b/drivers/staging/comedi/drivers/das08.c
index 6c9bd10..700a40b 100644
--- a/drivers/staging/comedi/drivers/das08.c
+++ b/drivers/staging/comedi/drivers/das08.c
@@ -476,5 +476,5 @@ static void __exit das08_exit(void)
module_exit(das08_exit);

MODULE_AUTHOR("Comedi http://www.comedi.org");
-MODULE_DESCRIPTION("Comedi low-level driver");
+MODULE_DESCRIPTION("Comedi common DAS08 support module");
MODULE_LICENSE("GPL");
--
2.1.4

2015-06-09 00:56:28

by Hartley Sweeten

[permalink] [raw]
Subject: RE: [PATCH 00/32] staging: comedi: das08: tidy up

On Friday, June 05, 2015 10:30 AM, Ian Abbott wrote:
> Clean up the Comedi "das08" module a bit, mostly for consistent naming
> of things.

<snip>

> drivers/staging/comedi/drivers/das08.c | 333 ++++++++++++++++-----------------
> drivers/staging/comedi/drivers/das08.h | 48 ++---
> 2 files changed, 188 insertions(+), 193 deletions(-)

Reviewed-by: H Hartley Sweeten <[email protected]>