Ian Abbott [Wed, 28 Nov 2007 14:48:18 +0000 (14:48 +0000)]
When stopping AO command, only stop timer if using it
(scan_begin_src==TRIG_TIMER).
Ian Abbott [Wed, 28 Nov 2007 11:12:17 +0000 (11:12 +0000)]
Release Z2-CT2 resource after AI command started if convert_src is neither
TRIG_TIMER nor TRIG_INT.
Ian Abbott [Tue, 27 Nov 2007 16:43:51 +0000 (16:43 +0000)]
Avoid using software conversion trigger as it doesn't work very well for
differential mode on some versions of PCI230/260. Use Z2 timer 2 output
instead and toggle the output in software to trigger a conversion. Note
that the ADC busy bit only works for software triggers in non-FIFO mode,
so for AI INSN_READ, use the FIFO and the FIFO status bits to check when
the conversion is complete.
Ian Abbott [Tue, 27 Nov 2007 13:17:02 +0000 (13:17 +0000)]
RTAI support was broken in comedi-0.7.75 due to missing RTAI_VERSION_CODE
and RTAI_MANGLE_VERSION in comedi/drivers/comedi_rt_timer.c.
Added #include <rtai_version.h> to include/linux/comedi_rt.h to fix it.
Ian Abbott [Tue, 27 Nov 2007 12:52:33 +0000 (12:52 +0000)]
Insert delay after AI internal conversion trigger (convert_src==TRIG_INT)
so we don't trigger more often than the hardware is capable of.
Ian Abbott [Mon, 26 Nov 2007 17:56:19 +0000 (17:56 +0000)]
Use programmable ADC FIFO interrupt trigger level and ADC FIFO level
registers on PCI230+/260+ to reduce number of interrupts required when
FIFO interrupt trigger level would otherwise be "trigger when not empty".
Bernd Porr [Sun, 25 Nov 2007 21:22:17 +0000 (21:22 +0000)]
Added PWM to the USBDUX. Also moved any synchronous commands to
EP1 which should reduce the latency dramatically because it is
single buffered which forces the host to wait (no race checks
needed anymore). The EP4 is now used for the PWM.
The bit patterns are generated in this driver
and the GPIF on the FX2 streams these automatically out through
the digital port.
Ian Abbott [Fri, 23 Nov 2007 17:09:08 +0000 (17:09 +0000)]
For AI command, allow scan_begin_src == EXT_TRIG for PCI260+ (but not PCI260).
It will use the EXTTRIG/EXTCONVCLK input on pin 17 instead of the PPIC0 input
that is used for PCI230.
Ian Abbott [Fri, 23 Nov 2007 16:47:44 +0000 (16:47 +0000)]
For AO command, support scan_begin_src == TRIG_INT. (Not terribly useful.)
Also, if scan_begin_src == TRIG_TIMER, make sure the timer gate is set high
to enable counting.
Ian Abbott [Fri, 23 Nov 2007 16:08:15 +0000 (16:08 +0000)]
For AI commands, support TRIG_INT for start_src, scan_begin_src and
convert_src, but not all at the same time.
Ian Abbott [Fri, 23 Nov 2007 15:05:16 +0000 (15:05 +0000)]
Increased maximum length of channel list for AI command to 256 to allow
a repeated subsequence of channels to be used with a reasonable number
of repeats. Can't make the maximum length too long or the generation of
N pulses using a monostable as a gate would generate too many pulses in
some circumstances.
Ian Abbott [Fri, 23 Nov 2007 14:55:04 +0000 (14:55 +0000)]
Support scan_begin_src == TRIG_TIMER for AI command, but not at same time
as AO command as it uses one of the same 8254 counters.
Also, gone back to using timer mode 3 (square wave) instead of mode 2 (pulse)
as it seems to induce less noise.
Ian Abbott [Fri, 23 Nov 2007 11:04:25 +0000 (11:04 +0000)]
Changed some macros. No functional changes.
Ian Abbott [Thu, 22 Nov 2007 18:20:20 +0000 (18:20 +0000)]
Overhauled setting up and handling of commands, internal timers, and
interrupts.
Frank Mori Hess [Wed, 21 Nov 2007 18:14:40 +0000 (18:14 +0000)]
Fixed offset for isolated digital input register on 1762.
Frank Mori Hess [Mon, 19 Nov 2007 22:42:33 +0000 (22:42 +0000)]
Added Jeremy Theler
Ian Abbott [Mon, 19 Nov 2007 12:26:41 +0000 (12:26 +0000)]
Changed types of some members of struct pci230_private and renamed 'ai_stop'
to 'ai_continuous' and 'ao_stop' to 'ao_continuous'. No functional changes.
Ian Abbott [Fri, 16 Nov 2007 14:34:46 +0000 (14:34 +0000)]
Reduced maximum speed (increased minimum period) for AO conversion
to 125 kHz (8000 ns).
Ian Abbott [Fri, 16 Nov 2007 14:07:55 +0000 (14:07 +0000)]
For ai_cmdtest, maximum AI convert rate depends on whether single-ended or
differential, and whether the card is a PCI230/260 or PCI230+/260+.
Ian Abbott [Fri, 16 Nov 2007 13:17:42 +0000 (13:17 +0000)]
Need to use 'do_div' macro for 64-bit division.
Ian Abbott [Thu, 15 Nov 2007 18:02:02 +0000 (18:02 +0000)]
For ai_cmdtest, check channel list starts with channel 0 if there is more
than one channel and the card is an older PCI230+ or PCI260+ with buggy
channel sequencing.
Ian Abbott [Thu, 15 Nov 2007 16:11:21 +0000 (16:11 +0000)]
Fix AI channel enables for AREF_DIFF if the hardware is PCI230+ or PCI260+
due to a difference in the way the register works between PCI230 and PCI230+
in differential mode.
Ian Abbott [Tue, 13 Nov 2007 12:01:08 +0000 (12:01 +0000)]
For AI command, when convert_src == TRIG_EXT, make interpretation of
convert_arg backwards compatible with previous versions if no flag bits
are set.
Frank Mori Hess [Mon, 12 Nov 2007 22:15:31 +0000 (22:15 +0000)]
Fixed sign error that prevented commands from aborting properly on
errors.
Ian Abbott [Mon, 12 Nov 2007 17:10:24 +0000 (17:10 +0000)]
Only added a comment.
Ian Abbott [Mon, 12 Nov 2007 16:45:45 +0000 (16:45 +0000)]
For AI command, changed interpretation of scan_begin_arg when scan_begin_src
is TRIG_EXT. Previously, 0 meant trigger on -ve edge, 1 meant +ve edge.
Now, the CR_INVERT flag is set to trigger on the -ve edge.
Ian Abbott [Mon, 12 Nov 2007 15:04:46 +0000 (15:04 +0000)]
The ADC half full flag flag and interrupt occurs at 2049 samples, not 2048
(i.e. it's an "over half full" flag since the FIFO size is 4096).
Ian Abbott [Mon, 12 Nov 2007 14:58:01 +0000 (14:58 +0000)]
Use arrays to look up ai gain bits and polarity.
Ian Abbott [Mon, 12 Nov 2007 14:16:05 +0000 (14:16 +0000)]
Stripped ".o" from driver name on "Driver:" line for consistency.
Ian Abbott [Mon, 12 Nov 2007 12:16:26 +0000 (12:16 +0000)]
For AI INSN_READ, check for out-of-range differential channel - only the
first half of the channel numbers can be used if analog ref is AREF_DIFF.
Frank Mori Hess [Sat, 10 Nov 2007 16:59:46 +0000 (16:59 +0000)]
Added new driver from jeremy theler <thelerg@ib.cnea.gov.ar> for
MicroAxial ADQ12-B.
Frank Mori Hess [Sat, 10 Nov 2007 16:53:17 +0000 (16:53 +0000)]
Adding trivial email address obfuscation, since some of the AUTHORS
files are linked to from the web page.
Ian Abbott [Fri, 9 Nov 2007 16:36:32 +0000 (16:36 +0000)]
In pci230_choose_clk_src(), widen the type of the comparison constant
6553600000 from ul to ull.
Ian Abbott [Fri, 9 Nov 2007 16:02:38 +0000 (16:02 +0000)]
Check channel lists in AI and AO cmdtest handlers if chanlist != NULL and
chanlist_len > 0.
Ian Abbott [Fri, 9 Nov 2007 15:39:24 +0000 (15:39 +0000)]
Minor line-length fixes.
Ian Abbott [Fri, 9 Nov 2007 15:23:42 +0000 (15:23 +0000)]
In cmdtest, use DPRINTK instead of comedi_error.
Ian Abbott [Fri, 9 Nov 2007 15:19:36 +0000 (15:19 +0000)]
For cmdtest, don't return 5 if chanlist_len == 0.
Ian Abbott [Fri, 9 Nov 2007 14:06:44 +0000 (14:06 +0000)]
For cmdtest, don't return error 5 if chanlist is NULL.
Ian Abbott [Fri, 9 Nov 2007 13:50:14 +0000 (13:50 +0000)]
For COMEDI_CMD ioctl, check chanlist_len > 0.
Ian Abbott [Fri, 9 Nov 2007 12:17:14 +0000 (12:17 +0000)]
I forgot to rename comedi_compat_ioctl_ function back to
comedi_compat_ioctl in the previous commit.
Ian Abbott [Fri, 9 Nov 2007 11:12:36 +0000 (11:12 +0000)]
Make the 'comedi_compat_ioctl' symbole a function (again) instead of a
macro (if HAVE_COMPAT_IOCTL is defined).
Ian Abbott [Thu, 8 Nov 2007 17:09:07 +0000 (17:09 +0000)]
Got rid of the timer subdevice as it was pretty useless and clashed with
the AO and AI subdevices. I may resurrect it as a counter subdevice at
some point.
Ian Abbott [Thu, 8 Nov 2007 17:02:36 +0000 (17:02 +0000)]
Use 64-bit ns value when determining clock source.
Ian Abbott [Thu, 8 Nov 2007 16:45:45 +0000 (16:45 +0000)]
Renamed pci_iobase to iobase1.
Ian Abbott [Thu, 8 Nov 2007 16:33:30 +0000 (16:33 +0000)]
Used specific constants for base addresses of 8254 and 8255 chips instead
of using the constants for the first channel of each.
Ian Abbott [Thu, 8 Nov 2007 16:21:40 +0000 (16:21 +0000)]
Eliminated clock source and divisor values from private data and combined
a few functions. Note: reading the period of the timer subdevice is now
even more broken than it was before, but I'm planning to remove it anyway
due to conflicts with the AI and AO subdevices.
Ian Abbott [Thu, 8 Nov 2007 15:35:24 +0000 (15:35 +0000)]
Renamed some macros. Now access the timebase values via a look-up table to
eliminate some switch statements.
Ian Abbott [Thu, 8 Nov 2007 11:51:16 +0000 (11:51 +0000)]
amplc_pci230.c whitespace changes / comment reformatting.
Ian Abbott [Thu, 8 Nov 2007 10:52:04 +0000 (10:52 +0000)]
Spelling correction in Description: line.
Ian Abbott [Wed, 7 Nov 2007 17:18:57 +0000 (17:18 +0000)]
Fix for 2.6.10 and earlier. Rename comedi_compat_ioctl function to
comedi_compat_ioctl_ and define comedi_compat_ioctl macro to access it.
The comedi_compat_ioctl macro expands to 0 for 2.6.10 and earlier
(HAVE_COMPAT_IOCTL undefined) so it tried to define a function called '0'!
Ian Abbott [Wed, 7 Nov 2007 16:24:47 +0000 (16:24 +0000)]
Removed a stray comment.
Ian Abbott [Wed, 7 Nov 2007 16:18:28 +0000 (16:18 +0000)]
Make sure 32-bit ioctl handler for <= 2.6.10 kernel doesn't return
-ENOIOCTLCMD.
Ian Abbott [Wed, 7 Nov 2007 16:03:15 +0000 (16:03 +0000)]
Support 32-bit ioctl calls on 64-bit kernel (CONFIG_COMPAT).
Ian Abbott [Mon, 5 Nov 2007 14:07:00 +0000 (14:07 +0000)]
Replaced INSN_CONFIG_8254_SET_MODE with INSN_CONFIG_SET_COUNTER_MODE.
Ian Abbott [Mon, 5 Nov 2007 11:50:11 +0000 (11:50 +0000)]
Inline fixes: define inline functions before calling them.
Some versions of gcc treat it as an error. Others will ignore the inline
in this case and compile in a function call.
Ian Abbott [Mon, 5 Nov 2007 11:47:53 +0000 (11:47 +0000)]
Made cfc_bytes_per_scan() 'static inline' instead of plain 'inline'.
Frank Mori Hess [Sun, 4 Nov 2007 04:33:49 +0000 (04:33 +0000)]
Applied comedi_indent script to all source files.
Frank Mori Hess [Sun, 4 Nov 2007 04:28:25 +0000 (04:28 +0000)]
Removed some dead code that was causing errors in indent program.
Frank Mori Hess [Sun, 4 Nov 2007 04:14:37 +0000 (04:14 +0000)]
Removed some dead code that confused the indent program.
Frank Mori Hess [Sun, 4 Nov 2007 04:08:58 +0000 (04:08 +0000)]
Removed a bit of ifdef'd out code that confuses the indent program.
Frank Mori Hess [Sun, 4 Nov 2007 03:45:53 +0000 (03:45 +0000)]
Added wrapper around indent utility with options I'm going to apply
to comedi source files.
Ian Abbott [Fri, 2 Nov 2007 11:11:17 +0000 (11:11 +0000)]
Security fix in comedi_buf_alloc() for non-DMA data buffers. Allocate each
page using get_zeroed_page() instead of __get_free_page() to avoid exposing
random memory contents to user space if the buffer is mmap'ed.
Ian Abbott [Thu, 1 Nov 2007 17:47:00 +0000 (17:47 +0000)]
Sanitize resource types. Use new comedi_pci_enable and comedi_pci_disable
functions instead of ad hoc calls to request_region and release_region.
Ian Abbott [Thu, 1 Nov 2007 16:14:53 +0000 (16:14 +0000)]
Removed tests for whether PCI device supports bus-mastering as can't tell
from PCI device structure.
Ian Abbott [Thu, 1 Nov 2007 16:11:15 +0000 (16:11 +0000)]
Removed kernel 2.2 and 2.4 compatibility.
Removed checks for whether PCI device supports mastering as can't tell from
PCI device structure.
Ian Abbott [Thu, 1 Nov 2007 15:39:26 +0000 (15:39 +0000)]
New wrapper functions in comedi/drivers/comedi_pci.h:
comedi_pci_enable() combines pci_enable_device() and pci_request_regions().
comedi_pci_disable() combines pci_release_regions() and pci_disable_device().
Does the right thing for reference-counted PCI enables in 2.6.20 onwards.
Ian Abbott [Wed, 31 Oct 2007 14:40:24 +0000 (14:40 +0000)]
Check result of subdev_8255_init().
Ian Abbott [Wed, 31 Oct 2007 14:15:22 +0000 (14:15 +0000)]
For PCI260(+) make subdevice 2 UNUSED instead of AO with no channels.
Ian Abbott [Wed, 31 Oct 2007 14:01:28 +0000 (14:01 +0000)]
Added pci230+ and pci260+. Currently they are treated same as pci230 and
pci260 apart from the increased number of bits on the AI subdevice. The
cards can also be configured as the old pci230 or pci260.
Ian Abbott [Tue, 30 Oct 2007 16:49:21 +0000 (16:49 +0000)]
Untested compatibility fix for change to rt_task_init in RTAI >= 3.3
(the context of the callback function changed from 'int' to 'long').
Ian Abbott [Tue, 30 Oct 2007 15:46:34 +0000 (15:46 +0000)]
#ifdef out floating point register stuff.
Ian Abbott [Mon, 29 Oct 2007 15:52:01 +0000 (15:52 +0000)]
Added PCI-DIO24 info supplied by Yoshiya Matsuzaka.
Its software interface is same as PCI-DIO24H but with a different PCI
device ID.
Frank Mori Hess [Mon, 29 Oct 2007 00:00:25 +0000 (00:00 +0000)]
Regenerated ChangeLog with "cvs2cl -t" for 0.7.75 release.
Frank Mori Hess [Sun, 28 Oct 2007 23:59:48 +0000 (23:59 +0000)]
Bumped version for 0.7.75 release
Frank Mori Hess [Fri, 26 Oct 2007 17:59:36 +0000 (17:59 +0000)]
Fixed compile warning on amd64.
Frank Mori Hess [Thu, 25 Oct 2007 20:00:47 +0000 (20:00 +0000)]
Don't report bogus gate errors on 660x boards.
Frank Mori Hess [Thu, 25 Oct 2007 19:56:22 +0000 (19:56 +0000)]
Added enum for setting master clock of NI "frequency output" subdevice.
Frank Mori Hess [Thu, 25 Oct 2007 19:55:41 +0000 (19:55 +0000)]
Added subdevice for "frequency output" pin.
Frank Mori Hess [Thu, 25 Oct 2007 19:49:14 +0000 (19:49 +0000)]
Added check against maxdata for write instructions.
Frank Mori Hess [Wed, 24 Oct 2007 21:29:10 +0000 (21:29 +0000)]
Each comedi_async struct should have its own wait_queue_head_t.
Frank Mori Hess [Wed, 24 Oct 2007 18:14:55 +0000 (18:14 +0000)]
Prevent glitches when transitioning from static control of dio lines
to waveform output.
Ian Abbott [Wed, 24 Oct 2007 12:37:39 +0000 (12:37 +0000)]
Allocate non-DMA buffer pages using __get_free_page(). (Use of virt_to_page
on vmalloc'd memory was incorrect and failed on x86_64 for example.)
Clean up fully on allocation failure.
Ian Abbott [Mon, 22 Oct 2007 14:59:55 +0000 (14:59 +0000)]
Check dev->attached in interrupt routine.
Ian Abbott [Mon, 22 Oct 2007 12:19:19 +0000 (12:19 +0000)]
Some 64-bit fixes.
Frank Mori Hess [Thu, 18 Oct 2007 21:50:25 +0000 (21:50 +0000)]
Fix from Torben Mikael Hansen <comedi_ns@linhard.dk> for crash probably
caused by my recent porting work.
Frank Mori Hess [Thu, 18 Oct 2007 21:48:55 +0000 (21:48 +0000)]
Patch from Torben Mikael Hansen <comedi_ns@linhard.dk> which adds device
id for PCM-DAS16s/16.
Frank Mori Hess [Thu, 18 Oct 2007 21:40:34 +0000 (21:40 +0000)]
Got rid of fragile checks of specific device ids in mite.c (fixed problems
with pxi-6602 support). Added device id for pxi-6608. Made sure the
"window base size register" is disabled when using the "window base size
register 1", since it causes problems if both are enabled simultaneously.
Ian Abbott [Thu, 18 Oct 2007 18:01:45 +0000 (18:01 +0000)]
Some changes to deal with interrupts before device fully attached.
Frank Mori Hess [Wed, 17 Oct 2007 20:01:56 +0000 (20:01 +0000)]
Added pci device id for pxi-6602.
Ian Abbott [Wed, 17 Oct 2007 15:26:59 +0000 (15:26 +0000)]
Replaced kmalloc/memset sequence with kzalloc or kcalloc.
Ian Abbott [Wed, 17 Oct 2007 15:24:40 +0000 (15:24 +0000)]
Replaced kmalloc/memset sequence with kzalloc or kcalloc.
Removed call to memset after alloc_subdevices to avoid clobbering spinlocks.
Frank Mori Hess [Tue, 16 Oct 2007 19:59:32 +0000 (19:59 +0000)]
Added support for scan_begin_src = TRIG_EXT on analog output commands.
Frank Mori Hess [Tue, 16 Oct 2007 02:21:02 +0000 (02:21 +0000)]
Ported to linux 2.6.23 pcmcia interface. Compiles, but otherwise untested.
Frank Mori Hess [Tue, 16 Oct 2007 02:09:09 +0000 (02:09 +0000)]
Ported to linux 2.6.23 pcmcia interface. Compiles, but otherwise untested.
Frank Mori Hess [Tue, 16 Oct 2007 00:35:23 +0000 (00:35 +0000)]
Ported to linux 2.6.23 pcmcia interface. Compiles, but otherwise untested.
Frank Mori Hess [Mon, 15 Oct 2007 01:15:09 +0000 (01:15 +0000)]
Updated to linux 2.6.23 pcmcia interface. Compiles, but untested.
Frank Mori Hess [Mon, 15 Oct 2007 01:02:12 +0000 (01:02 +0000)]
Updated to 2.6.23 pcmcia interface. Compiles, otherwise untested.
Frank Mori Hess [Mon, 15 Oct 2007 00:43:18 +0000 (00:43 +0000)]
More linux 2.6.23 pcmcia fixes.
Frank Mori Hess [Mon, 15 Oct 2007 00:08:27 +0000 (00:08 +0000)]
Updated to 2.6.23 kernel pcmcia interface. It compiles now, don't know
if it actually works.
Frank Mori Hess [Fri, 12 Oct 2007 19:04:43 +0000 (19:04 +0000)]
Pruned obsolete lseek code.