Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1402244 > unrolled thread

[PATCH 12/14] staging: comedi: daqboard2000: rename reference DACs register macros

Started byIan Abbott <abbotti@mev.co.uk>
First post2016-05-17 12:00 +0200
Last post2016-05-17 12:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 12/14] staging: comedi: daqboard2000: rename reference DACs register macros Ian Abbott <abbotti@mev.co.uk> - 2016-05-17 12:00 +0200

#1402244 — [PATCH 12/14] staging: comedi: daqboard2000: rename reference DACs register macros

FromIan Abbott <abbotti@mev.co.uk>
Date2016-05-17 12:00 +0200
Subject[PATCH 12/14] staging: comedi: daqboard2000: rename reference DACs register macros
Message-ID<rzJXh-2UD-29@gated-at.bofh.it>
Rename the macros that define values for the reference DACs register to
avoid CamelCase, and to make it clearer which register they are
associated with.  Add a macro `DAQBOARD2000_REF_DACS_SET` for the value
`0x80` that triggers setting one of the references.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/drivers/daqboard2000.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c b/drivers/staging/comedi/drivers/daqboard2000.c
index b6b4ee4..7034e68 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -244,8 +244,9 @@ static const struct comedi_lrange range_daqboard2000_ai = {
 #define DAQBOARD2000_TRIG_CONTROL_DISABLE			0x0000
 
 /* Reference Dac Selection */
-#define DAQBOARD2000_PosRefDacSelect             0x0100
-#define DAQBOARD2000_NegRefDacSelect             0x0000
+#define DAQBOARD2000_REF_DACS_SET				0x0080
+#define DAQBOARD2000_REF_DACS_SELECT_POS_REF			0x0100
+#define DAQBOARD2000_REF_DACS_SELECT_NEG_REF			0x0000
 
 struct daq200_boardtype {
 	const char *name;
@@ -571,7 +572,7 @@ static void daqboard2000_activateReferenceDacs(struct comedi_device *dev)
 	int timeout;
 
 	/*  Set the + reference dac value in the FPGA */
-	writew(0x80 | DAQBOARD2000_PosRefDacSelect,
+	writew(DAQBOARD2000_REF_DACS_SET | DAQBOARD2000_REF_DACS_SELECT_POS_REF,
 	       dev->mmio + DAQBOARD2000_REG_REF_DACS);
 	for (timeout = 0; timeout < 20; timeout++) {
 		val = readw(dev->mmio + DAQBOARD2000_REG_DAC_STATUS);
@@ -581,7 +582,7 @@ static void daqboard2000_activateReferenceDacs(struct comedi_device *dev)
 	}
 
 	/*  Set the - reference dac value in the FPGA */
-	writew(0x80 | DAQBOARD2000_NegRefDacSelect,
+	writew(DAQBOARD2000_REF_DACS_SET | DAQBOARD2000_REF_DACS_SELECT_NEG_REF,
 	       dev->mmio + DAQBOARD2000_REG_REF_DACS);
 	for (timeout = 0; timeout < 20; timeout++) {
 		val = readw(dev->mmio + DAQBOARD2000_REG_DAC_STATUS);
-- 
2.8.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web