diff options
author | Xenofon Foukas <foukas.xenofon@gmail.com> | 2010-12-14 17:14:30 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-16 15:20:05 -0500 |
commit | 3555a4c35e59c0217983f5df0cfe39a9fa65c2df (patch) | |
tree | 44b260c6e4d29053003d1adb6eed9c131c339108 | |
parent | 91cda632ebc6ea84fd7a45efb6d4452c34985731 (diff) |
Staging: comedi: Fix coding style issues in ii_pci20kc.c
This patch fixes the following issues in file ii_pci20kc.c:
WARNING: please, no space before tabs
WARNING: unnecessary whitespace before a quoted newline
WARNING: line over 80 characters
Signed-off-by: Xenofon Foukas <foukas.xenofon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/comedi/drivers/ii_pci20kc.c | 66 |
1 files changed, 46 insertions, 20 deletions
diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c index 39a6a850d63c..e4711ef54719 100644 --- a/drivers/staging/comedi/drivers/ii_pci20kc.c +++ b/drivers/staging/comedi/drivers/ii_pci20kc.c | |||
@@ -19,7 +19,7 @@ | |||
19 | * - 16 bit | 19 | * - 16 bit |
20 | * | 20 | * |
21 | * only ONE PCI-20341 module possible | 21 | * only ONE PCI-20341 module possible |
22 | * only ONE PCI-20006 module possible | 22 | * only ONE PCI-20006 module possible |
23 | * no extern trigger implemented | 23 | * no extern trigger implemented |
24 | * | 24 | * |
25 | * NOT WORKING (but soon) only 4 on-board differential channels supported | 25 | * NOT WORKING (but soon) only 4 on-board differential channels supported |
@@ -83,11 +83,11 @@ options for PCI-20341M: | |||
83 | #include "../comedidev.h" | 83 | #include "../comedidev.h" |
84 | 84 | ||
85 | #define PCI20000_ID 0x1d | 85 | #define PCI20000_ID 0x1d |
86 | #define PCI20341_ID 0x77 | 86 | #define PCI20341_ID 0x77 |
87 | #define PCI20006_ID 0xe3 | 87 | #define PCI20006_ID 0xe3 |
88 | #define PCI20xxx_EMPTY_ID 0xff | 88 | #define PCI20xxx_EMPTY_ID 0xff |
89 | 89 | ||
90 | #define PCI20000_OFFSET 0x100 | 90 | #define PCI20000_OFFSET 0x100 |
91 | #define PCI20000_MODULES 3 | 91 | #define PCI20000_MODULES 3 |
92 | 92 | ||
93 | #define PCI20000_DIO_0 0x80 | 93 | #define PCI20000_DIO_0 0x80 |
@@ -246,7 +246,7 @@ static int pci20xxx_attach(struct comedi_device *dev, | |||
246 | pci20006_init(dev, s, it->options[2 * i + 2], | 246 | pci20006_init(dev, s, it->options[2 * i + 2], |
247 | it->options[2 * i + 3]); | 247 | it->options[2 * i + 3]); |
248 | printk(KERN_INFO "comedi%d: " | 248 | printk(KERN_INFO "comedi%d: " |
249 | "ii_pci20kc PCI-20006 module in slot %d \n", | 249 | "ii_pci20kc PCI-20006 module in slot %d\n", |
250 | dev->minor, i + 1); | 250 | dev->minor, i + 1); |
251 | break; | 251 | break; |
252 | case PCI20341_ID: | 252 | case PCI20341_ID: |
@@ -255,7 +255,7 @@ static int pci20xxx_attach(struct comedi_device *dev, | |||
255 | pci20341_init(dev, s, it->options[2 * i + 2], | 255 | pci20341_init(dev, s, it->options[2 * i + 2], |
256 | it->options[2 * i + 3]); | 256 | it->options[2 * i + 3]); |
257 | printk(KERN_INFO "comedi%d: " | 257 | printk(KERN_INFO "comedi%d: " |
258 | "ii_pci20kc PCI-20341 module in slot %d \n", | 258 | "ii_pci20kc PCI-20341 module in slot %d\n", |
259 | dev->minor, i + 1); | 259 | dev->minor, i + 1); |
260 | break; | 260 | break; |
261 | default: | 261 | default: |
@@ -376,9 +376,20 @@ static int pci20341_insn_read(struct comedi_device *dev, | |||
376 | static const int pci20341_timebase[] = { 0x00, 0x00, 0x00, 0x04 }; | 376 | static const int pci20341_timebase[] = { 0x00, 0x00, 0x00, 0x04 }; |
377 | static const int pci20341_settling_time[] = { 0x58, 0x58, 0x93, 0x99 }; | 377 | static const int pci20341_settling_time[] = { 0x58, 0x58, 0x93, 0x99 }; |
378 | 378 | ||
379 | static const struct comedi_lrange range_bipolar0_5 = { 1, {BIP_RANGE(0.5)} }; | 379 | static const struct comedi_lrange range_bipolar0_5 = { |
380 | static const struct comedi_lrange range_bipolar0_05 = { 1, {BIP_RANGE(0.05)} }; | 380 | 1, |
381 | static const struct comedi_lrange range_bipolar0_025 = { 1, {BIP_RANGE(0.025)} }; | 381 | {BIP_RANGE(0.5)} |
382 | }; | ||
383 | |||
384 | static const struct comedi_lrange range_bipolar0_05 = { | ||
385 | 1, | ||
386 | {BIP_RANGE(0.05)} | ||
387 | }; | ||
388 | |||
389 | static const struct comedi_lrange range_bipolar0_025 = { | ||
390 | 1, | ||
391 | {BIP_RANGE(0.025)} | ||
392 | }; | ||
382 | 393 | ||
383 | static const struct comedi_lrange *const pci20341_ranges[] = { | 394 | static const struct comedi_lrange *const pci20341_ranges[] = { |
384 | &range_bipolar5, | 395 | &range_bipolar5, |
@@ -408,12 +419,18 @@ static int pci20341_init(struct comedi_device *dev, struct comedi_subdevice *s, | |||
408 | s->maxdata = 0xffff; | 419 | s->maxdata = 0xffff; |
409 | s->range_table = pci20341_ranges[opt0]; | 420 | s->range_table = pci20341_ranges[opt0]; |
410 | 421 | ||
411 | option = sdp->pci20341.timebase | PCI20341_REPMODE; /* depends on gain, trigger, repetition mode */ | 422 | /* depends on gain, trigger, repetition mode */ |
412 | 423 | option = sdp->pci20341.timebase | PCI20341_REPMODE; | |
413 | writeb(PCI20341_INIT, sdp->iobase + PCI20341_CONFIG_REG); /* initialize Module */ | 424 | |
414 | writeb(PCI20341_PACER, sdp->iobase + PCI20341_MOD_STATUS); /* set Pacer */ | 425 | /* initialize Module */ |
415 | writeb(option, sdp->iobase + PCI20341_OPT_REG); /* option register */ | 426 | writeb(PCI20341_INIT, sdp->iobase + PCI20341_CONFIG_REG); |
416 | writeb(sdp->pci20341.settling_time, sdp->iobase + PCI20341_SET_TIME_REG); /* settling time counter */ | 427 | /* set Pacer */ |
428 | writeb(PCI20341_PACER, sdp->iobase + PCI20341_MOD_STATUS); | ||
429 | /* option register */ | ||
430 | writeb(option, sdp->iobase + PCI20341_OPT_REG); | ||
431 | /* settling time counter */ | ||
432 | writeb(sdp->pci20341.settling_time, | ||
433 | sdp->iobase + PCI20341_SET_TIME_REG); | ||
417 | /* trigger not implemented */ | 434 | /* trigger not implemented */ |
418 | return 0; | 435 | return 0; |
419 | } | 436 | } |
@@ -429,11 +446,15 @@ static int pci20341_insn_read(struct comedi_device *dev, | |||
429 | unsigned int clb; /* channel list byte */ | 446 | unsigned int clb; /* channel list byte */ |
430 | unsigned int boarddata; | 447 | unsigned int boarddata; |
431 | 448 | ||
432 | writeb(1, sdp->iobase + PCI20341_LCHAN_ADDR_REG); /* write number of input channels */ | 449 | /* write number of input channels */ |
450 | writeb(1, sdp->iobase + PCI20341_LCHAN_ADDR_REG); | ||
433 | clb = PCI20341_DAISY_CHAIN | PCI20341_MUX | (sdp->pci20341.ai_gain << 3) | 451 | clb = PCI20341_DAISY_CHAIN | PCI20341_MUX | (sdp->pci20341.ai_gain << 3) |
434 | | CR_CHAN(insn->chanspec); | 452 | | CR_CHAN(insn->chanspec); |
435 | writeb(clb, sdp->iobase + PCI20341_CHAN_LIST); | 453 | writeb(clb, sdp->iobase + PCI20341_CHAN_LIST); |
436 | writeb(0x00, sdp->iobase + PCI20341_CC_RESET); /* reset settling time counter and trigger delay counter */ | 454 | |
455 | /* reset settling time counter and trigger delay counter */ | ||
456 | writeb(0x00, sdp->iobase + PCI20341_CC_RESET); | ||
457 | |||
437 | writeb(0x00, sdp->iobase + PCI20341_CHAN_RESET); | 458 | writeb(0x00, sdp->iobase + PCI20341_CHAN_RESET); |
438 | 459 | ||
439 | /* generate Pacer */ | 460 | /* generate Pacer */ |
@@ -444,9 +465,12 @@ static int pci20341_insn_read(struct comedi_device *dev, | |||
444 | * the whole interrupt stuff | 465 | * the whole interrupt stuff |
445 | */ | 466 | */ |
446 | j = 0; | 467 | j = 0; |
447 | readb(sdp->iobase + PCI20341_SOFT_PACER); /* generate Pacer */ | 468 | /* generate Pacer */ |
469 | readb(sdp->iobase + PCI20341_SOFT_PACER); | ||
470 | |||
448 | eoc = readb(sdp->iobase + PCI20341_STATUS_REG); | 471 | eoc = readb(sdp->iobase + PCI20341_STATUS_REG); |
449 | while ((eoc < 0x80) && j < 100) { /* poll Interrupt Flag */ | 472 | /* poll Interrupt Flag */ |
473 | while ((eoc < 0x80) && j < 100) { | ||
450 | j++; | 474 | j++; |
451 | eoc = readb(sdp->iobase + PCI20341_STATUS_REG); | 475 | eoc = readb(sdp->iobase + PCI20341_STATUS_REG); |
452 | } | 476 | } |
@@ -460,7 +484,9 @@ static int pci20341_insn_read(struct comedi_device *dev, | |||
460 | lo = readb(sdp->iobase + PCI20341_LDATA); | 484 | lo = readb(sdp->iobase + PCI20341_LDATA); |
461 | hi = readb(sdp->iobase + PCI20341_LDATA + 1); | 485 | hi = readb(sdp->iobase + PCI20341_LDATA + 1); |
462 | boarddata = lo + 0x100 * hi; | 486 | boarddata = lo + 0x100 * hi; |
463 | data[i] = (short)((boarddata + 0x8000) & 0xffff); /* board-data -> comedi-data */ | 487 | |
488 | /* board-data -> comedi-data */ | ||
489 | data[i] = (short)((boarddata + 0x8000) & 0xffff); | ||
464 | } | 490 | } |
465 | 491 | ||
466 | return i; | 492 | return i; |