浏览代码

staging: comedi: cb_pcimdas: provide analog output range table

The analog output range is not programmable. The DAC ranges are
jumper-settable on the board. For aesthetics, provide a range table
for the user with all possible ranges.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
H Hartley Sweeten 10 年之前
父节点
当前提交
21314bc6f8
共有 1 个文件被更改,包括 14 次插入2 次删除
  1. 14 2
      drivers/staging/comedi/drivers/cb_pcimdas.c

+ 14 - 2
drivers/staging/comedi/drivers/cb_pcimdas.c

@@ -136,6 +136,19 @@ static const struct comedi_lrange cb_pcimdas_ai_uni_range = {
 	}
 	}
 };
 };
 
 
+/*
+ * The Analog Output range is not programmable. The DAC ranges are
+ * jumper-settable on the board. The settings are not software-readable.
+ */
+static const struct comedi_lrange cb_pcimdas_ao_range = {
+	4, {
+		BIP_RANGE(10),
+		BIP_RANGE(5),
+		UNI_RANGE(10),
+		UNI_RANGE(5)
+	}
+};
+
 /*
 /*
  * this structure is for data unique to this hardware driver.  If
  * this structure is for data unique to this hardware driver.  If
  * several hardware drivers keep similar information in this structure,
  * several hardware drivers keep similar information in this structure,
@@ -306,8 +319,7 @@ static int cb_pcimdas_auto_attach(struct comedi_device *dev,
 	s->subdev_flags = SDF_WRITABLE;
 	s->subdev_flags = SDF_WRITABLE;
 	s->n_chan = 2;
 	s->n_chan = 2;
 	s->maxdata = 0xfff;
 	s->maxdata = 0xfff;
-	/* ranges are hardware settable, but not software readable. */
-	s->range_table = &range_unknown;
+	s->range_table = &cb_pcimdas_ao_range;
 	s->insn_write = cb_pcimdas_ao_insn_write;
 	s->insn_write = cb_pcimdas_ao_insn_write;
 
 
 	ret = comedi_alloc_subdev_readback(s);
 	ret = comedi_alloc_subdev_readback(s);