Staging: comedi: Use unsigned int instead of unsigned issue in pcmuio.c
PATCH 1/10 Staging: comedi: Use unsigned int instead of unsigned issue in pcmuio.c
This is a patch to the pcmuio.c file that fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool.
--- drivers/staging/comedi/drivers/pcmuio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/pcmuio.c +1 -1
@@ -307,7 +307,7 @@ static void pcmuio_stop_intr(struct comedi_device *dev,static void pcmuio_handle_intr_subdev (struct comedi_device *dev,struct comedi_subdevice *s, -unsigned triggered) +unsigned int triggered) {struct pcmuio_private *devpriv = dev->private;int asic =pcmuio_subdevice_to_asic (s);
Signature · 1 line
1.9.1
PATCH 2/10 Staging: comedi: fix bare use of unsigned issue in ni_65xx.c
This is a patch to the ni_65xx.c file that fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool
--- drivers/staging/comedi/drivers/ni_65xx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/staging/comedi/drivers/ni_65xx.c +9 -9
@@ -151,10 +151,10 @@ enum ni_65xx_boardid {struct ni_65xx_board {const char *name; -unsigned num_dio_ports; -unsigned num_di_ports; -unsigned num_do_ports; -unsigned legacy_invert:1 ; +unsigned int num_dio_ports; +unsigned int num_di_ports; +unsigned int num_do_ports; +unsigned int legacy_invert:1 ; };static const struct ni_65xx_board ni_65xx_boards[] = {
@@ -360,7 +360,7 @@ static int ni_65xx_dio_insn_config(struct comedi_device *dev,unsigned long base_port = (unsigned long )s->private;unsigned int chan =CR_CHAN (insn->chanspec);unsigned int chan_mask =NI_65XX_CHAN_TO_MASK (chan); -unsigned port = base_port +NI_65XX_CHAN_TO_PORT (chan); +unsigned int port = base_port +NI_65XX_CHAN_TO_PORT (chan);unsigned int interval;unsigned int val;
@@ -428,14 +428,14 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev,unsigned long base_port = (unsigned long )s->private;unsigned int base_chan =CR_CHAN (insn->chanspec);int last_port_offset =NI_65XX_CHAN_TO_PORT (s->n_chan -1 ); -unsigned read_bits =0 ; +unsigned int read_bits =0 ;int port_offset;for (port_offset =NI_65XX_CHAN_TO_PORT (base_chan); port_offset <= last_port_offset; port_offset++) { -unsigned port = base_port + port_offset; +unsigned int port = base_port + port_offset;int base_port_channel =NI_65XX_PORT_TO_CHAN (port_offset); -unsigned port_mask, port_data, bits; +unsigned int port_mask, port_data, bits;int bitshift = base_port_channel - base_chan;if (bitshift >=32 )
@@ -640,7 +640,7 @@ static int ni_65xx_auto_attach(struct comedi_device *dev,struct pci_dev *pcidev =comedi_to_pci_dev (dev);const struct ni_65xx_board *board =NULL ;struct comedi_subdevice *s; -unsigned i; +unsigned int i;int ret;if (context <ARRAY_SIZE (ni_65xx_boards))
Signature · 1 line
1.9.1
PATCH 3/10 Staging: comedi: Indentation issue in mpc624.c
In reply to Ravishankar Karkala MallikarjunayyaThis is a patch to the mpc624.c file that fixes up a
WARNING: 'Statements should start on a tabstop' found by the checkpatch.pl tool.
--- drivers/staging/comedi/drivers/mpc624.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/mpc624.c +2 -2
@@ -103,7 +103,7 @@ static const struct comedi_lrange range_mpc624_bipolar1 = {/* BIP_RANGE(1.01) this is correct, */ /* but my MPC-624 actually seems to have a range of 2.02 */ BIP_RANGE(2.02) - } + } };static const struct comedi_lrange range_mpc624_bipolar10 = {
@@ -112,7 +112,7 @@ static const struct comedi_lrange range_mpc624_bipolar10 = {/* BIP_RANGE(10.1) this is correct, */ /* but my MPC-624 actually seems to have a range of 20.2 */ BIP_RANGE(20.2) - } + } }; static unsigned int mpc624_ai_get_sample(struct comedi_device *dev,
Signature · 1 line
1.9.1
PATCH 4/10 Staging: comedi:Fix a warning issues in me_daq.c
In reply to Ravishankar Karkala MallikarjunayyaThis is a patch to the me_daq.c file that fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool.
--- drivers/staging/comedi/drivers/me_daq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/drivers/me_daq.c +1 -1
@@ -150,7 +150,7 @@ struct me_private_data {unsigned short dac_ctrl;/* Mirror of the DAC_CONTROL register */ }; -static inline void sleep (unsigned sec) +static inline void sleep (unsigned int sec) {schedule_timeout_interruptible (sec *HZ ); }
Signature · 1 line
1.9.1
PATCH 5/10 Staging: comedi: Fix comment issues in jr3_pci.c
In reply to Ravishankar Karkala MallikarjunayyaThis is a patch to the jr3_pci.c file that fixes up a
WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool.
--- drivers/staging/comedi/drivers/jr3_pci.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/staging/comedi/drivers/jr3_pci.c +16 -16
@@ -1,20 +1,20 @@/* -comedi/drivers/jr3_pci.c -hardware driver for JR3/PCI force sensor board - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 2007 Anders Blomdell <[email protected]> - -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. -*/ +* comedi/drivers/jr3_pci.c +* hardware driver for JR3/PCI force sensor board +* +* COMEDI - Linux Control and Measurement Device Interface +* Copyright (C) 2007 Anders Blomdell <[email protected]> +* +* 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. +*/ /* * Driver: jr3_pci * Description: JR3/PCI force sensor board
Signature · 1 line
1.9.1
PATCH 6/10 Staging: comedi: Prefer using the BIT macro issue in das16.c
In reply to Ravishankar Karkala MallikarjunayyaThis patch Replace all occurences of (1<<x) by BIT(x) in the file das16.c to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro"
--- drivers/staging/comedi/drivers/das16.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/staging/comedi/drivers/das16.c +16 -16
@@ -92,37 +92,37 @@#define DAS16_AO_LSB_REG (x) ((x) ? 0x06 : 0x04)#define DAS16_AO_MSB_REG (x) ((x) ? 0x07 : 0x05)#define DAS16_STATUS_REG 0x08 -#define DAS16_STATUS_BUSY (1 << 7) -#define DAS16_STATUS_UNIPOLAR (1 << 6) -#define DAS16_STATUS_MUXBIT (1 << 5) -#define DAS16_STATUS_INT (1 << 4) +#define DAS16_STATUS_BUSY BIT(7) +#define DAS16_STATUS_UNIPOLAR BIT(6) +#define DAS16_STATUS_MUXBIT BIT(5) +#define DAS16_STATUS_INT BIT(4)#define DAS16_CTRL_REG 0x09 -#define DAS16_CTRL_INTE (1 << 7) +#define DAS16_CTRL_INTE BIT(7)#define DAS16_CTRL_IRQ (x) (((x) & 0x7) << 4) -#define DAS16_CTRL_DMAE (1 << 2) +#define DAS16_CTRL_DMAE BIT(2)#define DAS16_CTRL_PACING_MASK (3 << 0)#define DAS16_CTRL_INT_PACER (3 << 0)#define DAS16_CTRL_EXT_PACER (2 << 0)#define DAS16_CTRL_SOFT_PACER (0 << 0)#define DAS16_PACER_REG 0x0a#define DAS16_PACER_BURST_LEN (x) (((x) & 0xf) << 4) -#define DAS16_PACER_CTR0 (1 << 1) -#define DAS16_PACER_TRIG0 (1 << 0) +#define DAS16_PACER_CTR0 BIT(1) +#define DAS16_PACER_TRIG0 BIT(0)#define DAS16_GAIN_REG 0x0b#define DAS16_TIMER_BASE_REG 0x0c/* to 0x0f */ #define DAS1600_CONV_REG 0x404 -#define DAS1600_CONV_DISABLE (1 << 6) +#define DAS1600_CONV_DISABLE BIT(6)#define DAS1600_BURST_REG 0x405 -#define DAS1600_BURST_VAL (1 << 6) +#define DAS1600_BURST_VAL BIT(6)#define DAS1600_ENABLE_REG 0x406 -#define DAS1600_ENABLE_VAL (1 << 6) +#define DAS1600_ENABLE_VAL BIT(6)#define DAS1600_STATUS_REG 0x407 -#define DAS1600_STATUS_BME (1 << 6) -#define DAS1600_STATUS_ME (1 << 5) -#define DAS1600_STATUS_CD (1 << 4) -#define DAS1600_STATUS_WS (1 << 1) -#define DAS1600_STATUS_CLK_10MHZ (1 << 0) +#define DAS1600_STATUS_BME BIT(6) +#define DAS1600_STATUS_ME BIT(5) +#define DAS1600_STATUS_CD BIT(4) +#define DAS1600_STATUS_WS BIT(1) +#define DAS1600_STATUS_CLK_10MHZ BIT(0)static const struct comedi_lrange range_das1x01_bip = {4 , {
Signature · 1 line
1.9.1
PATCH 6/10 Staging: comedi: Prefer using the BIT macro issue in das16.c
In reply to Ravishankar Karkala MallikarjunayyaThis patch Replace all occurences of (1<<x) by BIT(x) in the file das16.c to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro"
--- drivers/staging/comedi/drivers/das16.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/staging/comedi/drivers/das16.c +16 -16
@@ -92,37 +92,37 @@#define DAS16_AO_LSB_REG (x) ((x) ? 0x06 : 0x04)#define DAS16_AO_MSB_REG (x) ((x) ? 0x07 : 0x05)#define DAS16_STATUS_REG 0x08 -#define DAS16_STATUS_BUSY (1 << 7) -#define DAS16_STATUS_UNIPOLAR (1 << 6) -#define DAS16_STATUS_MUXBIT (1 << 5) -#define DAS16_STATUS_INT (1 << 4) +#define DAS16_STATUS_BUSY BIT(7) +#define DAS16_STATUS_UNIPOLAR BIT(6) +#define DAS16_STATUS_MUXBIT BIT(5) +#define DAS16_STATUS_INT BIT(4)#define DAS16_CTRL_REG 0x09 -#define DAS16_CTRL_INTE (1 << 7) +#define DAS16_CTRL_INTE BIT(7)#define DAS16_CTRL_IRQ (x) (((x) & 0x7) << 4) -#define DAS16_CTRL_DMAE (1 << 2) +#define DAS16_CTRL_DMAE BIT(2)#define DAS16_CTRL_PACING_MASK (3 << 0)#define DAS16_CTRL_INT_PACER (3 << 0)#define DAS16_CTRL_EXT_PACER (2 << 0)#define DAS16_CTRL_SOFT_PACER (0 << 0)#define DAS16_PACER_REG 0x0a#define DAS16_PACER_BURST_LEN (x) (((x) & 0xf) << 4) -#define DAS16_PACER_CTR0 (1 << 1) -#define DAS16_PACER_TRIG0 (1 << 0) +#define DAS16_PACER_CTR0 BIT(1) +#define DAS16_PACER_TRIG0 BIT(0)#define DAS16_GAIN_REG 0x0b#define DAS16_TIMER_BASE_REG 0x0c/* to 0x0f */ #define DAS1600_CONV_REG 0x404 -#define DAS1600_CONV_DISABLE (1 << 6) +#define DAS1600_CONV_DISABLE BIT(6)#define DAS1600_BURST_REG 0x405 -#define DAS1600_BURST_VAL (1 << 6) +#define DAS1600_BURST_VAL BIT(6)#define DAS1600_ENABLE_REG 0x406 -#define DAS1600_ENABLE_VAL (1 << 6) +#define DAS1600_ENABLE_VAL BIT(6)#define DAS1600_STATUS_REG 0x407 -#define DAS1600_STATUS_BME (1 << 6) -#define DAS1600_STATUS_ME (1 << 5) -#define DAS1600_STATUS_CD (1 << 4) -#define DAS1600_STATUS_WS (1 << 1) -#define DAS1600_STATUS_CLK_10MHZ (1 << 0) +#define DAS1600_STATUS_BME BIT(6) +#define DAS1600_STATUS_ME BIT(5) +#define DAS1600_STATUS_CD BIT(4) +#define DAS1600_STATUS_WS BIT(1) +#define DAS1600_STATUS_CLK_10MHZ BIT(0)static const struct comedi_lrange range_das1x01_bip = {4 , {
Signature · 1 line
1.9.1
PATCH 7/10 Staging: comedi: fix BIT macro issue in das6402.c
In reply to Ravishankar Karkala MallikarjunayyaThis patch Replace all occurences of (1<<x) by BIT(x) and DAS6402_CTRL_TRIG(x), DAS6402_MODE_RANGE(x), DAS6402_MODE_DMA(x) macros in the file das6402.c to get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro"
--- drivers/staging/comedi/drivers/das6402.c | 74 ++++++++++++++++---------------- 1 file changed, 38 insertions(+), 36 deletions(-)
drivers/staging/comedi/drivers/das6402.c +38 -36
@@ -50,48 +50,50 @@#define DAS6402_AO_LSB_REG (x) (0x04 + ((x) * 2))#define DAS6402_AO_MSB_REG (x) (0x05 + ((x) * 2))#define DAS6402_STATUS_REG 0x08 -#define DAS6402_STATUS_FFNE (1 << 0) -#define DAS6402_STATUS_FHALF (1 << 1) -#define DAS6402_STATUS_FFULL (1 << 2) -#define DAS6402_STATUS_XINT (1 << 3) -#define DAS6402_STATUS_INT (1 << 4) -#define DAS6402_STATUS_XTRIG (1 << 5) -#define DAS6402_STATUS_INDGT (1 << 6) -#define DAS6402_STATUS_10MHZ (1 << 7) -#define DAS6402_STATUS_W_CLRINT (1 << 0) -#define DAS6402_STATUS_W_CLRXTR (1 << 1) -#define DAS6402_STATUS_W_CLRXIN (1 << 2) -#define DAS6402_STATUS_W_EXTEND (1 << 4) -#define DAS6402_STATUS_W_ARMED (1 << 5) -#define DAS6402_STATUS_W_POSTMODE (1 << 6) -#define DAS6402_STATUS_W_10MHZ (1 << 7) +#define DAS6402_STATUS_FFNE BIT(0) +#define DAS6402_STATUS_FHALF BIT(1) +#define DAS6402_STATUS_FFULL BIT(2) +#define DAS6402_STATUS_XINT BIT(3) +#define DAS6402_STATUS_INT BIT(4) +#define DAS6402_STATUS_XTRIG BIT(5) +#define DAS6402_STATUS_INDGT BIT(6) +#define DAS6402_STATUS_10MHZ BIT(7) +#define DAS6402_STATUS_W_CLRINT BIT(0) +#define DAS6402_STATUS_W_CLRXTR BIT(1) +#define DAS6402_STATUS_W_CLRXIN BIT(2) +#define DAS6402_STATUS_W_EXTEND BIT(4) +#define DAS6402_STATUS_W_ARMED BIT(5) +#define DAS6402_STATUS_W_POSTMODE BIT(6) +#define DAS6402_STATUS_W_10MHZ BIT(7)#define DAS6402_CTRL_REG 0x09 -#define DAS6402_CTRL_SOFT_TRIG (0 << 0) -#define DAS6402_CTRL_EXT_FALL_TRIG (1 << 0) -#define DAS6402_CTRL_EXT_RISE_TRIG (2 << 0) -#define DAS6402_CTRL_PACER_TRIG (3 << 0) -#define DAS6402_CTRL_BURSTEN (1 << 2) -#define DAS6402_CTRL_XINTE (1 << 3) +#define DAS6402_CTRL_TRIG (x) ((x) << 0) +#define DAS6402_CTRL_SOFT_TRIG DAS6402_CTRL_TRIG(0) +#define DAS6402_CTRL_EXT_FALL_TRIG DAS6402_CTRL_TRIG(1) +#define DAS6402_CTRL_EXT_RISE_TRIG DAS6402_CTRL_TRIG(2) +#define DAS6402_CTRL_PACER_TRIG DAS6402_CTRL_TRIG(3) +#define DAS6402_CTRL_BURSTEN BIT(2) +#define DAS6402_CTRL_XINTE BIT(3)#define DAS6402_CTRL_IRQ (x) ((x) << 4) -#define DAS6402_CTRL_INTE (1 << 7) +#define DAS6402_CTRL_INTE BIT(7)#define DAS6402_TRIG_REG 0x0a -#define DAS6402_TRIG_TGEN (1 << 0) -#define DAS6402_TRIG_TGSEL (1 << 1) -#define DAS6402_TRIG_TGPOL (1 << 2) -#define DAS6402_TRIG_PRETRIG (1 << 3) +#define DAS6402_TRIG_TGEN BIT(0) +#define DAS6402_TRIG_TGSEL BIT(1) +#define DAS6402_TRIG_TGPOL BIT(2) +#define DAS6402_TRIG_PRETRIG BIT(3)#define DAS6402_AO_RANGE (_chan, _range) ((_range) << ((_chan) ? 6 : 4))#define DAS6402_AO_RANGE_MASK (_chan) (3 << ((_chan) ? 6 : 4))#define DAS6402_MODE_REG 0x0b -#define DAS6402_MODE_RANGE (x) ((x) << 0) -#define DAS6402_MODE_POLLED (0 << 2) -#define DAS6402_MODE_FIFONEPTY (1 << 2) -#define DAS6402_MODE_FIFOHFULL (2 << 2) -#define DAS6402_MODE_EOB (3 << 2) -#define DAS6402_MODE_ENHANCED (1 << 4) -#define DAS6402_MODE_SE (1 << 5) -#define DAS6402_MODE_UNI (1 << 6) -#define DAS6402_MODE_DMA1 (0 << 7) -#define DAS6402_MODE_DMA3 (1 << 7) +#define DAS6402_MODE_RANGE (x) ((x) << 2) +#define DAS6402_MODE_POLLED DAS6402_MODE_RANGE(0) +#define DAS6402_MODE_FIFONEPTY DAS6402_MODE_RANGE(1) +#define DAS6402_MODE_FIFOHFULL DAS6402_MODE_RANGE(2) +#define DAS6402_MODE_EOB DAS6402_MODE_RANGE(3) +#define DAS6402_MODE_ENHANCED BIT(4) +#define DAS6402_MODE_SE BIT(5) +#define DAS6402_MODE_UNI BIT(6) +#define DAS6402_MODE_DMA (x) ((x) << 7) +#define DAS6402_MODE_DMA1 DAS6402_MODE_DMA(0) +#define DAS6402_MODE_DMA3 DAS6402_MODE_DMA(1)#define DAS6402_TIMER_BASE 0x0cstatic const struct comedi_lrange das6402_ai_ranges = {
Signature · 1 line
1.9.1
PATCH 10/10 Staging: comedi: Used unsigned int instead of unsigned issue in jr3_pci.c
In reply to Ravishankar Karkala MallikarjunayyaThis is a patch to the jr3_pci.c file that fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool.
--- drivers/staging/comedi/drivers/jr3_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/jr3_pci.c +2 -2
@@ -231,7 +231,7 @@ static unsigned int jr3_pci_ai_read_chan(struct comedi_device *dev,if (chan <56 ) {unsigned int axis = chan %8 ; -unsigned filter = chan /8 ; +unsigned int filter = chan /8 ;switch (axis) {case 0 :
@@ -690,7 +690,7 @@ static int jr3_pci_auto_attach(struct comedi_device *dev,if (sizeof (struct jr3_channel ) !=0xc00 ) {dev_err (dev->class_dev,"sizeof(struct jr3_channel) = %x [expected %x]\n" , - (unsigned )sizeof (struct jr3_channel ),0xc00 ); + (unsigned int )sizeof (struct jr3_channel ),0xc00 );return -EINVAL ; }
Signature · 1 line
1.9.1
PATCH 9/10 Staging: comedi: Block comment issue fixed for das16m1.c
In reply to Ravishankar Karkala MallikarjunayyaThis is a patch to the das16m1.c file that fixes up a
WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool.
--- drivers/staging/comedi/drivers/das16m1.c | 168 ++++++++++++++++--------------- 1 file changed, 89 insertions(+), 79 deletions(-)
drivers/staging/comedi/drivers/das16m1.c +89 -79
@@ -1,56 +1,56 @@/* -comedi/drivers/das16m1.c -CIO-DAS16/M1 driver -Author: Frank Mori Hess, based on code from the das16 -driver. -Copyright (C) 2001 Frank Mori Hess <[email protected]> - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 2000 David A. Schleef <[email protected]> - -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. -*/ +* comedi/drivers/das16m1.c +* CIO-DAS16/M1 driver +* Author: Frank Mori Hess, based on code from the das16 +* driver. +* Copyright (C) 2001 Frank Mori Hess <[email protected]> +* +* COMEDI - Linux Control and Measurement Device Interface +* Copyright (C) 2000 David A. Schleef <[email protected]> +* +* 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. +*/ /* -Driver: das16m1 -Description: CIO-DAS16/M1 -Author: Frank Mori Hess <[email protected]> -Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1) -Status: works - -This driver supports a single board - the CIO-DAS16/M1. -As far as I know, there are no other boards that have -the same register layout. Even the CIO-DAS16/M1/16 is -significantly different. - -I was _barely_ able to reach the full 1 MHz capability -of this board, using a hard real-time interrupt -(set the TRIG_RT flag in your struct comedi_cmd and use -rtlinux or RTAI). The board can't do dma, so the bottleneck is -pulling the data across the ISA bus. I timed the interrupt -handler, and it took my computer ~470 microseconds to pull 512 -samples from the board. So at 1 Mhz sampling rate, -expect your CPU to be spending almost all of its -time in the interrupt handler. - -This board has some unusual restrictions for its channel/gain list. If the -list has 2 or more channels in it, then two conditions must be satisfied: -(1) - even/odd channels must appear at even/odd indices in the list -(2) - the list must have an even number of entries. - -Options: -[0] - base io address -[1] - irq (optional, but you probably want it) - -irq can be omitted, although the cmd interface will not work without it. -*/ +* Driver: das16m1 +* Description: CIO-DAS16/M1 +* Author: Frank Mori Hess <[email protected]> +* Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1) +* Status: works +* +* This driver supports a single board - the CIO-DAS16/M1. +* As far as I know, there are no other boards that have +* the same register layout. Even the CIO-DAS16/M1/16 is +* significantly different. +* +* I was _barely_ able to reach the full 1 MHz capability +* of this board, using a hard real-time interrupt +* (set the TRIG_RT flag in your struct comedi_cmd and use +* rtlinux or RTAI). The board can't do dma, so the bottleneck is +* pulling the data across the ISA bus. I timed the interrupt +* handler, and it took my computer ~470 microseconds to pull 512 +* samples from the board. So at 1 Mhz sampling rate, +* expect your CPU to be spending almost all of its +* time in the interrupt handler. +* +* This board has some unusual restrictions for its channel/gain list. If the +* list has 2 or more channels in it, then two conditions must be satisfied: +* (1) - even/odd channels must appear at even/odd indices in the list +* (2) - the list must have an even number of entries. +* +* Options: +* [0] - base io address +* [1] - irq (optional, but you probably want it) +* +* irq can be omitted, although the cmd interface will not work without it. +*/ #include <linux/module.h> #include <linux/slab.h>
@@ -65,24 +65,24 @@ irq can be omitted, although the cmd interface will not work without it.#define FIFO_SIZE 1024/* 1024 sample fifo */ /* -CIO-DAS16_M1.pdf - -"cio-das16/m1" - -0 a/d bits 0-3, mux start 12 bit -1 a/d bits 4-11 unused -2 status control -3 di 4 bit do 4 bit -4 unused clear interrupt -5 interrupt, pacer -6 channel/gain queue address -7 channel/gain queue data -89ab 8254 -cdef 8254 -400 8255 -404-407 8254 - -*/ +* CIO-DAS16_M1.pdf +* +* "cio-das16/m1" +* +* 0 a/d bits 0-3, mux start 12 bit +* 1 a/d bits 4-11 unused +* 2 status control +* 3 di 4 bit do 4 bit +* 4 unused clear interrupt +* 5 interrupt, pacer +* 6 channel/gain queue address +* 7 channel/gain queue data +* 89ab 8254 +* cdef 8254 +* 400 8255 +* 404-407 8254 +* +*/ #define DAS16M1_AI 0/* 16-bit wide register */ #define AI_CHAN (x) ((x) & 0xf)
@@ -125,9 +125,11 @@ struct das16m1_private_struct {struct comedi_8254 *counter;unsigned int control_state;unsigned int adc_count;/* number of samples completed */ -/* initial value in lower half of hardware conversion counter, +/* +* initial value in lower half of hardware conversion counter, * needed to keep track of whether new count has been loaded into -* counter yet (loaded by first sample conversion) */ +* counter yet (loaded by first sample conversion) +*/ u16 initial_hw_count;unsigned short ai_buffer[FIFO_SIZE ];unsigned long extra_iobase;
@@ -295,8 +297,10 @@ static int das16m1_cmd_exec(struct comedi_device *dev,/* set control & status register */ byte =0 ; -/* if we are using external start trigger (also board dislikes having -* both start and conversion triggers external simultaneously) */ +/* +* if we are using external start trigger (also board dislikes having +* both start and conversion triggers external simultaneously) +*/ if (cmd->start_src ==TRIG_EXT && cmd->convert_src !=TRIG_EXT ) byte |=EXT_TRIG_BIT ;
@@ -409,20 +413,24 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status)/* figure out how many samples are in fifo */ hw_counter =comedi_8254_read (devpriv->counter,1 ); -/* make sure hardware counter reading is not bogus due to initial value -* not having been loaded yet */ +/* +* make sure hardware counter reading is not bogus due to initial value +* not having been loaded yet +*/ if (devpriv->adc_count ==0 && hw_counter == devpriv->initial_hw_count) { num_samples =0 ; }else { -/* The calculation of num_samples looks odd, but it uses the +/* +* The calculation of num_samples looks odd, but it uses the * following facts. 16 bit hardware counter is initialized with * value of zero (which really means 0x1000). The counter * decrements by one on each conversion (when the counter * decrements from zero it goes to 0xffff). num_samples is a * 16 bit variable, so it will roll over in a similar fashion * to the hardware counter. Work it out, and this is what you -* get. */ +* get. +*/ num_samples = -hw_counter - devpriv->adc_count; }/* check if we only need some of the points */
@@ -445,8 +453,10 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status) } } -/* this probably won't catch overruns since the card doesn't generate -* overrun interrupts, but we might as well try */ +/* +* this probably won't catch overruns since the card doesn't generate +* overrun interrupts, but we might as well try +*/ if (status &OVRUN ) { async->events |=COMEDI_CB_ERROR ;dev_err (dev->class_dev,"fifo overflow\n" );
Signature · 1 line
1.9.1
PATCH 8/10 Staging: comedi: Prefer unsigned int instead of unsigned in comedi_bond.c
In reply to Ravishankar Karkala MallikarjunayyaThis is a patch to the comedi_bond.c file that fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool.
--- drivers/staging/comedi/drivers/comedi_bond.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/comedi/drivers/comedi_bond.c +5 -5
@@ -55,16 +55,16 @@struct bonded_device {struct comedi_device *dev; -unsigned minor; -unsigned subdev; -unsigned nchans; +unsigned int minor; +unsigned int subdev; +unsigned int nchans; };struct comedi_bond_private {char name[256 ];struct bonded_device **devs; -unsigned ndevs; -unsigned nchans; +unsigned int ndevs; +unsigned int nchans; }; static int bonding_dio_insn_bits(struct comedi_device *dev,
Signature · 1 line
1.9.1
Quoted 8 lines · Ravishankar Karkala Mallikarjunayya
This is a patch to the
pcmuio.cfile that fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool.Signed-off-by Ravishankar Karkala Mallikarjunayya <[email protected]>--- drivers/staging/comedi/drivers/pcmuio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks!
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Web: http://www.mev.co.uk/ )=-
Re: [PATCH v1 02/10] Staging: comedi: fix bare use of unsigned issue in ni_65xx.c
In reply to Ravishankar Karkala MallikarjunayyaQuoted 8 lines · Ravishankar Karkala Mallikarjunayya
This is a patch to the
ni_65xx.cfile that fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl toolSigned-off-by Ravishankar Karkala Mallikarjunayya <[email protected]>--- drivers/staging/comedi/drivers/ni_65xx.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
Thanks!
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Web: http://www.mev.co.uk/ )=-
Re: [PATCH v1 03/10] Staging: comedi: Indentation issue in mpc624.c
In reply to Ravishankar Karkala MallikarjunayyaQuoted 8 lines · Ravishankar Karkala Mallikarjunayya
This is a patch to the
mpc624.cfile that fixes up a
WARNING: 'Statements should start on a tabstop' found by the checkpatch.pl tool.Signed-off-by Ravishankar Karkala Mallikarjunayya <[email protected]>--- drivers/staging/comedi/drivers/mpc624.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks!
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Web: http://www.mev.co.uk/ )=-
Re: [PATCH v1 04/10] Staging: comedi:Fix a warning issues in me_daq.c
In reply to Ravishankar Karkala MallikarjunayyaQuoted 8 lines · Ravishankar Karkala Mallikarjunayya
This is a patch to the
me_daq.cfile that fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool.Signed-off-by Ravishankar Karkala Mallikarjunayya <[email protected]>--- drivers/staging/comedi/drivers/me_daq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks!
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Web: http://www.mev.co.uk/ )=-
Re: [PATCH v1 05/10] Staging: comedi: Fix comment issues in jr3_pci.c
In reply to Ravishankar Karkala MallikarjunayyaQuoted 9 lines · Ravishankar Karkala Mallikarjunayya
This is a patch to the
jr3_pci.cfile that fixes up a
WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool.Signed-off-by Ravishankar Karkala Mallikarjunayya <[email protected]>--- drivers/staging/comedi/drivers/jr3_pci.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
Thanks!
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Web: http://www.mev.co.uk/ )=-
Re: [PATCH v1 06/10] Staging: comedi: Prefer using the BIT macro issue in das16.c
In reply to Ravishankar Karkala MallikarjunayyaQuoted 8 lines · Ravishankar Karkala Mallikarjunayya
This patch Replace all occurences of (1<<x) by BIT(x) in the file
das16.cto get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro"Signed-off-by Ravishankar Karkala Mallikarjunayya <[email protected]>--- drivers/staging/comedi/drivers/das16.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
Thanks!
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Web: http://www.mev.co.uk/ )=-
Re: [PATCH v1 07/10] Staging: comedi: fix BIT macro issue in das6402.c
In reply to Ravishankar Karkala MallikarjunayyaQuoted 9 lines · Ravishankar Karkala Mallikarjunayya
This patch Replace all occurences of (1<<x) by BIT(x) and
DAS6402_CTRL_TRIG(x),DAS6402_MODE_RANGE(x),DAS6402_MODE_DMA(x)macros in the filedas6402.cto get rid of checkpatch.pl "CHECK" output "Prefer using the BIT macro"Signed-off-by Ravishankar Karkala Mallikarjunayya <[email protected]>--- drivers/staging/comedi/drivers/das6402.c | 74 ++++++++++++++++---------------- 1 file changed, 38 insertions(+), 36 deletions(-)
Thanks!
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Web: http://www.mev.co.uk/ )=-
Re: [PATCH v1 08/10] Staging: comedi: Prefer unsigned int instead of unsigned in comedi_bond.c
In reply to Ravishankar Karkala MallikarjunayyaQuoted 9 lines · Ravishankar Karkala Mallikarjunayya
This is a patch to the
comedi_bond.cfile that fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool.Signed-off-by Ravishankar Karkala Mallikarjunayya <[email protected]>--- drivers/staging/comedi/drivers/comedi_bond.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
Thanks!
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Web: http://www.mev.co.uk/ )=-
Re: [PATCH v1 09/10] Staging: comedi: Block comment issue fixed for das16m1.c
In reply to Ravishankar Karkala MallikarjunayyaQuoted 8 lines · Ravishankar Karkala Mallikarjunayya
This is a patch to the
das16m1.cfile that fixes up a
WARNING: 'Block comments use a trailing */ on a separate line' found by the checkpatch.pl tool.Signed-off-by Ravishankar Karkala Mallikarjunayya <[email protected]>--- drivers/staging/comedi/drivers/das16m1.c | 168 ++++++++++++++++--------------- 1 file changed, 89 insertions(+), 79 deletions(-)
Thanks!
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Web: http://www.mev.co.uk/ )=-
Re: [PATCH v1 10/10] Staging: comedi: Used unsigned int instead of unsigned issue in jr3_pci.c
In reply to Ravishankar Karkala MallikarjunayyaQuoted 8 lines · Ravishankar Karkala Mallikarjunayya
This is a patch to the
jr3_pci.cfile that fixes up a
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' found by the checkpatch.pl tool.Signed-off-by Ravishankar Karkala Mallikarjunayya <[email protected]>--- drivers/staging/comedi/drivers/jr3_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks!
Signature · 2 lines
-=( Ian Abbott @ MEV Ltd. E-mail: <[email protected]> )=- -=( Web: http://www.mev.co.uk/ )=-