diff options
Diffstat (limited to 'drivers/staging/comedi')
56 files changed, 464 insertions, 409 deletions
diff --git a/drivers/staging/comedi/drivers/addi-data/APCI1710_Chrono.c b/drivers/staging/comedi/drivers/addi-data/APCI1710_Chrono.c index 0af12fd2a40a..fbc26a027de4 100644 --- a/drivers/staging/comedi/drivers/addi-data/APCI1710_Chrono.c +++ b/drivers/staging/comedi/drivers/addi-data/APCI1710_Chrono.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/APCI1710_Dig_io.c b/drivers/staging/comedi/drivers/addi-data/APCI1710_Dig_io.c index f3e47e5791db..a6898e4bbb62 100644 --- a/drivers/staging/comedi/drivers/addi-data/APCI1710_Dig_io.c +++ b/drivers/staging/comedi/drivers/addi-data/APCI1710_Dig_io.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/APCI1710_INCCPT.c b/drivers/staging/comedi/drivers/addi-data/APCI1710_INCCPT.c index a15c952c0fab..0e498e9eb080 100644 --- a/drivers/staging/comedi/drivers/addi-data/APCI1710_INCCPT.c +++ b/drivers/staging/comedi/drivers/addi-data/APCI1710_INCCPT.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/APCI1710_Inp_cpt.c b/drivers/staging/comedi/drivers/addi-data/APCI1710_Inp_cpt.c index 0fc2285c9ef8..204d7987700a 100644 --- a/drivers/staging/comedi/drivers/addi-data/APCI1710_Inp_cpt.c +++ b/drivers/staging/comedi/drivers/addi-data/APCI1710_Inp_cpt.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/APCI1710_Pwm.c b/drivers/staging/comedi/drivers/addi-data/APCI1710_Pwm.c index 138a84f572c8..148ce6f67f0d 100644 --- a/drivers/staging/comedi/drivers/addi-data/APCI1710_Pwm.c +++ b/drivers/staging/comedi/drivers/addi-data/APCI1710_Pwm.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/APCI1710_Ssi.c b/drivers/staging/comedi/drivers/addi-data/APCI1710_Ssi.c index a445dab50eac..6360de59e0e9 100644 --- a/drivers/staging/comedi/drivers/addi-data/APCI1710_Ssi.c +++ b/drivers/staging/comedi/drivers/addi-data/APCI1710_Ssi.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c b/drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c index 7e1254475792..344df9462198 100644 --- a/drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c +++ b/drivers/staging/comedi/drivers/addi-data/APCI1710_Tor.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/APCI1710_Ttl.c b/drivers/staging/comedi/drivers/addi-data/APCI1710_Ttl.c index d3d78d37de5c..de6f77246890 100644 --- a/drivers/staging/comedi/drivers/addi-data/APCI1710_Ttl.c +++ b/drivers/staging/comedi/drivers/addi-data/APCI1710_Ttl.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/addi_amcc_S5920.c b/drivers/staging/comedi/drivers/addi-data/addi_amcc_S5920.c index 6e9e7ed4dba9..bd7e4619b3df 100644 --- a/drivers/staging/comedi/drivers/addi-data/addi_amcc_S5920.c +++ b/drivers/staging/comedi/drivers/addi-data/addi_amcc_S5920.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/addi_common.c b/drivers/staging/comedi/drivers/addi-data/addi_common.c index a56535fbcd3e..8db5ab63e363 100644 --- a/drivers/staging/comedi/drivers/addi-data/addi_common.c +++ b/drivers/staging/comedi/drivers/addi-data/addi_common.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/addi_eeprom.c b/drivers/staging/comedi/drivers/addi-data/addi_eeprom.c index 69b427390e53..bea329f44d80 100644 --- a/drivers/staging/comedi/drivers/addi-data/addi_eeprom.c +++ b/drivers/staging/comedi/drivers/addi-data/addi_eeprom.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_APCI1710.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_APCI1710.c index 47517a938ec5..d7d768ee7c23 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_APCI1710.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_APCI1710.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci035.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci035.c index 016721efdbfb..791297266fc0 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci035.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci035.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c index 723a97bab44c..27c68aac32d1 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1032.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c index 36b929ffecbd..d5e06ad6acc2 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c index 866eb8d75820..7948c41f60f5 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1516.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index 3ae663bc754e..4413279c880b 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci16xx.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci16xx.c index 988e3fc2b857..8bc88adfbb59 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci16xx.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci16xx.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2016.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2016.c index d348cd5687aa..89783b1eb0bd 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2016.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2016.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2032.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2032.c index ec817082d170..2d325163c169 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2032.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2032.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c index aa159dccc36a..e01889c3c4fc 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci2200.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c index 172fba8dbfe5..07123fd766a3 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3120.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c index 98c23872e374..560c848f6258 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3200.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c index 7b38d177394b..4ed441a1adc8 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c index 1d1e5fc2ea9a..3692326d474a 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3xxx.c @@ -17,7 +17,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -You shoud also find the complete GPL in the COPYING file accompanying this source code. +You should also find the complete GPL in the COPYING file accompanying this source code. @endverbatim */ @@ -1206,7 +1206,7 @@ int i_APCI3XXX_InsnWriteTTLIO(struct comedi_device *dev, if (b_Channel < 8) { /*****************************************************************************/ - /* Read port 0 (first digital output port) and set/reset the selcted channel */ + /* Read port 0 (first digital output port) and set/reset the selected channel */ /*****************************************************************************/ dw_Status = inl(devpriv->iobase + 80); @@ -1228,7 +1228,7 @@ int i_APCI3XXX_InsnWriteTTLIO(struct comedi_device *dev, if ((devpriv->ul_TTLPortConfiguration[0] & 0xFF) == 0xFF) { /*****************************************************************************/ - /* Read port 2 (first digital output port) and set/reset the selcted channel */ + /* Read port 2 (first digital output port) and set/reset the selected channel */ /*****************************************************************************/ dw_Status = inl(devpriv->iobase + 112); diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index 791ea8334e1e..9934a3cf2548 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -88,9 +88,9 @@ Configuration options: #define IORANGE_9118 64 /* I hope */ #define PCI9118_CHANLEN 255 /* len of chanlist, some source say 256, but reality looks like 255 :-( */ -#define PCI9118_CNT0 0x00 /* R/W: 8254 couter 0 */ -#define PCI9118_CNT1 0x04 /* R/W: 8254 couter 0 */ -#define PCI9118_CNT2 0x08 /* R/W: 8254 couter 0 */ +#define PCI9118_CNT0 0x00 /* R/W: 8254 counter 0 */ +#define PCI9118_CNT1 0x04 /* R/W: 8254 counter 0 */ +#define PCI9118_CNT2 0x08 /* R/W: 8254 counter 0 */ #define PCI9118_CNTCTRL 0x0c /* W: 8254 counter control */ #define PCI9118_AD_DATA 0x10 /* R: A/D data */ #define PCI9118_DA1 0x10 /* W: D/A registers */ diff --git a/drivers/staging/comedi/drivers/adq12b.c b/drivers/staging/comedi/drivers/adq12b.c index c5ed8bb97602..f3ba645bf63b 100644 --- a/drivers/staging/comedi/drivers/adq12b.c +++ b/drivers/staging/comedi/drivers/adq12b.c @@ -42,23 +42,23 @@ If you do not specify any options, they will default to option 1: I/O base address. The following table is provided as a help of the hardware jumpers. - address jumper JADR - 0x300 1 (factory default) - 0x320 2 - 0x340 3 - 0x360 4 - 0x380 5 - 0x3A0 6 + address jumper JADR + 0x300 1 (factory default) + 0x320 2 + 0x340 3 + 0x360 4 + 0x380 5 + 0x3A0 6 option 2: unipolar/bipolar ADC selection: 0 -> bipolar, 1 -> unipolar - selection comedi_config option JUB - bipolar 0 2-3 (factory default) - unipolar 1 1-2 + selection comedi_config option JUB + bipolar 0 2-3 (factory default) + unipolar 1 1-2 option 3: single-ended/differential AI selection: 0 -> SE, 1 -> differential - selection comedi_config option JCHA JCHB + selection comedi_config option JCHA JCHB single-ended 0 1-2 1-2 (factory default) differential 1 2-3 2-3 @@ -140,7 +140,7 @@ static const struct adq12b_board adq12b_boards[] = { .ai_bits = 12, .di_chans = 8, .do_chans = 5 - }*/ + }*/ }; #define thisboard ((const struct adq12b_board *)dev->board_ptr) @@ -164,14 +164,15 @@ struct adq12b_private { static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it); static int adq12b_detach(struct comedi_device *dev); + static struct comedi_driver driver_adq12b = { -driver_name:"adq12b", -module:THIS_MODULE, -attach:adq12b_attach, -detach:adq12b_detach, -board_name:&adq12b_boards[0].name, -offset:sizeof(struct adq12b_board), -num_names:ARRAY_SIZE(adq12b_boards), + .driver_name = "adq12b", + .module = THIS_MODULE, + .attach = adq12b_attach, + .detach = adq12b_detach, + .board_name = &adq12b_boards[0].name, + .offset = sizeof(struct adq12b_board), + .num_names = ARRAY_SIZE(adq12b_boards), }; static int adq12b_ai_rinsn(struct comedi_device *dev, @@ -200,15 +201,16 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it) unipolar = it->options[1]; differential = it->options[2]; - printk("comedi%d: adq12b called with options base=0x%03lx, %s and %s\n", - dev->minor, iobase, (unipolar == 1) ? "unipolar" : "bipolar", + printk(KERN_INFO "comedi%d: adq12b called with options base=0x%03lx, " + "%s and %s\n", dev->minor, iobase, + (unipolar == 1) ? "unipolar" : "bipolar", (differential == 1) ? "differential" : "single-ended"); /* if no address was specified, try the default 0x300 */ if (iobase == 0) { - printk - ("comedi%d: adq12b warning: I/O base address not specified. Trying the default 0x300.\n", - dev->minor); + printk(KERN_WARNING "comedi%d: adq12b warning: I/O base " + "address not specified. Trying the default 0x300.\n", + dev->minor); iobase = 0x300; } @@ -259,11 +261,10 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it) s->n_chan = thisboard->ai_se_chans; } - if (unipolar) { + if (unipolar) s->range_table = &range_adq12b_ai_unipolar; - } else { + else s->range_table = &range_adq12b_ai_bipolar; - } s->maxdata = (1 << thisboard->ai_bits) - 1; @@ -289,7 +290,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it) s->range_table = &range_digital; s->insn_bits = adq12b_do_insn_bits; - printk("attached\n"); + printk(KERN_INFO "attached\n"); return 0; } @@ -309,7 +310,7 @@ static int adq12b_detach(struct comedi_device *dev) kfree(devpriv); - printk("comedi%d: adq12b: removed\n", dev->minor); + printk(KERN_INFO "comedi%d: adq12b: removed\n", dev->minor); return 0; } @@ -344,17 +345,18 @@ static int adq12b_ai_rinsn(struct comedi_device *dev, /* wait for end of convertion */ i = 0; do { -/* udelay(1); */ + /* udelay(1); */ status = inb(dev->iobase + ADQ12B_STINR); status = status & ADQ12B_EOC; } while (status == 0 && ++i < TIMEOUT); -/* } while (++i < 10); */ + /* } while (++i < 10); */ /* read data */ hi = inb(dev->iobase + ADQ12B_ADHIG); lo = inb(dev->iobase + ADQ12B_ADLOW); - /* printk("debug: chan=%d range=%d status=%d hi=%d lo=%d\n", channel, range, status, hi, lo); */ + /* printk("debug: chan=%d range=%d status=%d hi=%d lo=%d\n", + channel, range, status, hi, lo); */ data[n] = (hi << 8) | lo; } diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c index 951e57949f7f..394d2ea19c2e 100644 --- a/drivers/staging/comedi/drivers/adv_pci1710.c +++ b/drivers/staging/comedi/drivers/adv_pci1710.c @@ -84,9 +84,9 @@ Configuration options: #define PCI171x_DAREF 14 /* W: D/A reference control */ #define PCI171x_DI 16 /* R: digi inputs */ #define PCI171x_DO 16 /* R: digi inputs */ -#define PCI171x_CNT0 24 /* R/W: 8254 couter 0 */ -#define PCI171x_CNT1 26 /* R/W: 8254 couter 1 */ -#define PCI171x_CNT2 28 /* R/W: 8254 couter 2 */ +#define PCI171x_CNT0 24 /* R/W: 8254 counter 0 */ +#define PCI171x_CNT1 26 /* R/W: 8254 counter 1 */ +#define PCI171x_CNT2 28 /* R/W: 8254 counter 2 */ #define PCI171x_CNTCTRL 30 /* W: 8254 counter control */ /* upper bits from status register (PCI171x_STATUS) (lower is same woth control reg) */ @@ -724,6 +724,7 @@ static int move_block_from_fifo(struct comedi_device *dev, devpriv->ai_act_scan++; } } + s->async->cur_chan = j; DPRINTK("adv_pci1710 EDBG: END: move_block_from_fifo(...)\n"); return 0; } @@ -1034,14 +1035,6 @@ static int pci171x_ai_cmdtest(struct comedi_device *dev, } } - if (!cmd->chanlist_len) { - cmd->chanlist_len = 1; - err++; - } - if (cmd->chanlist_len > this_board->n_aichan) { - cmd->chanlist_len = this_board->n_aichan; - err++; - } if (cmd->scan_end_arg != cmd->chanlist_len) { cmd->scan_end_arg = cmd->chanlist_len; err++; @@ -1230,6 +1223,12 @@ static void setup_channel_list(struct comedi_device *dev, DPRINTK("GS: %2d. [%4x]=%4x %4x\n", i, chanprog, range, devpriv->act_chanlist[i]); } +#ifdef PCI171x_PARANOIDCHECK + for ( ; i < n_chan; i++) { /* store remainder of channel list */ + devpriv->act_chanlist[i] = + (CR_CHAN(chanlist[i]) << 12) & 0xf000; + } +#endif devpriv->ai_et_MuxVal = CR_CHAN(chanlist[0]) | (CR_CHAN(chanlist[seglen - 1]) << 8); diff --git a/drivers/staging/comedi/drivers/c6xdigio.c b/drivers/staging/comedi/drivers/c6xdigio.c index abb0532182ba..fb0d5fa71765 100644 --- a/drivers/staging/comedi/drivers/c6xdigio.c +++ b/drivers/staging/comedi/drivers/c6xdigio.c @@ -45,7 +45,7 @@ http://robot0.ge.uiuc.edu/~spong/mecha/ #include <linux/interrupt.h> #include <linux/timex.h> #include <linux/timer.h> -#include <asm/io.h> +#include <linux/io.h> #include <linux/pnp.h> #include "../comedidev.h" @@ -220,11 +220,11 @@ static int C6X_encInput(unsigned long baseAddr, unsigned channel) /* printk("Inside C6X_encInput\n"); */ enc.value = 0; - if (channel == 0) { + if (channel == 0) ppcmd = 0x48; - } else { + else ppcmd = 0x50; - } + WriteByteToHwPort(baseAddr, ppcmd); tmp = ReadByteFromHwPort(baseAddr + 1); while (((tmp & 0x80) == 0) && (timeout < C6XDIGIO_TIME_OUT)) { @@ -391,9 +391,8 @@ static int c6xdigio_ei_insn_read(struct comedi_device *dev, int n; int chan = CR_CHAN(insn->chanspec); - for (n = 0; n < insn->n; n++) { + for (n = 0; n < insn->n; n++) data[n] = (C6X_encInput(dev->iobase, chan) & 0xffffff); - } return n; } @@ -420,9 +419,9 @@ static void board_init(struct comedi_device *dev) static const struct pnp_device_id c6xdigio_pnp_tbl[] = { /* Standard LPT Printer Port */ - {.id = "PNP0400",.driver_data = 0}, + {.id = "PNP0400", .driver_data = 0}, /* ECP Printer Port */ - {.id = "PNP0401",.driver_data = 0}, + {.id = "PNP0401", .driver_data = 0}, {} }; @@ -452,15 +451,14 @@ static int c6xdigio_attach(struct comedi_device *dev, if (result < 0) return result; - /* Make sure that PnP ports gets activated */ + /* Make sure that PnP ports get activated */ pnp_register_driver(&c6xdigio_pnp_driver); irq = it->options[1]; - if (irq > 0) { + if (irq > 0) printk("comedi%d: irq = %u ignored\n", dev->minor, irq); - } else if (irq == 0) { + else if (irq == 0) printk("comedi%d: no irq\n", dev->minor); - } s = dev->subdevices + 0; /* pwm output subdevice */ @@ -483,19 +481,19 @@ static int c6xdigio_attach(struct comedi_device *dev, s->maxdata = 0xffffff; s->range_table = &range_unknown; - /* s = dev->subdevices + 2; */ + /* s = dev->subdevices + 2; */ /* pwm output subdevice */ - /* s->type = COMEDI_SUBD_COUNTER; // Not sure what to put here */ - /* s->subdev_flags = SDF_WRITEABLE; */ - /* s->n_chan = 1; */ - /* s->trig[0] = c6xdigio_ei_init; */ - /* s->insn_read = c6xdigio_ei_init_insn_read; */ - /* s->insn_write = c6xdigio_ei_init_insn_write; */ - /* s->maxdata = 0xFFFF; // Really just a don't care */ - /* s->range_table = &range_unknown; // Not sure what to put here */ - - /* I will call this init anyway but more than likely the DSP board will not be connect */ - /* when device driver is loaded. */ + /* s->type = COMEDI_SUBD_COUNTER; // Not sure what to put here */ + /* s->subdev_flags = SDF_WRITEABLE; */ + /* s->n_chan = 1; */ + /* s->trig[0] = c6xdigio_ei_init; */ + /* s->insn_read = c6xdigio_ei_init_insn_read; */ + /* s->insn_write = c6xdigio_ei_init_insn_write; */ + /* s->maxdata = 0xFFFF; // Really just a don't care */ + /* s->range_table = &range_unknown; // Not sure what to put here */ + + /* I will call this init anyway but more than likely the DSP board */ + /* will not be connected when device driver is loaded. */ board_init(dev); return 0; @@ -503,16 +501,17 @@ static int c6xdigio_attach(struct comedi_device *dev, static int c6xdigio_detach(struct comedi_device *dev) { -/* board_halt(dev); may not need this */ + /* board_halt(dev); may not need this */ printk("comedi%d: c6xdigio: remove\n", dev->minor); - if (dev->iobase) { + if (dev->iobase) release_region(dev->iobase, C6XDIGIO_SIZE); - } - if (dev->irq) { + + /* Not using IRQ so I am not sure if I need this */ + if (dev->irq) free_irq(dev->irq, dev); - } /* Not using IRQ so I am not sure if I need this */ + pnp_unregister_driver(&c6xdigio_pnp_driver); return 0; diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c index cf39a24ddd4c..d7260cc86985 100644 --- a/drivers/staging/comedi/drivers/comedi_bond.c +++ b/drivers/staging/comedi/drivers/comedi_bond.c @@ -417,7 +417,7 @@ static int doDevConfig(struct comedi_device *dev, struct comedi_devconfig *it) int sdev = -1, nchans, tmp; struct BondedDevice *bdev = NULL; - if (minor < 0 || minor > COMEDI_NUM_BOARD_MINORS) { + if (minor < 0 || minor >= COMEDI_NUM_BOARD_MINORS) { ERROR("Minor %d is invalid!\n", minor); return 0; } diff --git a/drivers/staging/comedi/drivers/dt9812.c b/drivers/staging/comedi/drivers/dt9812.c index 312f4f282bd7..96caae36279c 100644 --- a/drivers/staging/comedi/drivers/dt9812.c +++ b/drivers/staging/comedi/drivers/dt9812.c @@ -264,7 +264,7 @@ struct dt9812_usb_cmd { static DECLARE_MUTEX(dt9812_mutex); -static struct usb_device_id dt9812_table[] = { +static const struct usb_device_id dt9812_table[] = { {USB_DEVICE(0x0867, 0x9812)}, {} /* Terminating entry */ }; diff --git a/drivers/staging/comedi/drivers/fl512.c b/drivers/staging/comedi/drivers/fl512.c index 8fca18043357..a10a2b070a24 100644 --- a/drivers/staging/comedi/drivers/fl512.c +++ b/drivers/staging/comedi/drivers/fl512.c @@ -76,14 +76,14 @@ static int fl512_ai_insn(struct comedi_device *dev, unsigned long iobase = dev->iobase; for (n = 0; n < insn->n; n++) { /* sample n times on selected channel */ - /* XXX probably can move next step out of for() loop -- will make - * AI a little bit faster. */ + /* XXX probably can move next step out of for() loop -- will + * make AI a little bit faster. */ outb(chan, iobase + 2); /* select chan */ outb(0, iobase + 3); /* start conversion */ /* XXX should test "done" flag instead of delay */ udelay(30); /* sleep 30 usec */ lo_byte = inb(iobase + 2); /* low 8 byte */ - hi_byte = inb(iobase + 3) & 0xf; /* high 4 bit and mask */ + hi_byte = inb(iobase + 3) & 0xf; /* high 4 bit and mask */ data[n] = lo_byte + (hi_byte << 8); } return n; @@ -101,8 +101,10 @@ static int fl512_ao_insn(struct comedi_device *dev, unsigned long iobase = dev->iobase; /* get base address */ for (n = 0; n < insn->n; n++) { /* write n data set */ - outb(data[n] & 0x0ff, iobase + 4 + 2 * chan); /* write low byte */ - outb((data[n] & 0xf00) >> 8, iobase + 4 + 2 * chan); /* write high byte */ + /* write low byte */ + outb(data[n] & 0x0ff, iobase + 4 + 2 * chan); + /* write high byte */ + outb((data[n] & 0xf00) >> 8, iobase + 4 + 2 * chan); inb(iobase + 4 + 2 * chan); /* trig */ devpriv->ao_readback[chan] = data[n]; @@ -121,9 +123,8 @@ static int fl512_ao_insn_readback(struct comedi_device *dev, int n; int chan = CR_CHAN(insn->chanspec); - for (n = 0; n < insn->n; n++) { + for (n = 0; n < insn->n; n++) data[n] = devpriv->ao_readback[chan]; - } return n; } @@ -134,13 +135,15 @@ static int fl512_ao_insn_readback(struct comedi_device *dev, static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it) { unsigned long iobase; - struct comedi_subdevice *s; /* pointer to the subdevice: - Analog in, Analog out, ( not made ->and Digital IO) */ + + /* pointer to the subdevice: Analog in, Analog out, + (not made ->and Digital IO) */ + struct comedi_subdevice *s; iobase = it->options[0]; - printk("comedi:%d fl512: 0x%04lx", dev->minor, iobase); + printk(KERN_INFO "comedi:%d fl512: 0x%04lx", dev->minor, iobase); if (!request_region(iobase, FL512_SIZE, "fl512")) { - printk(" I/O port conflict\n"); + printk(KERN_WARNING " I/O port conflict\n"); return -EIO; } dev->iobase = iobase; @@ -149,7 +152,7 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it) return -ENOMEM; #if DEBUG - printk("malloc ok\n"); + printk(KERN_DEBUG "malloc ok\n"); #endif if (alloc_subdevices(dev, 2) < 0) @@ -160,24 +163,37 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it) */ /* Analog indput */ s = dev->subdevices + 0; - s->type = COMEDI_SUBD_AI; /* define subdevice as Analog In */ - s->subdev_flags = SDF_READABLE | SDF_GROUND; /* you can read it from userspace */ - s->n_chan = 16; /* Number of Analog input channels */ - s->maxdata = 0x0fff; /* accept only 12 bits of data */ - s->range_table = &range_fl512; /* device use one of the ranges */ - s->insn_read = fl512_ai_insn; /* function to call when read AD */ - printk("comedi: fl512: subdevice 0 initialized\n"); + /* define subdevice as Analog In */ + s->type = COMEDI_SUBD_AI; + /* you can read it from userspace */ + s->subdev_flags = SDF_READABLE | SDF_GROUND; + /* Number of Analog input channels */ + s->n_chan = 16; + /* accept only 12 bits of data */ + s->maxdata = 0x0fff; + /* device use one of the ranges */ + s->range_table = &range_fl512; + /* function to call when read AD */ + s->insn_read = fl512_ai_insn; + printk(KERN_INFO "comedi: fl512: subdevice 0 initialized\n"); /* Analog output */ s = dev->subdevices + 1; - s->type = COMEDI_SUBD_AO; /* define subdevice as Analog OUT */ - s->subdev_flags = SDF_WRITABLE; /* you can write it from userspace */ - s->n_chan = 2; /* Number of Analog output channels */ - s->maxdata = 0x0fff; /* accept only 12 bits of data */ - s->range_table = &range_fl512; /* device use one of the ranges */ - s->insn_write = fl512_ao_insn; /* function to call when write DA */ - s->insn_read = fl512_ao_insn_readback; /* function to call when reading DA */ - printk("comedi: fl512: subdevice 1 initialized\n"); + /* define subdevice as Analog OUT */ + s->type = COMEDI_SUBD_AO; + /* you can write it from userspace */ + s->subdev_flags = SDF_WRITABLE; + /* Number of Analog output channels */ + s->n_chan = 2; + /* accept only 12 bits of data */ + s->maxdata = 0x0fff; + /* device use one of the ranges */ + s->range_table = &range_fl512; + /* function to call when write DA */ + s->insn_write = fl512_ao_insn; + /* function to call when reading DA */ + s->insn_read = fl512_ao_insn_readback; + printk(KERN_INFO "comedi: fl512: subdevice 1 initialized\n"); return 1; } @@ -186,6 +202,6 @@ static int fl512_detach(struct comedi_device *dev) { if (dev->iobase) release_region(dev->iobase, FL512_SIZE); - printk("comedi%d: fl512: dummy i detach\n", dev->minor); + printk(KERN_INFO "comedi%d: fl512: dummy i detach\n", dev->minor); return 0; } diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index bd397840dcba..fe5b4953f7ec 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -954,6 +954,8 @@ out: return result; } +MODULE_FIRMWARE("comedi/jr3pci.idm"); + static int jr3_pci_detach(struct comedi_device *dev) { int i; diff --git a/drivers/staging/comedi/drivers/mpc624.c b/drivers/staging/comedi/drivers/mpc624.c index cb4da2ae8429..12e72c828157 100644 --- a/drivers/staging/comedi/drivers/mpc624.c +++ b/drivers/staging/comedi/drivers/mpc624.c @@ -284,7 +284,7 @@ static int mpc624_ai_rinsn(struct comedi_device *dev, outb(insn->chanspec, dev->iobase + MPC624_GNMUXCH); /* printk("Channel %d: \n", insn->chanspec); */ if (!insn->n) { - printk("MPC624: Warning, no data to aquire\n"); + printk("MPC624: Warning, no data to acquire\n"); return 0; } diff --git a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c index bbf75eb6d7f2..c223f76031f6 100644 --- a/drivers/staging/comedi/drivers/ni_65xx.c +++ b/drivers/staging/comedi/drivers/ni_65xx.c @@ -26,12 +26,13 @@ /* Driver: ni_65xx Description: National Instruments 65xx static dio boards -Author: Jon Grierson <jd@renko.co.uk>, Frank Mori Hess <fmhess@users.sourceforge.net> +Author: Jon Grierson <jd@renko.co.uk>, + Frank Mori Hess <fmhess@users.sourceforge.net> Status: testing -Devices: [National Instruments] PCI-6509 (ni_65xx), PXI-6509, PCI-6510, PCI-6511, - PXI-6511, PCI-6512, PXI-6512, PCI-6513, PXI-6513, PCI-6514, PXI-6514, PCI-6515, - PXI-6515, PCI-6516, PCI-6517, PCI-6518, PCI-6519, PCI-6520, PCI-6521, PXI-6521, - PCI-6528, PXI-6528 +Devices: [National Instruments] PCI-6509 (ni_65xx), PXI-6509, PCI-6510, + PCI-6511, PXI-6511, PCI-6512, PXI-6512, PCI-6513, PXI-6513, PCI-6514, + PXI-6514, PCI-6515, PXI-6515, PCI-6516, PCI-6517, PCI-6518, PCI-6519, + PCI-6520, PCI-6521, PXI-6521, PCI-6528, PXI-6528 Updated: Wed Oct 18 08:59:11 EDT 2006 Based on the PCI-6527 driver by ds. @@ -418,9 +419,10 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev, return -EINVAL; base_bitfield_channel = CR_CHAN(insn->chanspec); for (j = 0; j < max_ports_per_bitfield; ++j) { - const unsigned port_offset = ni_65xx_port_by_channel(base_bitfield_channel) + j; + const unsigned port_offset = + ni_65xx_port_by_channel(base_bitfield_channel) + j; const unsigned port = - sprivate(s)->base_port + port_offset; + sprivate(s)->base_port + port_offset; unsigned base_port_channel; unsigned port_mask, port_data, port_read_bits; int bitshift; @@ -463,11 +465,11 @@ static int ni_65xx_dio_insn_bits(struct comedi_device *dev, * subdevice.) */ port_read_bits ^= 0xFF; } - if (bitshift > 0) { + if (bitshift > 0) port_read_bits <<= bitshift; - } else { + else port_read_bits >>= -bitshift; - } + read_bits |= port_read_bits; } data[1] = read_bits; @@ -532,7 +534,8 @@ static int ni_65xx_intr_cmdtest(struct comedi_device *dev, if (err) return 1; - /* step 2: make sure trigger sources are unique and mutually compatible */ + /* step 2: make sure trigger sources are unique and mutually + compatible */ if (err) return 2; @@ -652,7 +655,7 @@ static int ni_65xx_attach(struct comedi_device *dev, unsigned i; int ret; - printk("comedi%d: ni_65xx:", dev->minor); + printk(KERN_INFO "comedi%d: ni_65xx:", dev->minor); ret = alloc_private(dev, sizeof(struct ni_65xx_private)); if (ret < 0) @@ -664,15 +667,15 @@ static int ni_65xx_attach(struct comedi_device *dev, ret = mite_setup(private(dev)->mite); if (ret < 0) { - printk("error setting up mite\n"); + printk(KERN_WARNING "error setting up mite\n"); return ret; } dev->board_name = board(dev)->name; dev->irq = mite_irq(private(dev)->mite); - printk(" %s", dev->board_name); + printk(KERN_INFO " %s", dev->board_name); - printk(" ID=0x%02x", + printk(KERN_INFO " ID=0x%02x", readb(private(dev)->mite->daq_io_addr + ID_Register)); ret = alloc_subdevices(dev, 4); @@ -773,7 +776,7 @@ static int ni_65xx_attach(struct comedi_device *dev, "ni_65xx", dev); if (ret < 0) { dev->irq = 0; - printk(" irq not available"); + printk(KERN_WARNING " irq not available"); } printk("\n"); @@ -790,21 +793,17 @@ static int ni_65xx_detach(struct comedi_device *dev) Master_Interrupt_Control); } - if (dev->irq) { + if (dev->irq) free_irq(dev->irq, dev); - } if (private(dev)) { unsigned i; for (i = 0; i < dev->n_subdevices; ++i) { - if (dev->subdevices[i].private) { - kfree(dev->subdevices[i].private); - dev->subdevices[i].private = NULL; - } + kfree(dev->subdevices[i].private); + dev->subdevices[i].private = NULL; } - if (private(dev)->mite) { + if (private(dev)->mite) mite_unsetup(private(dev)->mite); - } } return 0; } @@ -830,7 +829,7 @@ static int ni_65xx_find_device(struct comedi_device *dev, int bus, int slot) } } } - printk("no device found\n"); + printk(KERN_WARNING "no device found\n"); mite_list_devices(); return -EIO; } diff --git a/drivers/staging/comedi/drivers/ni_660x.c b/drivers/staging/comedi/drivers/ni_660x.c index 404d3c516ed1..f74fc5e6ba20 100644 --- a/drivers/staging/comedi/drivers/ni_660x.c +++ b/drivers/staging/comedi/drivers/ni_660x.c @@ -52,7 +52,9 @@ enum ni_660x_constants { }; #define NUM_PFI_CHANNELS 40 -/* really there are only up to 3 dma channels, but the register layout allows for 4 */ +/* really there are only up to 3 dma channels, but the register layout allows +for 4 */ + #define MAX_DMA_CHANNEL 4 /* See Register-Level Programmer Manual page 3.1 */ @@ -198,7 +200,7 @@ struct NI_660xRegisterData { const char *name; /* Register Name */ int offset; /* Offset from base address from GPCT chip */ enum ni_660x_register_direction direction; - enum ni_660x_register_width size; /* 1 byte, 2 bytes, or 4 bytes */ + enum ni_660x_register_width size; /* 1 byte, 2 bytes, or 4 bytes */ }; static const struct NI_660xRegisterData registerData[NumRegisters] = { @@ -382,8 +384,8 @@ enum global_interrupt_config_register_bits { }; /* Offset of the GPCT chips from the base-adress of the card */ -static const unsigned GPCT_OFFSET[2] = { 0x0, 0x800 }; /* First chip is at base-address + - 0x00, etc. */ +/* First chip is at base-address + 0x00, etc. */ +static const unsigned GPCT_OFFSET[2] = { 0x0, 0x800 }; /* Board description*/ struct ni_660x_board { @@ -691,13 +693,13 @@ static enum NI_660x_Register ni_gpct_to_660x_register(enum ni_gpct_register reg) ni_660x_register = G0StatusRegister; break; case NITIO_G1_Status_Reg: - ni_660x_register = G0StatusRegister; + ni_660x_register = G1StatusRegister; break; case NITIO_G2_Status_Reg: - ni_660x_register = G0StatusRegister; + ni_660x_register = G2StatusRegister; break; case NITIO_G3_Status_Reg: - ni_660x_register = G0StatusRegister; + ni_660x_register = G3StatusRegister; break; case NITIO_G0_Interrupt_Enable_Reg: ni_660x_register = G0InterruptEnable; @@ -712,7 +714,7 @@ static enum NI_660x_Register ni_gpct_to_660x_register(enum ni_gpct_register reg) ni_660x_register = G3InterruptEnable; break; default: - printk("%s: unhandled register 0x%x in switch.\n", + printk(KERN_WARNING "%s: unhandled register 0x%x in switch.\n", __func__, reg); BUG(); return 0; @@ -737,7 +739,7 @@ static inline void ni_660x_write_register(struct comedi_device *dev, writel(bits, write_address); break; default: - printk("%s: %s: bug! unhandled case (reg=0x%x) in switch.\n", + printk(KERN_WARNING "%s: %s: bug! unhandled case (reg=0x%x) in switch.\n", __FILE__, __func__, reg); BUG(); break; @@ -760,7 +762,7 @@ static inline unsigned ni_660x_read_register(struct comedi_device *dev, return readl(read_address); break; default: - printk("%s: %s: bug! unhandled case (reg=0x%x) in switch.\n", + printk(KERN_WARNING "%s: %s: bug! unhandled case (reg=0x%x) in switch.\n", __FILE__, __func__, reg); BUG(); break; @@ -993,9 +995,9 @@ static int ni_660x_allocate_private(struct comedi_device *dev) spin_lock_init(&private(dev)->mite_channel_lock); spin_lock_init(&private(dev)->interrupt_lock); spin_lock_init(&private(dev)->soft_reg_copy_lock); - for (i = 0; i < NUM_PFI_CHANNELS; ++i) { + for (i = 0; i < NUM_PFI_CHANNELS; ++i) private(dev)->pfi_output_selects[i] = pfi_output_select_counter; - } + return 0; } @@ -1008,9 +1010,8 @@ static int ni_660x_alloc_mite_rings(struct comedi_device *dev) for (j = 0; j < counters_per_chip; ++j) { private(dev)->mite_rings[i][j] = mite_alloc_ring(private(dev)->mite); - if (private(dev)->mite_rings[i][j] == NULL) { + if (private(dev)->mite_rings[i][j] == NULL) return -ENOMEM; - } } } return 0; @@ -1022,9 +1023,8 @@ static void ni_660x_free_mite_rings(struct comedi_device *dev) unsigned j; for (i = 0; i < board(dev)->n_chips; ++i) { - for (j = 0; j < counters_per_chip; ++j) { + for (j = 0; j < counters_per_chip; ++j) mite_free_ring(private(dev)->mite_rings[i][j]); - } } } @@ -1036,7 +1036,7 @@ static int ni_660x_attach(struct comedi_device *dev, unsigned i; unsigned global_interrupt_config_bits; - printk("comedi%d: ni_660x: ", dev->minor); + printk(KERN_INFO "comedi%d: ni_660x: ", dev->minor); ret = ni_660x_allocate_private(dev); if (ret < 0) @@ -1049,7 +1049,7 @@ static int ni_660x_attach(struct comedi_device *dev, ret = mite_setup2(private(dev)->mite, 1); if (ret < 0) { - printk("error setting up mite\n"); + printk(KERN_WARNING "error setting up mite\n"); return ret; } comedi_set_hw_dev(dev, &private(dev)->mite->pcidev->dev); @@ -1057,7 +1057,7 @@ static int ni_660x_attach(struct comedi_device *dev, if (ret < 0) return ret; - printk(" %s ", dev->board_name); + printk(KERN_INFO " %s ", dev->board_name); dev->n_subdevices = 2 + NI_660X_MAX_NUM_COUNTERS; @@ -1078,15 +1078,17 @@ static int ni_660x_attach(struct comedi_device *dev, s->insn_bits = ni_660x_dio_insn_bits; s->insn_config = ni_660x_dio_insn_config; s->io_bits = 0; /* all bits default to input */ - /* we use the ioconfig registers to control dio direction, so zero output enables in stc dio control reg */ + /* we use the ioconfig registers to control dio direction, so zero + output enables in stc dio control reg */ ni_660x_write_register(dev, 0, 0, STCDIOControl); - private(dev)->counter_dev = ni_gpct_device_construct(dev, - &ni_gpct_write_register, - &ni_gpct_read_register, - ni_gpct_variant_660x, - ni_660x_num_counters - (dev)); + private(dev)->counter_dev + = ni_gpct_device_construct(dev, + &ni_gpct_write_register, + &ni_gpct_read_register, + ni_gpct_variant_660x, + ni_660x_num_counters + (dev)); if (private(dev)->counter_dev == NULL) return -ENOMEM; for (i = 0; i < NI_660X_MAX_NUM_COUNTERS; ++i) { @@ -1118,12 +1120,12 @@ static int ni_660x_attach(struct comedi_device *dev, s->type = COMEDI_SUBD_UNUSED; } } - for (i = 0; i < board(dev)->n_chips; ++i) { + for (i = 0; i < board(dev)->n_chips; ++i) init_tio_chip(dev, i); - } - for (i = 0; i < ni_660x_num_counters(dev); ++i) { + + for (i = 0; i < ni_660x_num_counters(dev); ++i) ni_tio_init_counter(&private(dev)->counter_dev->counters[i]); - } + for (i = 0; i < NUM_PFI_CHANNELS; ++i) { if (i < min_counter_pfi_chan) ni_660x_set_pfi_routing(dev, i, pfi_output_select_do); @@ -1134,13 +1136,13 @@ static int ni_660x_attach(struct comedi_device *dev, } /* to be safe, set counterswap bits on tio chips after all the counter outputs have been set to high impedance mode */ - for (i = 0; i < board(dev)->n_chips; ++i) { + for (i = 0; i < board(dev)->n_chips; ++i) set_tio_counterswap(dev, i); - } + ret = request_irq(mite_irq(private(dev)->mite), ni_660x_interrupt, IRQF_SHARED, "ni_660x", dev); if (ret < 0) { - printk(" irq not available\n"); + printk(KERN_WARNING " irq not available\n"); return ret; } dev->irq = mite_irq(private(dev)->mite); @@ -1149,13 +1151,13 @@ static int ni_660x_attach(struct comedi_device *dev, global_interrupt_config_bits |= Cascade_Int_Enable_Bit; ni_660x_write_register(dev, 0, global_interrupt_config_bits, GlobalInterruptConfigRegister); - printk("attached\n"); + printk(KERN_INFO "attached\n"); return 0; } static int ni_660x_detach(struct comedi_device *dev) { - printk("comedi%d: ni_660x: remove\n", dev->minor); + printk(KERN_INFO "comedi%d: ni_660x: remove\n", dev->minor); /* Free irq */ if (dev->irq) @@ -1193,9 +1195,8 @@ static void init_tio_chip(struct comedi_device *dev, int chipset) private(dev)-> dma_configuration_soft_copies[chipset], DMAConfigRegister); - for (i = 0; i < NUM_PFI_CHANNELS; ++i) { + for (i = 0; i < NUM_PFI_CHANNELS; ++i) ni_660x_write_register(dev, chipset, 0, IOConfigReg(i)); - } } static int @@ -1234,7 +1235,7 @@ static int ni_660x_find_device(struct comedi_device *dev, int bus, int slot) } } } - printk("no device found\n"); + printk(KERN_WARNING "no device found\n"); mite_list_devices(); return -EIO; } diff --git a/drivers/staging/comedi/drivers/ni_670x.c b/drivers/staging/comedi/drivers/ni_670x.c index 9b43547e80a1..1e792d592f73 100644 --- a/drivers/staging/comedi/drivers/ni_670x.c +++ b/drivers/staging/comedi/drivers/ni_670x.c @@ -93,7 +93,7 @@ static DEFINE_PCI_DEVICE_TABLE(ni_670x_pci_table) = { { PCI_VENDOR_ID_NATINST, 0x2c90, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_NATINST, 0x1920, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - /* { PCI_VENDOR_ID_NATINST, 0x0000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, */ + /*{ PCI_VENDOR_ID_NATINST, 0x0000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },*/ { 0} }; @@ -151,7 +151,7 @@ static int ni_670x_attach(struct comedi_device *dev, int ret; int i; - printk("comedi%d: ni_670x: ", dev->minor); + printk(KERN_INFO "comedi%d: ni_670x: ", dev->minor); ret = alloc_private(dev, sizeof(struct ni_670x_private)); if (ret < 0) @@ -163,12 +163,12 @@ static int ni_670x_attach(struct comedi_device *dev, ret = mite_setup(devpriv->mite); if (ret < 0) { - printk("error setting up mite\n"); + printk(KERN_WARNING "error setting up mite\n"); return ret; } dev->board_name = thisboard->name; dev->irq = mite_irq(devpriv->mite); - printk(" %s", dev->board_name); + printk(KERN_INFO " %s", dev->board_name); if (alloc_subdevices(dev, 2) < 0) return -ENOMEM; @@ -207,21 +207,22 @@ static int ni_670x_attach(struct comedi_device *dev, s->insn_bits = ni_670x_dio_insn_bits; s->insn_config = ni_670x_dio_insn_config; - writel(0x10, devpriv->mite->daq_io_addr + MISC_CONTROL_OFFSET); /* Config of misc registers */ - writel(0x00, devpriv->mite->daq_io_addr + AO_CONTROL_OFFSET); /* Config of ao registers */ + /* Config of misc registers */ + writel(0x10, devpriv->mite->daq_io_addr + MISC_CONTROL_OFFSET); + /* Config of ao registers */ + writel(0x00, devpriv->mite->daq_io_addr + AO_CONTROL_OFFSET); - printk("attached\n"); + printk(KERN_INFO "attached\n"); return 1; } static int ni_670x_detach(struct comedi_device *dev) { - printk("comedi%d: ni_670x: remove\n", dev->minor); + printk(KERN_INFO "comedi%d: ni_670x: remove\n", dev->minor); + + kfree(dev->subdevices[0].range_table_list); - if (dev->subdevices[0].range_table_list) { - kfree(dev->subdevices[0].range_table_list); - } if (dev->private && devpriv->mite) mite_unsetup(devpriv->mite); @@ -250,8 +251,11 @@ static int ni_670x_ao_winsn(struct comedi_device *dev, vch(15) : 30 | ich(31) : 31 */ for (i = 0; i < insn->n; i++) { - writel(((chan & 15) << 1) | ((chan & 16) >> 4), devpriv->mite->daq_io_addr + AO_CHAN_OFFSET); /* First write in channel register which channel to use */ - writel(data[i], devpriv->mite->daq_io_addr + AO_VALUE_OFFSET); /* write channel value */ + /* First write in channel register which channel to use */ + writel(((chan & 15) << 1) | ((chan & 16) >> 4), + devpriv->mite->daq_io_addr + AO_CHAN_OFFSET); + /* write channel value */ + writel(data[i], devpriv->mite->daq_io_addr + AO_VALUE_OFFSET); devpriv->ao_readback[chan] = data[i]; } @@ -344,7 +348,7 @@ static int ni_670x_find_device(struct comedi_device *dev, int bus, int slot) } } } - printk("no device found\n"); + printk(KERN_INFO "no device found\n"); mite_list_devices(); return -EIO; } diff --git a/drivers/staging/comedi/drivers/ni_atmio.c b/drivers/staging/comedi/drivers/ni_atmio.c index 8ead31164d5c..003d00b595b0 100644 --- a/drivers/staging/comedi/drivers/ni_atmio.c +++ b/drivers/staging/comedi/drivers/ni_atmio.c @@ -329,11 +329,11 @@ static uint16_t ni_atmio_win_in(struct comedi_device *dev, int addr) } static struct pnp_device_id device_ids[] = { - {.id = "NIC1900",.driver_data = 0}, - {.id = "NIC2400",.driver_data = 0}, - {.id = "NIC2500",.driver_data = 0}, - {.id = "NIC2600",.driver_data = 0}, - {.id = "NIC2700",.driver_data = 0}, + {.id = "NIC1900", .driver_data = 0}, + {.id = "NIC2400", .driver_data = 0}, + {.id = "NIC2500", .driver_data = 0}, + {.id = "NIC2600", .driver_data = 0}, + {.id = "NIC2700", .driver_data = 0}, {.id = ""} }; @@ -362,9 +362,9 @@ static int ni_atmio_detach(struct comedi_device *dev) if (dev->iobase) release_region(dev->iobase, NI_SIZE); - if (dev->irq) { + if (dev->irq) free_irq(dev->irq, dev); - } + if (devpriv->isapnp_dev) pnp_device_detach(devpriv->isapnp_dev); @@ -387,8 +387,8 @@ static int ni_isapnp_find_board(struct pnp_dev **dev) if (pnp_device_attach(isapnp_dev) < 0) { printk - ("ni_atmio: %s found but already active, skipping.\n", - ni_boards[i].name); + ("ni_atmio: %s found but already active, skipping.\n", + ni_boards[i].name); continue; } if (pnp_activate_dev(isapnp_dev) < 0) { @@ -496,9 +496,9 @@ static int ni_atmio_attach(struct comedi_device *dev, /* generic E series stuff in ni_mio_common.c */ ret = ni_E_init(dev, it); - if (ret < 0) { + if (ret < 0) return ret; - } + return 0; } @@ -509,16 +509,16 @@ static int ni_getboardtype(struct comedi_device *dev) int i; for (i = 0; i < n_ni_boards; i++) { - if (ni_boards[i].device_id == device_id) { + if (ni_boards[i].device_id == device_id) return i; - } + } - if (device_id == 255) { + if (device_id == 255) printk(" can't find board\n"); - } else if (device_id == 0) { + else if (device_id == 0) printk(" EEPROM read error (?) or device not found\n"); - } else { + else printk(" unknown device ID %d -- contact author\n", device_id); - } + return -1; } diff --git a/drivers/staging/comedi/drivers/ni_labpc.c b/drivers/staging/comedi/drivers/ni_labpc.c index dc3f398cb3ed..0a92cba3a713 100644 --- a/drivers/staging/comedi/drivers/ni_labpc.c +++ b/drivers/staging/comedi/drivers/ni_labpc.c @@ -483,12 +483,10 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase, printk("comedi%d: ni_labpc: %s, io 0x%lx", dev->minor, thisboard->name, iobase); - if (irq) { + if (irq) printk(", irq %u", irq); - } - if (dma_chan) { + if (dma_chan) printk(", dma %u", dma_chan); - } printk("\n"); if (iobase == 0) { @@ -1503,7 +1501,7 @@ static void handle_isa_dma(struct comedi_device *dev) devpriv->write_byte(0x1, dev->iobase + DMATC_CLEAR_REG); } -/* makes sure all data aquired by board is transfered to comedi (used +/* makes sure all data acquired by board is transfered to comedi (used * when aquisition is terminated by stop_src == TRIG_EXT). */ static void labpc_drain_dregs(struct comedi_device *dev) { diff --git a/drivers/staging/comedi/drivers/pcl711.c b/drivers/staging/comedi/drivers/pcl711.c index 4914784f6995..a499f7070f72 100644 --- a/drivers/staging/comedi/drivers/pcl711.c +++ b/drivers/staging/comedi/drivers/pcl711.c @@ -207,11 +207,10 @@ static irqreturn_t pcl711_interrupt(int irq, void *d) /* FIXME! Nothing else sets ntrig! */ if (!(--devpriv->ntrig)) { - if (this_board->is_8112) { + if (this_board->is_8112) outb(1, dev->iobase + PCL711_MODE); - } else { + else outb(0, dev->iobase + PCL711_MODE); - } s->async->events |= COMEDI_CB_EOA; } @@ -232,15 +231,15 @@ static void pcl711_set_changain(struct comedi_device *dev, int chan) /* * Set the correct channel. The two channel banks are switched * using the mask value. - * NB: To use differential channels, you should use mask = 0x30, - * but I haven't written the support for this yet. /JJ + * NB: To use differential channels, you should use + * mask = 0x30, but I haven't written the support for this + * yet. /JJ */ - if (chan_register >= 8) { + if (chan_register >= 8) chan_register = 0x20 | (chan_register & 0x7); - } else { + else chan_register |= 0x10; - } } else { outb(chan_register, dev->iobase + PCL711_MUX); } @@ -256,15 +255,13 @@ static int pcl711_ai_insn(struct comedi_device *dev, struct comedi_subdevice *s, for (n = 0; n < insn->n; n++) { /* - * Write the correct mode (software polling) and start polling by writing - * to the trigger register + * Write the correct mode (software polling) and start polling + * by writing to the trigger register */ outb(1, dev->iobase + PCL711_MODE); - if (this_board->is_8112) { - } else { + if (!this_board->is_8112) outb(0, dev->iobase + PCL711_SOFTTRIG); - } i = PCL711_TIMEOUT; while (--i) { @@ -462,9 +459,8 @@ static int pcl711_ao_insn_read(struct comedi_device *dev, int n; int chan = CR_CHAN(insn->chanspec); - for (n = 0; n < insn->n; n++) { + for (n = 0; n < insn->n; n++) data[n] = devpriv->ao_readback[chan]; - } return n; @@ -619,9 +615,8 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it) this is the "base value" for the mode register, which is used for the irq on the PCL711 */ - if (this_board->is_pcl711b) { + if (this_board->is_pcl711b) devpriv->mode = (dev->irq << 4); - } /* clear DAC */ outb(0, dev->iobase + PCL711_DA0_LO); diff --git a/drivers/staging/comedi/drivers/pcl724.c b/drivers/staging/comedi/drivers/pcl724.c index df1f4ef14616..0f103c328064 100644 --- a/drivers/staging/comedi/drivers/pcl724.c +++ b/drivers/staging/comedi/drivers/pcl724.c @@ -17,7 +17,7 @@ [0] - IO Base [1] - IRQ (0=disable IRQ) IRQ isn't supported at this time! [2] -number of DIO: - 0, 144: 144 DIO configuration + 0, 144: 144 DIO configuration 1, 96: 96 DIO configuration */ /* @@ -137,8 +137,8 @@ static int pcl724_attach(struct comedi_device *dev, struct comedi_devconfig *it) iorange = this_board->io_range; if ((this_board->can_have96) && ((it->options[1] == 1) || (it->options[1] == 96))) - iorange = PCL722_96_SIZE; /* PCL-724 in 96 DIO configuration */ - printk("comedi%d: pcl724: board=%s, 0x%03lx ", dev->minor, + iorange = PCL722_96_SIZE; /* PCL-724 in 96 DIO configuration */ + printk(KERN_INFO "comedi%d: pcl724: board=%s, 0x%03lx ", dev->minor, this_board->name, iobase); if (!request_region(iobase, iorange, "pcl724")) { printk("I/O port conflict\n"); @@ -155,16 +155,16 @@ static int pcl724_attach(struct comedi_device *dev, struct comedi_devconfig *it) irq = it->options[1]; if (irq) { /* we want to use IRQ */ if (((1 << irq) & this_board->IRQbits) == 0) { - printk - (", IRQ %u is out of allowed range, DISABLING IT", - irq); + printk(KERN_WARNING + ", IRQ %u is out of allowed range, " + "DISABLING IT", irq); irq = 0; /* Bad IRQ */ } else { if (request_irq (irq, interrupt_pcl724, 0, "pcl724", dev)) { - printk - (", unable to allocate IRQ %u, DISABLING IT", - irq); + printk(KERN_WARNING + ", unable to allocate IRQ %u, " + "DISABLING IT", irq); irq = 0; /* Can't use IRQ */ } else { printk(", irq=%u", irq); @@ -207,16 +207,14 @@ static int pcl724_detach(struct comedi_device *dev) { int i; -/* printk("comedi%d: pcl724: remove\n",dev->minor); */ + /* printk("comedi%d: pcl724: remove\n",dev->minor); */ - for (i = 0; i < dev->n_subdevices; i++) { + for (i = 0; i < dev->n_subdevices; i++) subdev_8255_cleanup(dev, dev->subdevices + i); - } #ifdef PCL724_IRQ - if (dev->irq) { + if (dev->irq) free_irq(dev->irq, dev); - } #endif release_region(dev->iobase, this_board->io_range); diff --git a/drivers/staging/comedi/drivers/pcl725.c b/drivers/staging/comedi/drivers/pcl725.c index 1da4941fce49..60261f4ba5b4 100644 --- a/drivers/staging/comedi/drivers/pcl725.c +++ b/drivers/staging/comedi/drivers/pcl725.c @@ -66,7 +66,7 @@ static int pcl725_attach(struct comedi_device *dev, struct comedi_devconfig *it) unsigned long iobase; iobase = it->options[0]; - printk("comedi%d: pcl725: 0x%04lx ", dev->minor, iobase); + printk(KERN_INFO "comedi%d: pcl725: 0x%04lx ", dev->minor, iobase); if (!request_region(iobase, PCL725_SIZE, "pcl725")) { printk("I/O port conflict\n"); return -EIO; @@ -96,14 +96,14 @@ static int pcl725_attach(struct comedi_device *dev, struct comedi_devconfig *it) s->insn_bits = pcl725_di_insn; s->range_table = &range_digital; - printk("\n"); + printk(KERN_INFO "\n"); return 0; } static int pcl725_detach(struct comedi_device *dev) { - printk("comedi%d: pcl725: remove\n", dev->minor); + printk(KERN_INFO "comedi%d: pcl725: remove\n", dev->minor); if (dev->iobase) release_region(dev->iobase, PCL725_SIZE); diff --git a/drivers/staging/comedi/drivers/pcl730.c b/drivers/staging/comedi/drivers/pcl730.c index c9859c90c152..e5e7bed21de0 100644 --- a/drivers/staging/comedi/drivers/pcl730.c +++ b/drivers/staging/comedi/drivers/pcl730.c @@ -99,7 +99,7 @@ static int pcl730_attach(struct comedi_device *dev, struct comedi_devconfig *it) iobase = it->options[0]; iorange = this_board->io_range; - printk("comedi%d: pcl730: board=%s 0x%04lx ", dev->minor, + printk(KERN_INFO "comedi%d: pcl730: board=%s 0x%04lx ", dev->minor, this_board->name, iobase); if (!request_region(iobase, iorange, "pcl730")) { printk("I/O port conflict\n"); @@ -152,14 +152,14 @@ static int pcl730_attach(struct comedi_device *dev, struct comedi_devconfig *it) s->range_table = &range_digital; s->private = (void *)PCL730_DIO_LO; - printk("\n"); + printk(KERN_INFO "\n"); return 0; } static int pcl730_detach(struct comedi_device *dev) { - printk("comedi%d: pcl730: remove\n", dev->minor); + printk(KERN_INFO "comedi%d: pcl730: remove\n", dev->minor); if (dev->iobase) release_region(dev->iobase, this_board->io_range); diff --git a/drivers/staging/comedi/drivers/pcl812.c b/drivers/staging/comedi/drivers/pcl812.c index 0a5bc3d6da8c..d4634c4f02dc 100644 --- a/drivers/staging/comedi/drivers/pcl812.c +++ b/drivers/staging/comedi/drivers/pcl812.c @@ -955,6 +955,7 @@ static irqreturn_t interrupt_pcl812_ai_int(int irq, void *d) unsigned int mask, timeout; struct comedi_device *dev = d; struct comedi_subdevice *s = dev->subdevices + 0; + unsigned int next_chan; s->async->events = 0; @@ -993,9 +994,18 @@ static irqreturn_t interrupt_pcl812_ai_int(int irq, void *d) ((inb(dev->iobase + PCL812_AD_HI) << 8) | inb(dev->iobase + PCL812_AD_LO)) & mask); + /* Set up next channel. Added by abbotti 2010-01-20, but untested. */ + next_chan = s->async->cur_chan + 1; + if (next_chan >= devpriv->ai_n_chan) + next_chan = 0; + if (devpriv->ai_chanlist[s->async->cur_chan] != + devpriv->ai_chanlist[next_chan]) + setup_range_channel(dev, s, devpriv->ai_chanlist[next_chan], 0); + outb(0, dev->iobase + PCL812_CLRINT); /* clear INT request */ - if (s->async->cur_chan == 0) { /* one scan done */ + s->async->cur_chan = next_chan; + if (next_chan == 0) { /* one scan done */ devpriv->ai_act_scan++; if (!(devpriv->ai_neverending)) if (devpriv->ai_act_scan >= devpriv->ai_scans) { /* all data sampled */ @@ -1021,7 +1031,9 @@ static void transfer_from_dma_buf(struct comedi_device *dev, for (i = len; i; i--) { comedi_buf_put(s->async, ptr[bufptr++]); /* get one sample */ - if (s->async->cur_chan == 0) { + s->async->cur_chan++; + if (s->async->cur_chan >= devpriv->ai_n_chan) { + s->async->cur_chan = 0; devpriv->ai_act_scan++; if (!devpriv->ai_neverending) if (devpriv->ai_act_scan >= devpriv->ai_scans) { /* all data sampled */ diff --git a/drivers/staging/comedi/drivers/pcl816.c b/drivers/staging/comedi/drivers/pcl816.c index 852fe2458fdc..9820759ec54f 100644 --- a/drivers/staging/comedi/drivers/pcl816.c +++ b/drivers/staging/comedi/drivers/pcl816.c @@ -202,6 +202,7 @@ struct pcl816_private { unsigned int ai_act_chanlist[16]; /* MUX setting for actual AI operations */ unsigned int ai_act_chanlist_len; /* how long is actual MUX list */ unsigned int ai_act_chanlist_pos; /* actual position in MUX list */ + unsigned int ai_n_chan; /* how many channels per scan */ unsigned int ai_poll_ptr; /* how many sampes transfer poll */ struct comedi_subdevice *sub_ai; /* ptr to AI subdevice */ #ifdef unused @@ -213,9 +214,12 @@ struct pcl816_private { /* ============================================================================== */ -static int check_and_setup_channel_list(struct comedi_device *dev, - struct comedi_subdevice *s, - unsigned int *chanlist, int chanlen); +static int check_channel_list(struct comedi_device *dev, + struct comedi_subdevice *s, + unsigned int *chanlist, unsigned int chanlen); +static void setup_channel_list(struct comedi_device *dev, + struct comedi_subdevice *s, + unsigned int *chanlist, unsigned int seglen); static int pcl816_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s); static void start_pacer(struct comedi_device *dev, int mode, @@ -320,7 +324,9 @@ static irqreturn_t interrupt_pcl816_ai_mode13_int(int irq, void *d) if (++devpriv->ai_act_chanlist_pos >= devpriv->ai_act_chanlist_len) devpriv->ai_act_chanlist_pos = 0; - if (s->async->cur_chan == 0) { + s->async->cur_chan++; + if (s->async->cur_chan >= devpriv->ai_n_chan) { + s->async->cur_chan = 0; devpriv->ai_act_scan++; } @@ -353,6 +359,11 @@ static void transfer_from_dma_buf(struct comedi_device *dev, if (++devpriv->ai_act_chanlist_pos >= devpriv->ai_act_chanlist_len) { devpriv->ai_act_chanlist_pos = 0; + } + + s->async->cur_chan++; + if (s->async->cur_chan >= devpriv->ai_n_chan) { + s->async->cur_chan = 0; devpriv->ai_act_scan++; } @@ -558,14 +569,6 @@ static int pcl816_ai_cmdtest(struct comedi_device *dev, } } - if (!cmd->chanlist_len) { - cmd->chanlist_len = 1; - err++; - } - if (cmd->chanlist_len > this_board->n_aichan) { - cmd->chanlist_len = this_board->n_aichan; - err++; - } if (cmd->scan_end_arg != cmd->chanlist_len) { cmd->scan_end_arg = cmd->chanlist_len; err++; @@ -603,6 +606,14 @@ static int pcl816_ai_cmdtest(struct comedi_device *dev, return 4; } + /* step 5: complain about special chanlist considerations */ + + if (cmd->chanlist) { + if (!check_channel_list(dev, s, cmd->chanlist, + cmd->chanlist_len)) + return 5; /* incorrect channels list */ + } + return 0; } @@ -610,6 +621,7 @@ static int pcl816_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) { unsigned int divisor1 = 0, divisor2 = 0, dma_flags, bytes, dmairq; struct comedi_cmd *cmd = &s->async->cmd; + unsigned int seglen; if (cmd->start_src != TRIG_NOW) return -EINVAL; @@ -642,11 +654,13 @@ static int pcl816_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) start_pacer(dev, -1, 0, 0); /* stop pacer */ - if (!check_and_setup_channel_list(dev, s, cmd->chanlist, - cmd->chanlist_len)) + seglen = check_channel_list(dev, s, cmd->chanlist, cmd->chanlist_len); + if (seglen < 1) return -EINVAL; + setup_channel_list(dev, s, cmd->chanlist, seglen); udelay(1); + devpriv->ai_n_chan = cmd->chanlist_len; devpriv->ai_act_scan = 0; s->async->cur_chan = 0; devpriv->irq_blocked = 1; @@ -871,12 +885,12 @@ start_pacer(struct comedi_device *dev, int mode, unsigned int divisor1, /* ============================================================================== Check if channel list from user is builded correctly - If it's ok, then program scan/gain logic + If it's ok, then return non-zero length of repeated segment of channel list */ static int -check_and_setup_channel_list(struct comedi_device *dev, - struct comedi_subdevice *s, unsigned int *chanlist, - int chanlen) +check_channel_list(struct comedi_device *dev, + struct comedi_subdevice *s, unsigned int *chanlist, + unsigned int chanlen) { unsigned int chansegment[16]; unsigned int i, nowmustbechan, seglen, segpos; @@ -930,6 +944,20 @@ check_and_setup_channel_list(struct comedi_device *dev, seglen = 1; } + return seglen; /* we can serve this with MUX logic */ +} + +/* +============================================================================== + Program scan/gain logic with channel list. +*/ +static void +setup_channel_list(struct comedi_device *dev, + struct comedi_subdevice *s, unsigned int *chanlist, + unsigned int seglen) +{ + unsigned int i; + devpriv->ai_act_chanlist_len = seglen; devpriv->ai_act_chanlist_pos = 0; @@ -942,8 +970,6 @@ check_and_setup_channel_list(struct comedi_device *dev, udelay(1); outb(devpriv->ai_act_chanlist[0] | (devpriv->ai_act_chanlist[seglen - 1] << 4), dev->iobase + PCL816_MUX); /* select channel interval to scan */ - - return 1; /* we can serve this with MUX logic */ } #ifdef unused diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c index d0481013a837..c9d75385755d 100644 --- a/drivers/staging/comedi/drivers/pcl818.c +++ b/drivers/staging/comedi/drivers/pcl818.c @@ -557,8 +557,14 @@ conv_finish: comedi_event(dev, s); return IRQ_HANDLED; } - if (s->async->cur_chan == 0) { + devpriv->act_chanlist_pos++; + if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len) { + devpriv->act_chanlist_pos = 0; + } + s->async->cur_chan++; + if (s->async->cur_chan >= devpriv->ai_n_chan) { /* printk("E"); */ + s->async->cur_chan = 0; devpriv->ai_act_scan--; } @@ -627,9 +633,13 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, void *d) devpriv->act_chanlist_pos++; if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len) { - devpriv->ai_act_scan--; devpriv->act_chanlist_pos = 0; } + s->async->cur_chan++; + if (s->async->cur_chan >= devpriv->ai_n_chan) { + s->async->cur_chan = 0; + devpriv->ai_act_scan--; + } if (!devpriv->neverending_ai) if (devpriv->ai_act_scan == 0) { /* all data sampled */ @@ -717,7 +727,14 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma_rtc(int irq, void *d) comedi_buf_put(s->async, dmabuf[bufptr++] >> 4); /* get one sample */ bufptr &= (devpriv->dmasamplsize - 1); - if (s->async->cur_chan == 0) { + devpriv->act_chanlist_pos++; + if (devpriv->act_chanlist_pos >= + devpriv->act_chanlist_len) { + devpriv->act_chanlist_pos = 0; + } + s->async->cur_chan++; + if (s->async->cur_chan >= devpriv->ai_n_chan) { + s->async->cur_chan = 0; devpriv->ai_act_scan--; } @@ -796,7 +813,13 @@ static irqreturn_t interrupt_pcl818_ai_mode13_fifo(int irq, void *d) comedi_buf_put(s->async, (lo >> 4) | (inb(dev->iobase + PCL818_FI_DATAHI) << 4)); /* get one sample */ - if (s->async->cur_chan == 0) { + devpriv->act_chanlist_pos++; + if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len) { + devpriv->act_chanlist_pos = 0; + } + s->async->cur_chan++; + if (s->async->cur_chan >= devpriv->ai_n_chan) { + s->async->cur_chan = 0; devpriv->ai_act_scan--; } @@ -1369,14 +1392,6 @@ static int ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, } } - if (!cmd->chanlist_len) { - cmd->chanlist_len = 1; - err++; - } - if (cmd->chanlist_len > s->n_chan) { - cmd->chanlist_len = s->n_chan; - err++; - } if (cmd->scan_end_arg != cmd->chanlist_len) { cmd->scan_end_arg = cmd->chanlist_len; err++; diff --git a/drivers/staging/comedi/drivers/pcm3724.c b/drivers/staging/comedi/drivers/pcm3724.c index 52811824b05a..ed6103079232 100644 --- a/drivers/staging/comedi/drivers/pcm3724.c +++ b/drivers/staging/comedi/drivers/pcm3724.c @@ -121,25 +121,22 @@ static int compute_buffer(int config, int devno, struct comedi_subdevice *s) { /* 1 in io_bits indicates output */ if (s->io_bits & 0x0000ff) { - if (devno == 0) { + if (devno == 0) config |= BUF_A0; - } else { + else config |= BUF_A1; - } } if (s->io_bits & 0x00ff00) { - if (devno == 0) { + if (devno == 0) config |= BUF_B0; - } else { + else config |= BUF_B1; - } } if (s->io_bits & 0xff0000) { - if (devno == 0) { + if (devno == 0) config |= BUF_C0; - } else { + else config |= BUF_C1; - } } return config; } @@ -155,26 +152,27 @@ static void do_3724_config(struct comedi_device *dev, buffer_config = 0; /* 1 in io_bits indicates output, 1 in config indicates input */ - if (!(s->io_bits & 0x0000ff)) { + if (!(s->io_bits & 0x0000ff)) config |= CR_A_IO; - } - if (!(s->io_bits & 0x00ff00)) { + + if (!(s->io_bits & 0x00ff00)) config |= CR_B_IO; - } - if (!(s->io_bits & 0xff0000)) { + + if (!(s->io_bits & 0xff0000)) config |= CR_C_IO; - } buffer_config = compute_buffer(0, 0, dev->subdevices); buffer_config = compute_buffer(buffer_config, 1, (dev->subdevices) + 1); - if (s == dev->subdevices) { + if (s == dev->subdevices) port_8255_cfg = dev->iobase + _8255_CR; - } else { + else port_8255_cfg = dev->iobase + SIZE_8255 + _8255_CR; - } + outb(buffer_config, dev->iobase + 8); /* update buffer register */ - /* printk("pcm3724 buffer_config (%lx) %d, %x\n", dev->iobase + _8255_CR, chanspec, buffer_config); */ + /* printk("pcm3724 buffer_config (%lx) %d, %x\n", + dev->iobase + _8255_CR, chanspec, buffer_config); */ + outb(config, port_8255_cfg); } @@ -189,29 +187,29 @@ static void enable_chan(struct comedi_device *dev, struct comedi_subdevice *s, priv = (struct priv_pcm3724 *)(dev->private); mask = 1 << CR_CHAN(chanspec); - if (s == dev->subdevices) { /* subdev 0 */ + if (s == dev->subdevices) /* subdev 0 */ priv->dio_1 |= mask; - } else { /* subdev 1 */ + else /* subdev 1 */ priv->dio_2 |= mask; - } - if (priv->dio_1 & 0xff0000) { + + if (priv->dio_1 & 0xff0000) gatecfg |= GATE_C0; - } - if (priv->dio_1 & 0xff00) { + + if (priv->dio_1 & 0xff00) gatecfg |= GATE_B0; - } - if (priv->dio_1 & 0xff) { + + if (priv->dio_1 & 0xff) gatecfg |= GATE_A0; - } - if (priv->dio_2 & 0xff0000) { + + if (priv->dio_2 & 0xff0000) gatecfg |= GATE_C1; - } - if (priv->dio_2 & 0xff00) { + + if (priv->dio_2 & 0xff00) gatecfg |= GATE_B1; - } - if (priv->dio_2 & 0xff) { + + if (priv->dio_2 & 0xff) gatecfg |= GATE_A1; - } + /* printk("gate control %x\n", gatecfg); */ outb(gatecfg, dev->iobase + 9); } @@ -225,15 +223,14 @@ static int subdev_3724_insn_config(struct comedi_device *dev, unsigned int bits; mask = 1 << CR_CHAN(insn->chanspec); - if (mask & 0x0000ff) { + if (mask & 0x0000ff) bits = 0x0000ff; - } else if (mask & 0x00ff00) { + else if (mask & 0x00ff00) bits = 0x00ff00; - } else if (mask & 0x0f0000) { + else if (mask & 0x0f0000) bits = 0x0f0000; - } else { + else bits = 0xf00000; - } switch (data[0]) { case INSN_CONFIG_DIO_INPUT: @@ -272,7 +269,7 @@ static int pcm3724_attach(struct comedi_device *dev, ((struct priv_pcm3724 *)(dev->private))->dio_1 = 0; ((struct priv_pcm3724 *)(dev->private))->dio_2 = 0; - printk("comedi%d: pcm3724: board=%s, 0x%03lx ", dev->minor, + printk(KERN_INFO "comedi%d: pcm3724: board=%s, 0x%03lx ", dev->minor, this_board->name, iobase); if (!iobase || !request_region(iobase, iorange, "pcm3724")) { printk("I/O port conflict\n"); @@ -281,7 +278,7 @@ static int pcm3724_attach(struct comedi_device *dev, dev->iobase = iobase; dev->board_name = this_board->name; - printk("\n"); + printk(KERN_INFO "\n"); n_subdevices = this_board->numofports; @@ -302,13 +299,11 @@ static int pcm3724_detach(struct comedi_device *dev) int i; if (dev->subdevices) { - for (i = 0; i < dev->n_subdevices; i++) { + for (i = 0; i < dev->n_subdevices; i++) subdev_8255_cleanup(dev, dev->subdevices + i); - } } - if (dev->iobase) { + if (dev->iobase) release_region(dev->iobase, this_board->io_range); - } return 0; } diff --git a/drivers/staging/comedi/drivers/pcm3730.c b/drivers/staging/comedi/drivers/pcm3730.c index 9e4adbd89dda..22b7aae63add 100644 --- a/drivers/staging/comedi/drivers/pcm3730.c +++ b/drivers/staging/comedi/drivers/pcm3730.c @@ -73,7 +73,7 @@ static int pcm3730_attach(struct comedi_device *dev, unsigned long iobase; iobase = it->options[0]; - printk("comedi%d: pcm3730: 0x%04lx ", dev->minor, iobase); + printk(KERN_INFO "comedi%d: pcm3730: 0x%04lx ", dev->minor, iobase); if (!request_region(iobase, PCM3730_SIZE, "pcm3730")) { printk("I/O port conflict\n"); return -EIO; @@ -140,14 +140,14 @@ static int pcm3730_attach(struct comedi_device *dev, s->range_table = &range_digital; s->private = (void *)PCM3730_DIC; - printk("\n"); + printk(KERN_INFO "\n"); return 0; } static int pcm3730_detach(struct comedi_device *dev) { - printk("comedi%d: pcm3730: remove\n", dev->minor); + printk(KERN_INFO "comedi%d: pcm3730: remove\n", dev->minor); if (dev->iobase) release_region(dev->iobase, PCM3730_SIZE); diff --git a/drivers/staging/comedi/drivers/pcmad.c b/drivers/staging/comedi/drivers/pcmad.c index acac67090810..44ed777599c4 100644 --- a/drivers/staging/comedi/drivers/pcmad.c +++ b/drivers/staging/comedi/drivers/pcmad.c @@ -34,11 +34,11 @@ Configuration options: [0] - I/O port base [1] - unused [2] - Analog input reference - 0 = single ended - 1 = differential + 0 = single ended + 1 = differential [3] - Analog input encoding (must match jumpers) - 0 = straight binary - 1 = two's complement + 0 = straight binary + 1 = two's complement */ #include <linux/interrupt.h> @@ -113,9 +113,8 @@ static int pcmad_ai_insn_read(struct comedi_device *dev, data[n] = inb(dev->iobase + PCMAD_LSB); data[n] |= (inb(dev->iobase + PCMAD_MSB) << 8); - if (devpriv->twos_comp) { + if (devpriv->twos_comp) data[n] ^= (1 << (this_board->n_ai_bits - 1)); - } } return n; @@ -135,11 +134,12 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it) unsigned long iobase; iobase = it->options[0]; - printk("comedi%d: pcmad: 0x%04lx ", dev->minor, iobase); + printk(KERN_NOTICE "comedi%d: pcmad: 0x%04lx ", dev->minor, iobase); if (!request_region(iobase, PCMAD_SIZE, "pcmad")) { - printk("I/O port conflict\n"); + printk(KERN_CONT "I/O port conflict\n"); return -EIO; } + printk(KERN_CONT "\n"); dev->iobase = iobase; ret = alloc_subdevices(dev, 1); @@ -166,11 +166,10 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it) static int pcmad_detach(struct comedi_device *dev) { - printk("comedi%d: pcmad: remove\n", dev->minor); + printk(KERN_NOTICE "comedi%d: pcmad: remove\n", dev->minor); - if (dev->irq) { + if (dev->irq) free_irq(dev->irq, dev); - } if (dev->iobase) release_region(dev->iobase, PCMAD_SIZE); diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c index 35ba93989a36..6ca4105610c1 100644 --- a/drivers/staging/comedi/drivers/pcmmio.c +++ b/drivers/staging/comedi/drivers/pcmmio.c @@ -550,7 +550,7 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it) if (irq[0]) { printk("irq: %u ", irq[0]); - if (irq[1] && thisboard->dio_num_asics == 2) + if (thisboard->dio_num_asics == 2 && irq[1]) printk("second ASIC irq: %u ", irq[1]); } else { printk("(IRQ mode disabled) "); diff --git a/drivers/staging/comedi/drivers/poc.c b/drivers/staging/comedi/drivers/poc.c index d23e588d0632..8990bf2fc186 100644 --- a/drivers/staging/comedi/drivers/poc.c +++ b/drivers/staging/comedi/drivers/poc.c @@ -122,22 +122,21 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it) unsigned int iosize; iobase = it->options[0]; - printk("comedi%d: poc: using %s iobase 0x%lx\n", dev->minor, + printk(KERN_INFO "comedi%d: poc: using %s iobase 0x%lx\n", dev->minor, this_board->name, iobase); dev->board_name = this_board->name; if (iobase == 0) { - printk("io base address required\n"); + printk(KERN_WARNING "io base address required\n"); return -EINVAL; } iosize = this_board->iosize; /* check if io addresses are available */ if (!request_region(iobase, iosize, "dac02")) { - printk - ("I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n", - iobase, iobase + iosize - 1); + printk(KERN_WARNING "I/O port conflict: failed to allocate " + "ports 0x%lx to 0x%lx\n", iobase, iobase + iosize - 1); return -EIO; } dev->iobase = iobase; @@ -156,9 +155,8 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it) s->insn_write = this_board->winsn; s->insn_read = this_board->rinsn; s->insn_bits = this_board->insnbits; - if (s->type == COMEDI_SUBD_AO || s->type == COMEDI_SUBD_DO) { + if (s->type == COMEDI_SUBD_AO || s->type == COMEDI_SUBD_DO) s->subdev_flags = SDF_WRITABLE; - } return 0; } @@ -169,7 +167,7 @@ static int poc_detach(struct comedi_device *dev) if (dev->iobase) release_region(dev->iobase, this_board->iosize); - printk("comedi%d: dac02: remove\n", dev->minor); + printk(KERN_INFO "comedi%d: dac02: remove\n", dev->minor); return 0; } diff --git a/drivers/staging/comedi/drivers/rti800.c b/drivers/staging/comedi/drivers/rti800.c index 2c9d05bd288c..028ed6f89c4c 100644 --- a/drivers/staging/comedi/drivers/rti800.c +++ b/drivers/staging/comedi/drivers/rti800.c @@ -32,22 +32,22 @@ Configuration options: [0] - I/O port base address [1] - IRQ [2] - A/D reference - 0 = differential - 1 = pseudodifferential (common) - 2 = single-ended + 0 = differential + 1 = pseudodifferential (common) + 2 = single-ended [3] - A/D range - 0 = [-10,10] - 1 = [-5,5] - 2 = [0,10] + 0 = [-10,10] + 1 = [-5,5] + 2 = [0,10] [4] - A/D encoding - 0 = two's complement - 1 = straight binary + 0 = two's complement + 1 = straight binary [5] - DAC 0 range - 0 = [-10,10] - 1 = [0,10] + 0 = [-10,10] + 1 = [0,10] [6] - DAC 0 encoding - 0 = two's complement - 1 = straight binary + 0 = two's complement + 1 = straight binary [7] - DAC 1 range (same as DAC 0) [8] - DAC 1 encoding (same as DAC 0) */ @@ -225,7 +225,7 @@ static int rti800_ai_insn_read(struct comedi_device *dev, for (t = RTI800_TIMEOUT; t; t--) { status = inb(dev->iobase + RTI800_CSR); if (status & RTI800_OVERRUN) { - printk("rti800: a/d overrun\n"); + printk(KERN_WARNING "rti800: a/d overrun\n"); outb(0, dev->iobase + RTI800_CLRFLAGS); return -EIO; } @@ -234,15 +234,14 @@ static int rti800_ai_insn_read(struct comedi_device *dev, udelay(1); } if (t == 0) { - printk("rti800: timeout\n"); + printk(KERN_WARNING "rti800: timeout\n"); return -ETIME; } data[i] = inb(dev->iobase + RTI800_ADCLO); data[i] |= (0xf & inb(dev->iobase + RTI800_ADCHI)) << 8; - if (devpriv->adc_coding == adc_2comp) { + if (devpriv->adc_coding == adc_2comp) data[i] ^= 0x800; - } } return i; @@ -271,9 +270,9 @@ static int rti800_ao_insn_write(struct comedi_device *dev, for (i = 0; i < insn->n; i++) { devpriv->ao_readback[chan] = d = data[i]; - if (devpriv->dac0_coding == dac_2comp) { + if (devpriv->dac0_coding == dac_2comp) d ^= 0x800; - } + outb(d & 0xff, dev->iobase + (chan ? RTI800_DAC1LO : RTI800_DAC0LO)); outb(d >> 8, @@ -315,15 +314,15 @@ static int rti800_do_insn_bits(struct comedi_device *dev, options[0] - I/O port options[1] - irq options[2] - a/d mux - 0=differential, 1=pseudodiff, 2=single + 0=differential, 1=pseudodiff, 2=single options[3] - a/d range - 0=bipolar10, 1=bipolar5, 2=unipolar10 + 0=bipolar10, 1=bipolar5, 2=unipolar10 options[4] - a/d coding - 0=2's comp, 1=straight binary + 0=2's comp, 1=straight binary options[5] - dac0 range - 0=bipolar10, 1=unipolar10 + 0=bipolar10, 1=unipolar10 options[6] - dac0 coding - 0=2's comp, 1=straight binary + 0=2's comp, 1=straight binary options[7] - dac1 range options[8] - dac1 coding */ @@ -336,15 +335,15 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it) struct comedi_subdevice *s; iobase = it->options[0]; - printk("comedi%d: rti800: 0x%04lx ", dev->minor, iobase); + printk(KERN_INFO "comedi%d: rti800: 0x%04lx\n", dev->minor, iobase); if (!request_region(iobase, RTI800_SIZE, "rti800")) { - printk("I/O port conflict\n"); + printk(KERN_WARNING "I/O port conflict\n"); return -EIO; } dev->iobase = iobase; #ifdef DEBUG - printk("fingerprint=%x,%x,%x,%x,%x ", + printk(KERN_DEBUG "fingerprint=%x,%x,%x,%x,%x ", inb(dev->iobase + 0), inb(dev->iobase + 1), inb(dev->iobase + 2), @@ -357,15 +356,15 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it) irq = it->options[1]; if (irq) { - printk("( irq = %u )", irq); + printk(KERN_INFO "( irq = %u )\n", irq); ret = request_irq(irq, rti800_interrupt, 0, "rti800", dev); if (ret < 0) { - printk(" Failed to allocate IRQ\n"); + printk(KERN_WARNING " Failed to allocate IRQ\n"); return ret; } dev->irq = irq; } else { - printk("( no irq )"); + printk(KERN_INFO "( no irq )\n"); } dev->board_name = this_board->name; @@ -461,14 +460,12 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it) s->type = COMEDI_SUBD_TIMER; #endif - printk("\n"); - return 0; } static int rti800_detach(struct comedi_device *dev) { - printk("comedi%d: rti800: remove\n", dev->minor); + printk(KERN_INFO "comedi%d: rti800: remove\n", dev->minor); if (dev->iobase) release_region(dev->iobase, RTI800_SIZE); diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index fdd7ab954d8c..a3cc93362ec2 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -140,7 +140,7 @@ struct s626_private { short allocatedBuf; uint8_t ai_cmd_running; /* ai_cmd is running */ uint8_t ai_continous; /* continous aquisition */ - int ai_sample_count; /* number of samples to aquire */ + int ai_sample_count; /* number of samples to acquire */ unsigned int ai_sample_timer; /* time between samples in units of the timer */ int ai_convert_count; /* conversion counter */ diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c index 9a1b559c4b0d..bcf46dab2052 100644 --- a/drivers/staging/comedi/drivers/usbdux.c +++ b/drivers/staging/comedi/drivers/usbdux.c @@ -289,7 +289,7 @@ struct usbduxsub { /* continous aquisition */ short int ai_continous; short int ao_continous; - /* number of samples to aquire */ + /* number of samples to acquire */ int ai_sample_count; int ao_sample_count; /* time between samples in units of the timer */ @@ -2833,7 +2833,7 @@ static struct comedi_driver driver_usbdux = { }; /* Table with the USB-devices: just now only testing IDs */ -static struct usb_device_id usbduxsub_table[] = { +static const struct usb_device_id usbduxsub_table[] = { {USB_DEVICE(0x13d8, 0x0001)}, {USB_DEVICE(0x13d8, 0x0002)}, {} /* Terminating entry */ diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c index 2e675cce7dbf..b96cf3b96fd3 100644 --- a/drivers/staging/comedi/drivers/usbduxfast.c +++ b/drivers/staging/comedi/drivers/usbduxfast.c @@ -182,7 +182,7 @@ struct usbduxfastsub_s { context */ short int ai_cmd_running; /* asynchronous command is running */ short int ai_continous; /* continous aquisition */ - long int ai_sample_count; /* number of samples to aquire */ + long int ai_sample_count; /* number of samples to acquire */ uint8_t *dux_commands; /* commands */ int ignore; /* counter which ignores the first buffers */ @@ -1769,7 +1769,7 @@ static struct comedi_driver driver_usbduxfast = { /* * Table with the USB-devices: just now only testing IDs */ -static struct usb_device_id usbduxfastsub_table[] = { +static const struct usb_device_id usbduxfastsub_table[] = { /* { USB_DEVICE(0x4b4, 0x8613) }, testing */ {USB_DEVICE(0x13d8, 0x0010)}, /* real ID */ {USB_DEVICE(0x13d8, 0x0011)}, /* real ID */ diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c index c34a0b9141e2..6479c38d0278 100644 --- a/drivers/staging/comedi/drivers/vmk80xx.c +++ b/drivers/staging/comedi/drivers/vmk80xx.c @@ -75,7 +75,7 @@ enum { DEVICE_VMK8061 }; -static struct usb_device_id vmk80xx_id_table[] = { +static const struct usb_device_id vmk80xx_id_table[] = { {USB_DEVICE(0x10cf, 0x5500), .driver_info = DEVICE_VMK8055}, {USB_DEVICE(0x10cf, 0x5501), .driver_info = DEVICE_VMK8055}, {USB_DEVICE(0x10cf, 0x5502), .driver_info = DEVICE_VMK8055}, |