Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317632
b: refs/heads/master
c: 23e3cce
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 6, 2012
1 parent 5dffb75 commit 5444fdc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4466fc45007c346971ae537cc64e82a8a4961160
refs/heads/master: 23e3cce3270b5f0d9c094c9bcb34d919713e02eb
41 changes: 16 additions & 25 deletions trunk/drivers/staging/comedi/drivers/cb_pcidas.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ struct cb_pcidas_board {
const struct comedi_lrange *ranges;
enum trimpot_model trimpot;
unsigned has_dac08:1;
unsigned has_ai_trig_gated:1; /* Tells if the AI trigger can be gated */
unsigned has_ai_trig_invert:1; /* Tells if the AI trigger can be inverted */
unsigned is_1602:1;
};

static const struct cb_pcidas_board cb_pcidas_boards[] = {
Expand All @@ -269,8 +268,7 @@ static const struct cb_pcidas_board cb_pcidas_boards[] = {
.ranges = &cb_pcidas_ranges,
.trimpot = AD8402,
.has_dac08 = 1,
.has_ai_trig_gated = 1,
.has_ai_trig_invert = 1,
.is_1602 = 1,
},
{
.name = "pci-das1200",
Expand All @@ -285,8 +283,7 @@ static const struct cb_pcidas_board cb_pcidas_boards[] = {
.ranges = &cb_pcidas_ranges,
.trimpot = AD7376,
.has_dac08 = 0,
.has_ai_trig_gated = 0,
.has_ai_trig_invert = 0,
.is_1602 = 0,
},
{
.name = "pci-das1602/12",
Expand All @@ -302,8 +299,7 @@ static const struct cb_pcidas_board cb_pcidas_boards[] = {
.ranges = &cb_pcidas_ranges,
.trimpot = AD7376,
.has_dac08 = 0,
.has_ai_trig_gated = 1,
.has_ai_trig_invert = 1,
.is_1602 = 1,
},
{
.name = "pci-das1200/jr",
Expand All @@ -318,8 +314,7 @@ static const struct cb_pcidas_board cb_pcidas_boards[] = {
.ranges = &cb_pcidas_ranges,
.trimpot = AD7376,
.has_dac08 = 0,
.has_ai_trig_gated = 0,
.has_ai_trig_invert = 0,
.is_1602 = 0,
},
{
.name = "pci-das1602/16/jr",
Expand All @@ -334,8 +329,7 @@ static const struct cb_pcidas_board cb_pcidas_boards[] = {
.ranges = &cb_pcidas_ranges,
.trimpot = AD8402,
.has_dac08 = 1,
.has_ai_trig_gated = 1,
.has_ai_trig_invert = 1,
.is_1602 = 1,
},
{
.name = "pci-das1000",
Expand All @@ -350,8 +344,7 @@ static const struct cb_pcidas_board cb_pcidas_boards[] = {
.ranges = &cb_pcidas_ranges,
.trimpot = AD7376,
.has_dac08 = 0,
.has_ai_trig_gated = 0,
.has_ai_trig_invert = 0,
.is_1602 = 0,
},
{
.name = "pci-das1001",
Expand All @@ -366,8 +359,7 @@ static const struct cb_pcidas_board cb_pcidas_boards[] = {
.ranges = &cb_pcidas_alt_ranges,
.trimpot = AD7376,
.has_dac08 = 0,
.has_ai_trig_gated = 0,
.has_ai_trig_invert = 0,
.is_1602 = 0,
},
{
.name = "pci-das1002",
Expand All @@ -382,8 +374,7 @@ static const struct cb_pcidas_board cb_pcidas_boards[] = {
.ranges = &cb_pcidas_ranges,
.trimpot = AD7376,
.has_dac08 = 0,
.has_ai_trig_gated = 0,
.has_ai_trig_invert = 0,
.is_1602 = 0,
},
};

Expand Down Expand Up @@ -938,8 +929,7 @@ static int cb_pcidas_ai_cmdtest(struct comedi_device *dev,
~(CR_FLAGS_MASK & ~(CR_EDGE | CR_INVERT));
err++;
}
if (!thisboard->has_ai_trig_invert &&
(cmd->start_arg & CR_INVERT)) {
if (!thisboard->is_1602 && (cmd->start_arg & CR_INVERT)) {
cmd->start_arg &= (CR_FLAGS_MASK & ~CR_INVERT);
err++;
}
Expand Down Expand Up @@ -1118,11 +1108,12 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
bits |= SW_TRIGGER;
else if (cmd->start_src == TRIG_EXT) {
bits |= EXT_TRIGGER | TGEN | XTRCL;
if (thisboard->has_ai_trig_invert
&& (cmd->start_arg & CR_INVERT))
bits |= TGPOL;
if (thisboard->has_ai_trig_gated && (cmd->start_arg & CR_EDGE))
bits |= TGSEL;
if (thisboard->is_1602) {
if (cmd->start_arg & CR_INVERT)
bits |= TGPOL;
if (cmd->start_arg & CR_EDGE)
bits |= TGSEL;
}
} else {
comedi_error(dev, "bug!");
return -1;
Expand Down

0 comments on commit 5444fdc

Please sign in to comment.