From: Ian Abbott Date: Thu, 31 Jul 2014 13:47:38 +0000 (+0100) Subject: staging: comedi: amplc_pci224: reformat some comments X-Git-Tag: v3.18-rc1~130^2~1393 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=53bd9a204816a3513c5fa3c6170fe33100bb3f4d;p=karo-tx-linux.git staging: comedi: amplc_pci224: reformat some comments 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 Reviewed-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/amplc_pci224.c b/drivers/staging/comedi/drivers/amplc_pci224.c index 45aba1f950fc..72506bf6aa1e 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. - - COMEDI - Linux Control and Measurement Device Interface - Copyright (C) 1998,2000 David A. Schleef - - 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. + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1998,2000 David A. Schleef + * + * 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 -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 + * 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 #include @@ -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]);