diff options
author | Xenofon Foukas <foukas.xenofon@gmail.com> | 2010-12-15 12:44:20 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-16 15:20:06 -0500 |
commit | c9c62f4e2c9b526c5cbade3f3a61f126e6587c16 (patch) | |
tree | bb4991ed4863b15d143531985804cbf6c33e3f10 /drivers/staging | |
parent | 3555a4c35e59c0217983f5df0cfe39a9fa65c2df (diff) |
Staging: comedi: Fix checkpatch.pl issues in file s526.c
This patch fixes the following issues in s526.c:
WARNING: printk() should include KERN_ facility level
WARNING: line over 80 characters
ERROR: do not use C99 // comments
WARNING: space prohibited between function name and open parenthesis '('
WARNING: braces {} are not necessary for any arm of this statement
WARNING: suspect code indent for conditional statements (16, 16)
Signed-off-by: Xenofon Foukas <foukas.xenofon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/comedi/drivers/s526.c | 139 |
1 files changed, 82 insertions, 57 deletions
diff --git a/drivers/staging/comedi/drivers/s526.c b/drivers/staging/comedi/drivers/s526.c index 3607aaee4af..2b34daedc3d 100644 --- a/drivers/staging/comedi/drivers/s526.c +++ b/drivers/staging/comedi/drivers/s526.c | |||
@@ -114,7 +114,7 @@ static const int s526_ports[] = { | |||
114 | }; | 114 | }; |
115 | 115 | ||
116 | struct counter_mode_register_t { | 116 | struct counter_mode_register_t { |
117 | #if defined (__LITTLE_ENDIAN_BITFIELD) | 117 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
118 | unsigned short coutSource:1; | 118 | unsigned short coutSource:1; |
119 | unsigned short coutPolarity:1; | 119 | unsigned short coutPolarity:1; |
120 | unsigned short autoLoadResetRcap:3; | 120 | unsigned short autoLoadResetRcap:3; |
@@ -207,7 +207,9 @@ static const struct s526_board s526_boards[] = { | |||
207 | 207 | ||
208 | /* this structure is for data unique to this hardware driver. If | 208 | /* this structure is for data unique to this hardware driver. If |
209 | several hardware drivers keep similar information in this structure, | 209 | several hardware drivers keep similar information in this structure, |
210 | feel free to suggest moving the variable to the struct comedi_device struct. */ | 210 | feel free to suggest moving the variable to the struct comedi_device |
211 | struct. | ||
212 | */ | ||
211 | struct s526_private { | 213 | struct s526_private { |
212 | 214 | ||
213 | int data; | 215 | int data; |
@@ -304,7 +306,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
304 | /* int subdev_channel = 0; */ | 306 | /* int subdev_channel = 0; */ |
305 | union cmReg cmReg; | 307 | union cmReg cmReg; |
306 | 308 | ||
307 | printk("comedi%d: s526: ", dev->minor); | 309 | printk(KERN_INFO "comedi%d: s526: ", dev->minor); |
308 | 310 | ||
309 | iobase = it->options[0]; | 311 | iobase = it->options[0]; |
310 | if (!iobase || !request_region(iobase, S526_IOSIZE, thisboard->name)) { | 312 | if (!iobase || !request_region(iobase, S526_IOSIZE, thisboard->name)) { |
@@ -317,7 +319,8 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
317 | 319 | ||
318 | /*** make it a little quieter, exw, 8/29/06 | 320 | /*** make it a little quieter, exw, 8/29/06 |
319 | for (i = 0; i < S526_NUM_PORTS; i++) { | 321 | for (i = 0; i < S526_NUM_PORTS; i++) { |
320 | printk("0x%02x: 0x%04x\n", ADDR_REG(s526_ports[i]), inw(ADDR_REG(s526_ports[i]))); | 322 | printk("0x%02x: 0x%04x\n", ADDR_REG(s526_ports[i]), |
323 | inw(ADDR_REG(s526_ports[i]))); | ||
321 | } | 324 | } |
322 | ***/ | 325 | ***/ |
323 | 326 | ||
@@ -402,7 +405,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
402 | s->type = COMEDI_SUBD_UNUSED; | 405 | s->type = COMEDI_SUBD_UNUSED; |
403 | } | 406 | } |
404 | 407 | ||
405 | printk("attached\n"); | 408 | printk(KERN_INFO "attached\n"); |
406 | 409 | ||
407 | return 1; | 410 | return 1; |
408 | 411 | ||
@@ -411,7 +414,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
411 | /* One-shot (software trigger) */ | 414 | /* One-shot (software trigger) */ |
412 | cmReg.reg.coutSource = 0; /* out RCAP */ | 415 | cmReg.reg.coutSource = 0; /* out RCAP */ |
413 | cmReg.reg.coutPolarity = 1; /* Polarity inverted */ | 416 | cmReg.reg.coutPolarity = 1; /* Polarity inverted */ |
414 | cmReg.reg.autoLoadResetRcap = 1; /* Auto load 0:disabled, 1:enabled */ | 417 | cmReg.reg.autoLoadResetRcap = 1;/* Auto load 0:disabled, 1:enabled */ |
415 | cmReg.reg.hwCtEnableSource = 3; /* NOT RCAP */ | 418 | cmReg.reg.hwCtEnableSource = 3; /* NOT RCAP */ |
416 | cmReg.reg.ctEnableCtrl = 2; /* Hardware */ | 419 | cmReg.reg.ctEnableCtrl = 2; /* Hardware */ |
417 | cmReg.reg.clockSource = 2; /* Internal */ | 420 | cmReg.reg.clockSource = 2; /* Internal */ |
@@ -426,10 +429,12 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
426 | outw(0x0001, ADDR_CHAN_REG(REG_C0H, subdev_channel)); | 429 | outw(0x0001, ADDR_CHAN_REG(REG_C0H, subdev_channel)); |
427 | outw(0x3C68, ADDR_CHAN_REG(REG_C0L, subdev_channel)); | 430 | outw(0x3C68, ADDR_CHAN_REG(REG_C0L, subdev_channel)); |
428 | 431 | ||
429 | outw(0x8000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); /* Reset the counter */ | 432 | /* Reset the counter */ |
430 | outw(0x4000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); /* Load the counter from PR0 */ | 433 | outw(0x8000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); |
431 | 434 | /* Load the counter from PR0 */ | |
432 | outw(0x0008, ADDR_CHAN_REG(REG_C0C, subdev_channel)); /* Reset RCAP (fires one-shot) */ | 435 | outw(0x4000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); |
436 | /* Reset RCAP (fires one-shot) */ | ||
437 | outw(0x0008, ADDR_CHAN_REG(REG_C0C, subdev_channel)); | ||
433 | 438 | ||
434 | #else | 439 | #else |
435 | 440 | ||
@@ -447,11 +452,12 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
447 | cmReg.reg.reserved = 0; | 452 | cmReg.reg.reserved = 0; |
448 | 453 | ||
449 | n = 0; | 454 | n = 0; |
450 | printk("Mode reg=0x%04x, 0x%04lx\n", cmReg.value, ADDR_CHAN_REG(REG_C0M, | 455 | printk(KERN_INFO "Mode reg=0x%04x, 0x%04lx\n", |
451 | n)); | 456 | cmReg.value, ADDR_CHAN_REG(REG_C0M, n)); |
452 | outw(cmReg.value, ADDR_CHAN_REG(REG_C0M, n)); | 457 | outw(cmReg.value, ADDR_CHAN_REG(REG_C0M, n)); |
453 | udelay(1000); | 458 | udelay(1000); |
454 | printk("Read back mode reg=0x%04x\n", inw(ADDR_CHAN_REG(REG_C0M, n))); | 459 | printk(KERN_INFO "Read back mode reg=0x%04x\n", |
460 | inw(ADDR_CHAN_REG(REG_C0M, n))); | ||
455 | 461 | ||
456 | /* Load the pre-load register high word */ | 462 | /* Load the pre-load register high word */ |
457 | /* value = (short) (0x55); */ | 463 | /* value = (short) (0x55); */ |
@@ -466,20 +472,23 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
466 | 472 | ||
467 | /* Reset the counter if it is software preload */ | 473 | /* Reset the counter if it is software preload */ |
468 | if (cmReg.reg.autoLoadResetRcap == 0) { | 474 | if (cmReg.reg.autoLoadResetRcap == 0) { |
469 | outw(0x8000, ADDR_CHAN_REG(REG_C0C, n)); /* Reset the counter */ | 475 | /* Reset the counter */ |
470 | outw(0x4000, ADDR_CHAN_REG(REG_C0C, n)); /* Load the counter from PR0 */ | 476 | outw(0x8000, ADDR_CHAN_REG(REG_C0C, n)); |
477 | /* Load the counter from PR0 */ | ||
478 | outw(0x4000, ADDR_CHAN_REG(REG_C0C, n)); | ||
471 | } | 479 | } |
472 | 480 | ||
473 | outw(cmReg.value, ADDR_CHAN_REG(REG_C0M, n)); | 481 | outw(cmReg.value, ADDR_CHAN_REG(REG_C0M, n)); |
474 | udelay(1000); | 482 | udelay(1000); |
475 | printk("Read back mode reg=0x%04x\n", inw(ADDR_CHAN_REG(REG_C0M, n))); | 483 | printk(KERN_INFO "Read back mode reg=0x%04x\n", |
484 | inw(ADDR_CHAN_REG(REG_C0M, n))); | ||
476 | 485 | ||
477 | #endif | 486 | #endif |
478 | printk("Current registres:\n"); | 487 | printk(KERN_INFO "Current registres:\n"); |
479 | 488 | ||
480 | for (i = 0; i < S526_NUM_PORTS; i++) { | 489 | for (i = 0; i < S526_NUM_PORTS; i++) { |
481 | printk("0x%02lx: 0x%04x\n", ADDR_REG(s526_ports[i]), | 490 | printk(KERN_INFO "0x%02lx: 0x%04x\n", |
482 | inw(ADDR_REG(s526_ports[i]))); | 491 | ADDR_REG(s526_ports[i]), inw(ADDR_REG(s526_ports[i]))); |
483 | } | 492 | } |
484 | return 1; | 493 | return 1; |
485 | } | 494 | } |
@@ -494,7 +503,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it) | |||
494 | */ | 503 | */ |
495 | static int s526_detach(struct comedi_device *dev) | 504 | static int s526_detach(struct comedi_device *dev) |
496 | { | 505 | { |
497 | printk("comedi%d: s526: remove\n", dev->minor); | 506 | printk(KERN_INFO "comedi%d: s526: remove\n", dev->minor); |
498 | 507 | ||
499 | if (dev->iobase > 0) | 508 | if (dev->iobase > 0) |
500 | release_region(dev->iobase, S526_IOSIZE); | 509 | release_region(dev->iobase, S526_IOSIZE); |
@@ -513,7 +522,7 @@ static int s526_gpct_rinsn(struct comedi_device *dev, | |||
513 | 522 | ||
514 | /* Check if (n > 0) */ | 523 | /* Check if (n > 0) */ |
515 | if (insn->n <= 0) { | 524 | if (insn->n <= 0) { |
516 | printk("s526: INSN_READ: n should be > 0\n"); | 525 | printk(KERN_ERR "s526: INSN_READ: n should be > 0\n"); |
517 | return -EINVAL; | 526 | return -EINVAL; |
518 | } | 527 | } |
519 | /* Read the low word first */ | 528 | /* Read the low word first */ |
@@ -522,7 +531,8 @@ static int s526_gpct_rinsn(struct comedi_device *dev, | |||
522 | datahigh = inw(ADDR_CHAN_REG(REG_C0H, counter_channel)); | 531 | datahigh = inw(ADDR_CHAN_REG(REG_C0H, counter_channel)); |
523 | data[i] = (int)(datahigh & 0x00FF); | 532 | data[i] = (int)(datahigh & 0x00FF); |
524 | data[i] = (data[i] << 16) | (datalow & 0xFFFF); | 533 | data[i] = (data[i] << 16) | (datalow & 0xFFFF); |
525 | /* printk("s526 GPCT[%d]: %x(0x%04x, 0x%04x)\n", counter_channel, data[i], datahigh, datalow); */ | 534 | /* printk("s526 GPCT[%d]: %x(0x%04x, 0x%04x)\n", |
535 | counter_channel, data[i], datahigh, datalow); */ | ||
526 | } | 536 | } |
527 | return i; | 537 | return i; |
528 | } | 538 | } |
@@ -536,7 +546,8 @@ static int s526_gpct_insn_config(struct comedi_device *dev, | |||
536 | short value; | 546 | short value; |
537 | union cmReg cmReg; | 547 | union cmReg cmReg; |
538 | 548 | ||
539 | /* printk("s526: GPCT_INSN_CONFIG: Configuring Channel %d\n", subdev_channel); */ | 549 | /* printk("s526: GPCT_INSN_CONFIG: Configuring Channel %d\n", |
550 | subdev_channel); */ | ||
540 | 551 | ||
541 | for (i = 0; i < MAX_GPCT_CONFIG_DATA; i++) { | 552 | for (i = 0; i < MAX_GPCT_CONFIG_DATA; i++) { |
542 | devpriv->s526_gpct_config[subdev_channel].data[i] = | 553 | devpriv->s526_gpct_config[subdev_channel].data[i] = |
@@ -554,7 +565,7 @@ static int s526_gpct_insn_config(struct comedi_device *dev, | |||
554 | data[2]: Pre-load Register Value | 565 | data[2]: Pre-load Register Value |
555 | data[3]: Conter Control Register | 566 | data[3]: Conter Control Register |
556 | */ | 567 | */ |
557 | printk("s526: GPCT_INSN_CONFIG: Configuring Encoder\n"); | 568 | printk(KERN_INFO "s526: GPCT_INSN_CONFIG: Configuring Encoder\n"); |
558 | devpriv->s526_gpct_config[subdev_channel].app = | 569 | devpriv->s526_gpct_config[subdev_channel].app = |
559 | PositionMeasurement; | 570 | PositionMeasurement; |
560 | 571 | ||
@@ -563,7 +574,7 @@ static int s526_gpct_insn_config(struct comedi_device *dev, | |||
563 | /* One-shot (software trigger) */ | 574 | /* One-shot (software trigger) */ |
564 | cmReg.reg.coutSource = 0; /* out RCAP */ | 575 | cmReg.reg.coutSource = 0; /* out RCAP */ |
565 | cmReg.reg.coutPolarity = 1; /* Polarity inverted */ | 576 | cmReg.reg.coutPolarity = 1; /* Polarity inverted */ |
566 | cmReg.reg.autoLoadResetRcap = 0; /* Auto load disabled */ | 577 | cmReg.reg.autoLoadResetRcap = 0;/* Auto load disabled */ |
567 | cmReg.reg.hwCtEnableSource = 3; /* NOT RCAP */ | 578 | cmReg.reg.hwCtEnableSource = 3; /* NOT RCAP */ |
568 | cmReg.reg.ctEnableCtrl = 2; /* Hardware */ | 579 | cmReg.reg.ctEnableCtrl = 2; /* Hardware */ |
569 | cmReg.reg.clockSource = 2; /* Internal */ | 580 | cmReg.reg.clockSource = 2; /* Internal */ |
@@ -578,10 +589,13 @@ static int s526_gpct_insn_config(struct comedi_device *dev, | |||
578 | outw(0x0001, ADDR_CHAN_REG(REG_C0H, subdev_channel)); | 589 | outw(0x0001, ADDR_CHAN_REG(REG_C0H, subdev_channel)); |
579 | outw(0x3C68, ADDR_CHAN_REG(REG_C0L, subdev_channel)); | 590 | outw(0x3C68, ADDR_CHAN_REG(REG_C0L, subdev_channel)); |
580 | 591 | ||
581 | outw(0x8000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); /* Reset the counter */ | 592 | /* Reset the counter */ |
582 | outw(0x4000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); /* Load the counter from PR0 */ | 593 | outw(0x8000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); |
594 | /* Load the counter from PR0 */ | ||
595 | outw(0x4000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); | ||
583 | 596 | ||
584 | outw(0x0008, ADDR_CHAN_REG(REG_C0C, subdev_channel)); /* Reset RCAP (fires one-shot) */ | 597 | /* Reset RCAP (fires one-shot) */ |
598 | outw(0x0008, ADDR_CHAN_REG(REG_C0C, subdev_channel)); | ||
585 | 599 | ||
586 | #endif | 600 | #endif |
587 | 601 | ||
@@ -594,30 +608,34 @@ static int s526_gpct_insn_config(struct comedi_device *dev, | |||
594 | 608 | ||
595 | /* Reset the counter if it is software preload */ | 609 | /* Reset the counter if it is software preload */ |
596 | if (cmReg.reg.autoLoadResetRcap == 0) { | 610 | if (cmReg.reg.autoLoadResetRcap == 0) { |
597 | outw(0x8000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); /* Reset the counter */ | 611 | /* Reset the counter */ |
598 | /* outw(0x4000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); Load the counter from PR0 */ | 612 | outw(0x8000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); |
613 | /* Load the counter from PR0 | ||
614 | * outw(0x4000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); | ||
615 | */ | ||
599 | } | 616 | } |
600 | #else | 617 | #else |
601 | cmReg.reg.countDirCtrl = 0; /* 0 quadrature, 1 software control */ | 618 | /* 0 quadrature, 1 software control */ |
619 | cmReg.reg.countDirCtrl = 0; | ||
602 | 620 | ||
603 | /* data[1] contains GPCT_X1, GPCT_X2 or GPCT_X4 */ | 621 | /* data[1] contains GPCT_X1, GPCT_X2 or GPCT_X4 */ |
604 | if (insn->data[1] == GPCT_X2) { | 622 | if (insn->data[1] == GPCT_X2) |
605 | cmReg.reg.clockSource = 1; | 623 | cmReg.reg.clockSource = 1; |
606 | } else if (insn->data[1] == GPCT_X4) { | 624 | else if (insn->data[1] == GPCT_X4) |
607 | cmReg.reg.clockSource = 2; | 625 | cmReg.reg.clockSource = 2; |
608 | } else { | 626 | else |
609 | cmReg.reg.clockSource = 0; | 627 | cmReg.reg.clockSource = 0; |
610 | } | ||
611 | 628 | ||
612 | /* When to take into account the indexpulse: */ | 629 | /* When to take into account the indexpulse: */ |
613 | if (insn->data[2] == GPCT_IndexPhaseLowLow) { | 630 | /*if (insn->data[2] == GPCT_IndexPhaseLowLow) { |
614 | } else if (insn->data[2] == GPCT_IndexPhaseLowHigh) { | 631 | } else if (insn->data[2] == GPCT_IndexPhaseLowHigh) { |
615 | } else if (insn->data[2] == GPCT_IndexPhaseHighLow) { | 632 | } else if (insn->data[2] == GPCT_IndexPhaseHighLow) { |
616 | } else if (insn->data[2] == GPCT_IndexPhaseHighHigh) { | 633 | } else if (insn->data[2] == GPCT_IndexPhaseHighHigh) { |
617 | } | 634 | }*/ |
618 | /* Take into account the index pulse? */ | 635 | /* Take into account the index pulse? */ |
619 | if (insn->data[3] == GPCT_RESET_COUNTER_ON_INDEX) | 636 | if (insn->data[3] == GPCT_RESET_COUNTER_ON_INDEX) |
620 | cmReg.reg.autoLoadResetRcap = 4; /* Auto load with INDEX^ */ | 637 | /* Auto load with INDEX^ */ |
638 | cmReg.reg.autoLoadResetRcap = 4; | ||
621 | 639 | ||
622 | /* Set Counter Mode Register */ | 640 | /* Set Counter Mode Register */ |
623 | cmReg.value = (short)(insn->data[1] & 0xFFFF); | 641 | cmReg.value = (short)(insn->data[1] & 0xFFFF); |
@@ -638,8 +656,10 @@ static int s526_gpct_insn_config(struct comedi_device *dev, | |||
638 | } | 656 | } |
639 | /* Reset the counter if it is software preload */ | 657 | /* Reset the counter if it is software preload */ |
640 | if (cmReg.reg.autoLoadResetRcap == 0) { | 658 | if (cmReg.reg.autoLoadResetRcap == 0) { |
641 | outw(0x8000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); /* Reset the counter */ | 659 | /* Reset the counter */ |
642 | outw(0x4000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); /* Load the counter from PR0 */ | 660 | outw(0x8000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); |
661 | /* Load the counter from PR0 */ | ||
662 | outw(0x4000, ADDR_CHAN_REG(REG_C0C, subdev_channel)); | ||
643 | } | 663 | } |
644 | #endif | 664 | #endif |
645 | break; | 665 | break; |
@@ -652,7 +672,7 @@ static int s526_gpct_insn_config(struct comedi_device *dev, | |||
652 | data[3]: Pre-load Register 1 Value | 672 | data[3]: Pre-load Register 1 Value |
653 | data[4]: Conter Control Register | 673 | data[4]: Conter Control Register |
654 | */ | 674 | */ |
655 | printk("s526: GPCT_INSN_CONFIG: Configuring SPG\n"); | 675 | printk(KERN_INFO "s526: GPCT_INSN_CONFIG: Configuring SPG\n"); |
656 | devpriv->s526_gpct_config[subdev_channel].app = | 676 | devpriv->s526_gpct_config[subdev_channel].app = |
657 | SinglePulseGeneration; | 677 | SinglePulseGeneration; |
658 | 678 | ||
@@ -697,7 +717,7 @@ static int s526_gpct_insn_config(struct comedi_device *dev, | |||
697 | data[3]: Pre-load Register 1 Value | 717 | data[3]: Pre-load Register 1 Value |
698 | data[4]: Conter Control Register | 718 | data[4]: Conter Control Register |
699 | */ | 719 | */ |
700 | printk("s526: GPCT_INSN_CONFIG: Configuring PTG\n"); | 720 | printk(KERN_INFO "s526: GPCT_INSN_CONFIG: Configuring PTG\n"); |
701 | devpriv->s526_gpct_config[subdev_channel].app = | 721 | devpriv->s526_gpct_config[subdev_channel].app = |
702 | PulseTrainGeneration; | 722 | PulseTrainGeneration; |
703 | 723 | ||
@@ -735,7 +755,7 @@ static int s526_gpct_insn_config(struct comedi_device *dev, | |||
735 | break; | 755 | break; |
736 | 756 | ||
737 | default: | 757 | default: |
738 | printk("s526: unsupported GPCT_insn_config\n"); | 758 | printk(KERN_ERR "s526: unsupported GPCT_insn_config\n"); |
739 | return -EINVAL; | 759 | return -EINVAL; |
740 | break; | 760 | break; |
741 | } | 761 | } |
@@ -751,20 +771,21 @@ static int s526_gpct_winsn(struct comedi_device *dev, | |||
751 | short value; | 771 | short value; |
752 | union cmReg cmReg; | 772 | union cmReg cmReg; |
753 | 773 | ||
754 | printk("s526: GPCT_INSN_WRITE on channel %d\n", subdev_channel); | 774 | printk(KERN_INFO "s526: GPCT_INSN_WRITE on channel %d\n", |
775 | subdev_channel); | ||
755 | cmReg.value = inw(ADDR_CHAN_REG(REG_C0M, subdev_channel)); | 776 | cmReg.value = inw(ADDR_CHAN_REG(REG_C0M, subdev_channel)); |
756 | printk("s526: Counter Mode Register: %x\n", cmReg.value); | 777 | printk(KERN_INFO "s526: Counter Mode Register: %x\n", cmReg.value); |
757 | /* Check what Application of Counter this channel is configured for */ | 778 | /* Check what Application of Counter this channel is configured for */ |
758 | switch (devpriv->s526_gpct_config[subdev_channel].app) { | 779 | switch (devpriv->s526_gpct_config[subdev_channel].app) { |
759 | case PositionMeasurement: | 780 | case PositionMeasurement: |
760 | printk("S526: INSN_WRITE: PM\n"); | 781 | printk(KERN_INFO "S526: INSN_WRITE: PM\n"); |
761 | outw(0xFFFF & ((*data) >> 16), ADDR_CHAN_REG(REG_C0H, | 782 | outw(0xFFFF & ((*data) >> 16), ADDR_CHAN_REG(REG_C0H, |
762 | subdev_channel)); | 783 | subdev_channel)); |
763 | outw(0xFFFF & (*data), ADDR_CHAN_REG(REG_C0L, subdev_channel)); | 784 | outw(0xFFFF & (*data), ADDR_CHAN_REG(REG_C0L, subdev_channel)); |
764 | break; | 785 | break; |
765 | 786 | ||
766 | case SinglePulseGeneration: | 787 | case SinglePulseGeneration: |
767 | printk("S526: INSN_WRITE: SPG\n"); | 788 | printk(KERN_INFO "S526: INSN_WRITE: SPG\n"); |
768 | outw(0xFFFF & ((*data) >> 16), ADDR_CHAN_REG(REG_C0H, | 789 | outw(0xFFFF & ((*data) >> 16), ADDR_CHAN_REG(REG_C0H, |
769 | subdev_channel)); | 790 | subdev_channel)); |
770 | outw(0xFFFF & (*data), ADDR_CHAN_REG(REG_C0L, subdev_channel)); | 791 | outw(0xFFFF & (*data), ADDR_CHAN_REG(REG_C0L, subdev_channel)); |
@@ -777,14 +798,14 @@ static int s526_gpct_winsn(struct comedi_device *dev, | |||
777 | The above periods must be expressed as a multiple of the | 798 | The above periods must be expressed as a multiple of the |
778 | pulse frequency on the selected source | 799 | pulse frequency on the selected source |
779 | */ | 800 | */ |
780 | printk("S526: INSN_WRITE: PTG\n"); | 801 | printk(KERN_INFO "S526: INSN_WRITE: PTG\n"); |
781 | if ((insn->data[1] > insn->data[0]) && (insn->data[0] > 0)) { | 802 | if ((insn->data[1] > insn->data[0]) && (insn->data[0] > 0)) { |
782 | (devpriv->s526_gpct_config[subdev_channel]).data[0] = | 803 | (devpriv->s526_gpct_config[subdev_channel]).data[0] = |
783 | insn->data[0]; | 804 | insn->data[0]; |
784 | (devpriv->s526_gpct_config[subdev_channel]).data[1] = | 805 | (devpriv->s526_gpct_config[subdev_channel]).data[1] = |
785 | insn->data[1]; | 806 | insn->data[1]; |
786 | } else { | 807 | } else { |
787 | printk("s526: INSN_WRITE: PTG: Problem with Pulse params -> %d %d\n", | 808 | printk(KERN_ERR "s526: INSN_WRITE: PTG: Problem with Pulse params -> %d %d\n", |
788 | insn->data[0], insn->data[1]); | 809 | insn->data[0], insn->data[1]); |
789 | return -EINVAL; | 810 | return -EINVAL; |
790 | } | 811 | } |
@@ -873,7 +894,7 @@ static int s526_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, | |||
873 | if (i == TIMEOUT) { | 894 | if (i == TIMEOUT) { |
874 | /* printk() should be used instead of printk() | 895 | /* printk() should be used instead of printk() |
875 | * whenever the code can be called from real-time. */ | 896 | * whenever the code can be called from real-time. */ |
876 | printk("s526: ADC(0x%04x) timeout\n", | 897 | printk(KERN_ERR "s526: ADC(0x%04x) timeout\n", |
877 | inw(ADDR_REG(REG_ISR))); | 898 | inw(ADDR_REG(REG_ISR))); |
878 | return -ETIMEDOUT; | 899 | return -ETIMEDOUT; |
879 | } | 900 | } |
@@ -906,11 +927,14 @@ static int s526_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s, | |||
906 | * very useful, but that's how the interface is defined. */ | 927 | * very useful, but that's how the interface is defined. */ |
907 | for (i = 0; i < insn->n; i++) { | 928 | for (i = 0; i < insn->n; i++) { |
908 | /* a typical programming sequence */ | 929 | /* a typical programming sequence */ |
909 | /* outw(data[i], dev->iobase + REG_ADD); write the data to preload register */ | 930 | /* write the data to preload register |
910 | outw(data[i], ADDR_REG(REG_ADD)); /* write the data to preload register */ | 931 | * outw(data[i], dev->iobase + REG_ADD); |
932 | */ | ||
933 | /* write the data to preload register */ | ||
934 | outw(data[i], ADDR_REG(REG_ADD)); | ||
911 | devpriv->ao_readback[chan] = data[i]; | 935 | devpriv->ao_readback[chan] = data[i]; |
912 | /* outw(val + 1, dev->iobase + REG_DAC); starts the D/A conversion. */ | 936 | /* outw(val + 1, dev->iobase + REG_DAC); starts the D/A conversion. */ |
913 | outw(val + 1, ADDR_REG(REG_DAC)); /* starts the D/A conversion. */ | 937 | outw(val + 1, ADDR_REG(REG_DAC)); /*starts the D/A conversion.*/ |
914 | } | 938 | } |
915 | 939 | ||
916 | /* return the number of samples read/written */ | 940 | /* return the number of samples read/written */ |
@@ -954,7 +978,7 @@ static int s526_dio_insn_bits(struct comedi_device *dev, | |||
954 | 978 | ||
955 | /* on return, data[1] contains the value of the digital | 979 | /* on return, data[1] contains the value of the digital |
956 | * input and output lines. */ | 980 | * input and output lines. */ |
957 | data[1] = inw(ADDR_REG(REG_DIO)) & 0xFF; /* low 8 bits are the data */ | 981 | data[1] = inw(ADDR_REG(REG_DIO)) & 0xFF; /* low 8 bits are the data */ |
958 | /* or we could just return the software copy of the output values if | 982 | /* or we could just return the software copy of the output values if |
959 | * it was a purely digital output subdevice */ | 983 | * it was a purely digital output subdevice */ |
960 | /* data[1]=s->state & 0xFF; */ | 984 | /* data[1]=s->state & 0xFF; */ |
@@ -969,7 +993,7 @@ static int s526_dio_insn_config(struct comedi_device *dev, | |||
969 | int chan = CR_CHAN(insn->chanspec); | 993 | int chan = CR_CHAN(insn->chanspec); |
970 | int group, mask; | 994 | int group, mask; |
971 | 995 | ||
972 | printk("S526 DIO insn_config\n"); | 996 | printk(KERN_INFO "S526 DIO insn_config\n"); |
973 | 997 | ||
974 | /* The input or output configuration of each digital line is | 998 | /* The input or output configuration of each digital line is |
975 | * configured by a special insn_config instruction. chanspec | 999 | * configured by a special insn_config instruction. chanspec |
@@ -980,11 +1004,12 @@ static int s526_dio_insn_config(struct comedi_device *dev, | |||
980 | mask = 0xF << (group << 2); | 1004 | mask = 0xF << (group << 2); |
981 | switch (data[0]) { | 1005 | switch (data[0]) { |
982 | case INSN_CONFIG_DIO_OUTPUT: | 1006 | case INSN_CONFIG_DIO_OUTPUT: |
983 | s->state |= 1 << (group + 10); // bit 10/11 set the group 1/2's mode | 1007 | /* bit 10/11 set the group 1/2's mode */ |
1008 | s->state |= 1 << (group + 10); | ||
984 | s->io_bits |= mask; | 1009 | s->io_bits |= mask; |
985 | break; | 1010 | break; |
986 | case INSN_CONFIG_DIO_INPUT: | 1011 | case INSN_CONFIG_DIO_INPUT: |
987 | s->state &= ~(1 << (group + 10));// 1 is output, 0 is input. | 1012 | s->state &= ~(1 << (group + 10)); /* 1 is output, 0 is input. */ |
988 | s->io_bits &= ~mask; | 1013 | s->io_bits &= ~mask; |
989 | break; | 1014 | break; |
990 | case INSN_CONFIG_DIO_QUERY: | 1015 | case INSN_CONFIG_DIO_QUERY: |