mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: driverdev-devel@linuxdriverproject.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ian Abbott <abbotti@mev.co.uk>,
	H Hartley Sweeten <hartleys@visionengravers.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 01/18] staging: comedi: amplc_pci224: reformat some comments
Date: Thu, 31 Jul 2014 14:47:38 +0100	[thread overview]
Message-ID: <1406814475-5923-2-git-send-email-abbotti@mev.co.uk> (raw)
In-Reply-To: <1406814475-5923-1-git-send-email-abbotti@mev.co.uk>

Reformat comments to fit in with the preferred coding style, including
the copyright and comedi driver description comments at the start of the
file.  Also, remove a boiler-plate comment for the comedi device private
data structure.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 drivers/staging/comedi/drivers/amplc_pci224.c | 214 +++++++++++++-------------
 1 file changed, 109 insertions(+), 105 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c b/drivers/staging/comedi/drivers/amplc_pci224.c
index 45aba1f..72506bf 100644
--- a/drivers/staging/comedi/drivers/amplc_pci224.c
+++ b/drivers/staging/comedi/drivers/amplc_pci224.c
@@ -1,102 +1,103 @@
 /*
-    comedi/drivers/amplc_pci224.c
-    Driver for Amplicon PCI224 and PCI234 AO boards.
-
-    Copyright (C) 2005 MEV Ltd. <http://www.mev.co.uk/>
-
-    COMEDI - Linux Control and Measurement Device Interface
-    Copyright (C) 1998,2000 David A. Schleef <ds@schleef.org>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
+ * comedi/drivers/amplc_pci224.c
+ * Driver for Amplicon PCI224 and PCI234 AO boards.
+ *
+ * Copyright (C) 2005 MEV Ltd. <http://www.mev.co.uk/>
+ *
+ * COMEDI - Linux Control and Measurement Device Interface
+ * Copyright (C) 1998,2000 David A. Schleef <ds@schleef.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
 
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-*/
 /*
-Driver: amplc_pci224
-Description: Amplicon PCI224, PCI234
-Author: Ian Abbott <abbotti@mev.co.uk>
-Devices: [Amplicon] PCI224 (amplc_pci224 or pci224),
-  PCI234 (amplc_pci224 or pci234)
-Updated: Wed, 22 Oct 2008 12:25:08 +0100
-Status: works, but see caveats
-
-Supports:
-
-  - ao_insn read/write
-  - ao_do_cmd mode with the following sources:
-
-    - start_src         TRIG_INT        TRIG_EXT
-    - scan_begin_src    TRIG_TIMER      TRIG_EXT
-    - convert_src       TRIG_NOW
-    - scan_end_src      TRIG_COUNT
-    - stop_src          TRIG_COUNT      TRIG_EXT        TRIG_NONE
-
-    The channel list must contain at least one channel with no repeated
-    channels.  The scan end count must equal the number of channels in
-    the channel list.
-
-    There is only one external trigger source so only one of start_src,
-    scan_begin_src or stop_src may use TRIG_EXT.
-
-Configuration options - PCI224:
-  [0] - PCI bus of device (optional).
-  [1] - PCI slot of device (optional).
-          If bus/slot is not specified, the first available PCI device
-          will be used.
-  [2] - Select available ranges according to jumper LK1.  All channels
-        are set to the same range:
-        0=Jumper position 1-2 (factory default), 4 software-selectable
-          internal voltage references, giving 4 bipolar and 4 unipolar
-          ranges:
-            [-10V,+10V], [-5V,+5V], [-2.5V,+2.5V], [-1.25V,+1.25V],
-            [0,+10V], [0,+5V], [0,+2.5V], [0,1.25V].
-        1=Jumper position 2-3, 1 external voltage reference, giving
-          1 bipolar and 1 unipolar range:
-            [-Vext,+Vext], [0,+Vext].
-
-Configuration options - PCI234:
-  [0] - PCI bus of device (optional).
-  [1] - PCI slot of device (optional).
-          If bus/slot is not specified, the first available PCI device
-          will be used.
-  [2] - Select internal or external voltage reference according to
-        jumper LK1.  This affects all channels:
-        0=Jumper position 1-2 (factory default), Vref=5V internal.
-        1=Jumper position 2-3, Vref=Vext external.
-  [3] - Select channel 0 range according to jumper LK2:
-        0=Jumper position 2-3 (factory default), range [-2*Vref,+2*Vref]
-          (10V bipolar when options[2]=0).
-        1=Jumper position 1-2, range [-Vref,+Vref]
-          (5V bipolar when options[2]=0).
-  [4] - Select channel 1 range according to jumper LK3: cf. options[3].
-  [5] - Select channel 2 range according to jumper LK4: cf. options[3].
-  [6] - Select channel 3 range according to jumper LK5: cf. options[3].
-
-Passing a zero for an option is the same as leaving it unspecified.
-
-Caveats:
-
-  1) All channels on the PCI224 share the same range.  Any change to the
-     range as a result of insn_write or a streaming command will affect
-     the output voltages of all channels, including those not specified
-     by the instruction or command.
-
-  2) For the analog output command,  the first scan may be triggered
-     falsely at the start of acquisition.  This occurs when the DAC scan
-     trigger source is switched from 'none' to 'timer' (scan_begin_src =
-     TRIG_TIMER) or 'external' (scan_begin_src == TRIG_EXT) at the start
-     of acquisition and the trigger source is at logic level 1 at the
-     time of the switch.  This is very likely for TRIG_TIMER.  For
-     TRIG_EXT, it depends on the state of the external line and whether
-     the CR_INVERT flag has been set.  The remaining scans are triggered
-     correctly.
-*/
+ * Driver: amplc_pci224
+ * Description: Amplicon PCI224, PCI234
+ * Author: Ian Abbott <abbotti@mev.co.uk>
+ * Devices: [Amplicon] PCI224 (amplc_pci224 or pci224),
+ *   PCI234 (amplc_pci224 or pci234)
+ * Updated: Wed, 22 Oct 2008 12:25:08 +0100
+ * Status: works, but see caveats
+ *
+ * Supports:
+ *
+ *   - ao_insn read/write
+ *   - ao_do_cmd mode with the following sources:
+ *
+ *     - start_src         TRIG_INT        TRIG_EXT
+ *     - scan_begin_src    TRIG_TIMER      TRIG_EXT
+ *     - convert_src       TRIG_NOW
+ *     - scan_end_src      TRIG_COUNT
+ *     - stop_src          TRIG_COUNT      TRIG_EXT        TRIG_NONE
+ *
+ *     The channel list must contain at least one channel with no repeated
+ *     channels.  The scan end count must equal the number of channels in
+ *     the channel list.
+ *
+ *     There is only one external trigger source so only one of start_src,
+ *     scan_begin_src or stop_src may use TRIG_EXT.
+ *
+ * Configuration options - PCI224:
+ *   [0] - PCI bus of device (optional).
+ *   [1] - PCI slot of device (optional).
+ *           If bus/slot is not specified, the first available PCI device
+ *           will be used.
+ *   [2] - Select available ranges according to jumper LK1.  All channels
+ *         are set to the same range:
+ *         0=Jumper position 1-2 (factory default), 4 software-selectable
+ *           internal voltage references, giving 4 bipolar and 4 unipolar
+ *           ranges:
+ *             [-10V,+10V], [-5V,+5V], [-2.5V,+2.5V], [-1.25V,+1.25V],
+ *             [0,+10V], [0,+5V], [0,+2.5V], [0,1.25V].
+ *         1=Jumper position 2-3, 1 external voltage reference, giving
+ *           1 bipolar and 1 unipolar range:
+ *             [-Vext,+Vext], [0,+Vext].
+ *
+ * Configuration options - PCI234:
+ *   [0] - PCI bus of device (optional).
+ *   [1] - PCI slot of device (optional).
+ *           If bus/slot is not specified, the first available PCI device
+ *           will be used.
+ *   [2] - Select internal or external voltage reference according to
+ *         jumper LK1.  This affects all channels:
+ *         0=Jumper position 1-2 (factory default), Vref=5V internal.
+ *         1=Jumper position 2-3, Vref=Vext external.
+ *   [3] - Select channel 0 range according to jumper LK2:
+ *         0=Jumper position 2-3 (factory default), range [-2*Vref,+2*Vref]
+ *           (10V bipolar when options[2]=0).
+ *         1=Jumper position 1-2, range [-Vref,+Vref]
+ *           (5V bipolar when options[2]=0).
+ *   [4] - Select channel 1 range according to jumper LK3: cf. options[3].
+ *   [5] - Select channel 2 range according to jumper LK4: cf. options[3].
+ *   [6] - Select channel 3 range according to jumper LK5: cf. options[3].
+ *
+ * Passing a zero for an option is the same as leaving it unspecified.
+ *
+ * Caveats:
+ *
+ *   1) All channels on the PCI224 share the same range.  Any change to the
+ *      range as a result of insn_write or a streaming command will affect
+ *      the output voltages of all channels, including those not specified
+ *      by the instruction or command.
+ *
+ *   2) For the analog output command,  the first scan may be triggered
+ *      falsely at the start of acquisition.  This occurs when the DAC scan
+ *      trigger source is switched from 'none' to 'timer' (scan_begin_src =
+ *      TRIG_TIMER) or 'external' (scan_begin_src == TRIG_EXT) at the start
+ *      of acquisition and the trigger source is at logic level 1 at the
+ *      time of the switch.  This is very likely for TRIG_TIMER.  For
+ *      TRIG_EXT, it depends on the state of the external line and whether
+ *      the CR_INVERT flag has been set.  The remaining scans are triggered
+ *      correctly.
+ */
 
 #include <linux/module.h>
 #include <linux/pci.h>
@@ -299,16 +300,20 @@ static const unsigned short hwrange_pci224_external[2] = {
 	PCI224_DACCON_POLAR_UNI,
 };
 
-/* The hardware selectable Vref*2 external range for PCI234
- * (option[2] == 1, option[3+n] == 0). */
+/*
+ * The hardware selectable Vref*2 external range for PCI234
+ * (option[2] == 1, option[3+n] == 0).
+ */
 static const struct comedi_lrange range_pci234_ext2 = {
 	1, {
 		RANGE_ext(-2, 2)
 	}
 };
 
-/* The hardware selectable Vref external range for PCI234
- * (option[2] == 1, option[3+n] == 1). */
+/*
+ * The hardware selectable Vref external range for PCI234
+ * (option[2] == 1, option[3+n] == 1).
+ */
 static const struct comedi_lrange range_pci234_ext = {
 	1, {
 		RANGE_ext(-1, 1)
@@ -356,9 +361,6 @@ static const struct pci224_board pci224_boards[] = {
 	 },
 };
 
-/* this structure is for data unique to this hardware driver.  If
-   several hardware drivers keep similar information in this structure,
-   feel free to suggest moving the variable to the struct comedi_device struct.  */
 struct pci224_private {
 	const unsigned short *hwrange;
 	unsigned long iobase1;
@@ -428,8 +430,10 @@ pci224_ao_insn_write(struct comedi_device *dev, struct comedi_subdevice *s,
 	chan = CR_CHAN(insn->chanspec);
 	range = CR_RANGE(insn->chanspec);
 
-	/* Writing a list of values to an AO channel is probably not
-	 * very useful, but that's how the interface is defined. */
+	/*
+	 * Writing a list of values to an AO channel is probably not
+	 * very useful, but that's how the interface is defined.
+	 */
 	for (i = 0; i < insn->n; i++)
 		pci224_ao_set_data(dev, chan, range, data[i]);
 
-- 
2.0.0


  reply	other threads:[~2014-07-31 13:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-31 13:47 [PATCH 00/18] staging: comedi: amplc_pci224: remove legacy stuff Ian Abbott
2014-07-31 13:47 ` Ian Abbott [this message]
2014-07-31 13:47 ` [PATCH 02/18] staging: comedi: amplc_pci224: fix checkpatch line over 80 characters Ian Abbott
2014-07-31 13:47 ` [PATCH 03/18] staging: comedi: amplc_pci224: blank lines aren't necessary before a close brace '}' Ian Abbott
2014-07-31 13:47 ` [PATCH 04/18] staging: comedi: amplc_pci224: multiple assignments should be avoided Ian Abbott
2014-07-31 13:47 ` [PATCH 05/18] staging: comedi: amplc_pci224: fix spinlock_t definition without comment Ian Abbott
2014-07-31 13:47 ` [PATCH 06/18] staging: comedi: amplc_pci224: add whitespace to pci224_boards[] Ian Abbott
2014-07-31 13:47 ` [PATCH 07/18] staging: comedi: amplc_pci224: set a more descriptive MODULE_DESCRIPTION() Ian Abbott
2014-07-31 13:47 ` [PATCH 08/18] staging: comedi: amplc_pci224: omit '!= 0' from logical expressions Ian Abbott
2014-07-31 13:47 ` [PATCH 09/18] staging: comedi: amplc_pci224: remove some unnecessary parentheses Ian Abbott
2014-07-31 13:47 ` [PATCH 10/18] staging: comedi: amplc_pci224: reduce leading whitespace in a few places Ian Abbott
2014-07-31 13:47 ` [PATCH 11/18] staging: comedi: amplc_pci224: no need for '&function' Ian Abbott
2014-07-31 13:47 ` [PATCH 12/18] staging: comedi: amplc_pci224: remove options to select output ranges Ian Abbott
2014-07-31 13:47 ` [PATCH 13/18] staging: comedi: amplc_pci224: remove "legacy" attach mechanism Ian Abbott
2014-07-31 13:47 ` [PATCH 14/18] staging: comedi: amplc_pci224: no need to manipulate PCI ref count Ian Abbott
2014-07-31 13:47 ` [PATCH 15/18] staging: comedi: amplc_pci224: put board indices in PCI driver_data Ian Abbott
2014-07-31 13:47 ` [PATCH 16/18] staging: comedi: amplc_pci224: remove PCI_DEVICE_ID_... macros Ian Abbott
2014-07-31 13:47 ` [PATCH 17/18] staging: comedi: amplc_pci224: absorb pci224_attach_common() Ian Abbott
2014-07-31 13:47 ` [PATCH 18/18] staging: comedi: amplc_pci224: no need to comedi_set_hw_dev() here Ian Abbott
2014-07-31 20:28 ` [PATCH 00/18] staging: comedi: amplc_pci224: remove legacy stuff Hartley Sweeten
2014-07-31 20:44   ` Hartley Sweeten
2014-08-04 10:57   ` Ian Abbott
2014-08-04 11:14 ` [PATCH 15/18 v2] staging: comedi: amplc_pci224: put board indices in PCI driver_data Ian Abbott
2014-08-04 16:38   ` Hartley Sweeten

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1406814475-5923-2-git-send-email-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hartleys@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®