Re: [PATCH 04/13] staging: comedi: ni_routing: Add NI signal routing info

2018-09-21 Thread Ian Abbott
,\n"); + + ++i; + } + fprintf(fp, " },\n\n"); +} + +int main(void) +{ + int n_families = sizeof(all_route_values) / sizeof(void *); + int n_devices = sizeof(device_routes_list) / sizeof(void *); The more legitimate way to get the length o

Re: [PATCH] staging: comedi: ni_mio_common: protect register write overflow

2018-09-21 Thread Ian Abbott
urn 0; + } else if (chan == NISTC_RTSI_TRIG_OLD_CLK_CHAN) + return NI_RTSI_OUTPUT_RTSI_OSC; } + + dev_err(dev->class_dev, "%s: unknown rtsi channel\n", __func__); + return -EINVAL; } static int ni_rtsi_insn_config(struct comedi_devic

Re: [PATCH 00/13] device-global identifiers and routes introduced

2018-09-21 Thread Ian Abbott
especially time-critical for some reason). Best regards, Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park

Re: [PATCH 0/4] Add facility to directly query subdevice timing

2018-09-21 Thread Ian Abbott
| 1 + 7 files changed, 111 insertions(+), 1 deletion(-) Those all look great, thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=

Re: [PATCH 07/13] staging: comedi: ni_mio_common: implement global pfi,rtsi routing

2018-09-25 Thread Ian Abbott
N) { return NI_RTSI_OUTPUT_RTSI_OSC; } That is the hunk that failed to apply. The line numbers seem a bit off the original source, and the "} else if" part at the end didn't match at all. Perhaps you need to rebase? -- -=( Ian Abbott || Web: www.mev

Re: [PATCH 05/13] staging: comedi: add interface to ni routing table information

2018-09-25 Thread Ian Abbott
on (in the COMEDI_PCMCIA_DRIVERS menu) then the build breaks for the "ni_atmio" and/or "ni_mio_cs" modules. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park

Re: [PATCH 04/13] staging: comedi: ni_routing: Add NI signal routing info

2018-09-25 Thread Ian Abbott
values' are declared with external linkage, only "ni_routes" would be able to link to them if it is built as a loadable module. If "ni_routes" is built into the kernel image itself, then other code built into the kernel image would also

Re: [PATCH 07/13] staging: comedi: ni_mio_common: implement global pfi,rtsi routing

2018-09-26 Thread Ian Abbott
On 26/09/18 00:35, Spencer Olson wrote: On Tue, Sep 25, 2018 at 4:27 AM Ian Abbott wrote: On 19/09/18 17:38, Spencer E. Olson wrote: Implement device-global config interface for ni_mio devices. In particular, this patch implements: INSN_DEVICE_CONFIG_TEST_ROUTE

Re: [PATCH 05/13] staging: comedi: add interface to ni routing table information

2018-09-26 Thread Ian Abbott
also doesn't look like anything else depends on COMEDI_NI_TIO. That ought to work. And please don't top-post. :) -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=

Re: [PATCH 04/13] staging: comedi: ni_routing: Add NI signal routing info

2018-09-26 Thread Ian Abbott
On 26/09/18 02:49, Spencer Olson wrote: On Tue, Sep 25, 2018 at 6:26 AM Ian Abbott wrote: I never noticed that you sort the data on module load. You also have an exported function 'ni_sort_device_routes()' called internally by 'ni_sort_all_device_routes()' when the &

Re: [PATCH v2 05/13] staging: comedi: add interface to ni routing table information

2018-10-01 Thread Ian Abbott
if (!bsearch(&source, routes->src, routes->n_src, sizeof(int), +(cmp_ftype)_ni_bsearch_srccmp)) + return false; + return true; +} +EXPORT_SYMBOL_GPL(ni_route_set_has_source); Then you wouldn't need those nasty '(cmp_ftype)' type c

Re: [PATCH v2 04/13] staging: comedi: ni_routing: Add NI signal routing info

2018-10-01 Thread Ian Abbott
ASE + NI_NUM_NAMES) && +RVij(rv, B(src), B(dest)) == 0; ++src) + ; checkpatch.pl complains here about "suspect code indent for conditional statements". That semi-colon needs indenting. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV

Re: [PATCH v2 00/13] device-global identifiers and routes introduced

2018-10-01 Thread Ian Abbott
#x27;bsearch' callbacks in my reply to patch 05. Overall, I think it's very close to acceptable (from a commit point of view I mean). -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Register

Re: [PATCH v3 04/13] staging: comedi: ni_routing: Add NI signal routing info

2018-10-02 Thread Ian Abbott
e in the previous patch series, and there is no reason for it to have appeared in this patch series, which is why I'm suspecting an email receiving glitch at my end. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registere

Re: [PATCH v3 00/13] device-global identifiers and routes introduced

2018-10-02 Thread Ian Abbott
ing patch 04, which might be due to a glitch in my received email copy - some random line ended up with an extra carriage return (see my reply to patch 04). Apart from that I'm happy with it. Thanks, Spencer! Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Lt

Re: [PATCH] staging: comedi: ni_mio_common: protect register write overflow

2018-10-03 Thread Ian Abbott
o directly query subdevice timing". That patch set is fine as is and did not depend on any of the other patches I had been working on. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number:

Re: [PATCH] staging: comedi: ni_mio_common: protect register write overflow

2018-10-03 Thread Ian Abbott
On 03/10/2018 11:34, Ian Abbott wrote: On 03/10/18 02:24, Spencer Olson wrote: Should I resubmit this patch and the entire patch set from earlier today, each separately? The patch set from today titled "device-global identifiers and routes introduced" _does_ depend on this patc

Re: [PATCH v2] staging: comedi: ni_mio_common: protect register write overflow

2018-10-04 Thread Ian Abbott
G returned an error for an out of range channel, but that's a change for another day. } static int ni_rtsi_insn_config(struct comedi_device *dev, Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=

Re: [PATCH v4 00/13] device-global identifiers and routes introduced

2018-10-04 Thread Ian Abbott
access to tio staging: comedi: ni_660x: Add NI PCI-6608 to list of supported devices staging: comedi: ni_660x: clean up pfi routing staging: comedi: ni_660x: add device-global routing Thanks for the new functionality. Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( M

Re: [PATCH] staging: comedi: tio: fix multiple missing break in switch bugs

2018-10-12 Thread Ian Abbott
ret = ni_m_set_gate2(counter, chan); + break; case ni_gpct_variant_660x: ret = ni_660x_set_gate2(counter, chan); + break; default: return -EINVAL; } Thanks for ca

Re: [PATCH] staging: comedi: clarify/unify macros for NI macro-defined terminals

2018-10-24 Thread Ian Abbott
I_COUNTER_NAMES_MAX NI_CtrSampleClock(-1) enum ni_common_signal_names { /* PXI_Star: this is a non-NI-specific signal */ It's no more ugly than the original, although I pity the fool who has to make sense of the preprocessor output! Reviewed-by: Ian Abbott -- -=( Ian Abbott

Re: [PATCH v2] staging: comedi: ni_mio_common: scale ao INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS

2018-10-24 Thread Ian Abbott
return 0; default: Thanks. Hopefully this and your other patch will make it into the next version of the kernel (4.20? 5.0?). If not, they should be backported. Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company register

Re: [PATCH] staging: comedi: change do_insn*_ioctl to allow more samples

2018-10-30 Thread Ian Abbott
() in comedi_fops.c doesn't check the lengths for the INSN_CONFIG instructions handled here). -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registe

[PATCH 1/3] staging: comedi: cb_pcidas64: Use insn->n in AO insn_write handler

2018-10-30 Thread Ian Abbott
Comedi guidelines and change `ao_winsn()` to write the specified number of samples. This fixes the assumption that `data[0]` is valid. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/cb_pcidas64.c | 32 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/d

[PATCH 0/3] staging: comedi: cb_pcidas64: Fix insn->n assumptions

2018-10-30 Thread Ian Abbott
Fix some assumptions about the length of Comedi instructions in the "cb_pcidas64" driver. 1) staging: comedi: cb_pcidas64: Use insn->n in AO insn_write handler 2) staging: comedi: cb_pcidas64: Use insn->n in EEPROM insn_read handler 3) staging: comedi: Check length of INSN_CONFIG_TIMER_1 instructi

[PATCH 3/3] staging: comedi: Check length of INSN_CONFIG_TIMER_1 instruction

2018-10-30 Thread Ian Abbott
that `insn->n` is correct for this configuration instruction. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index c1c6b2b4ab91..ceb6ba5dd57c 1006

[PATCH 2/3] staging: comedi: cb_pcidas64: Use insn->n in EEPROM insn_read handler

2018-10-30 Thread Ian Abbott
e EEPROM location to change between readings. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/cb_pcidas64.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c i

[PATCH] staging: comedi: cb_pcidda: Use insn->n in AO insn_write handler

2018-10-30 Thread Ian Abbott
ow the usual Comedi guidelines and change `cb_pcidda_ao_insn_write()` to write the specified number of samples. This fixes the assumption that `data[0]` is valid. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/cb_pcidda.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -

Re: [PATCH 2/3] staging: comedi: cb_pcidas64: Use insn->n in EEPROM insn_read handler

2018-10-30 Thread Ian Abbott
On 30/10/18 15:34, Hartley Sweeten wrote: On Tuesday, October 30, 2018 7:17 AM, Ian Abbott wrote: The `insn_read` handler for the EEPROM subdevice (`eeprom_insn_read()`) currently ignores `insn->n` (the number of samples to be read) and assumes a single sample is to be read. But `insn

[PATCH] staging: comedi: ni_labpc_common: Use insn->n in AO insn_write handler

2018-10-30 Thread Ian Abbott
usual Comedi guidelines and change `labpc_ao_insn_write()` to write the specified number of samples. This fixes the assumption that `data[0]` is valid. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_labpc_common.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-)

Re: [PATCH] staging: comedi: change do_insn*_ioctl to allow more samples

2018-10-31 Thread Ian Abbott
On 30/10/18 22:27, Spencer Olson wrote: On Tue, Oct 30, 2018 at 6:21 AM Ian Abbott wrote: On 25/10/18 02:36, Spencer E. Olson wrote: Changes do_insn*_ioctl functions to allow for data lengths for each comedi_insn of up to 2^16. This patch also changes these functions to only allocate as

Re: [PATCH] staging: comedi: change do_insn*_ioctl to allow more samples

2018-10-31 Thread Ian Abbott
ion list handling loop instead of allocating it inside the loop. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park Road, Bramha

[PATCH] staging: comedi: addi_apci_3501: Use insn->n in EEPROM insn_read handler

2018-10-31 Thread Ian Abbott
e contents of the EEPROM location to change between readings. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/addi_apci_3501.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_3501.c b/drivers/staging/comedi/drivers

Re: [PATCH] staging: comedi: fix spelling mistake "desination" -> "destination"

2018-11-27 Thread Ian Abbott
"lookup invalid destination\n"); unittest(ni_lookup_route_register(rgout0_src0, TRIGGER_LINE(0), T) == -EINVAL, Thanks for spotting that! Looks good. Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company

Re: [PATCH v2] staging: comedi: change do_insn*_ioctl to allow more samples

2018-12-10 Thread Ian Abbott
remaining drivers that ignore insn->n.) Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park Road, Bramhall, STOCK

Re: [PATCH] drivers: staging: comedi: Fixed side effects from macro definition.

2021-02-18 Thread Ian Abbott
acros in constant expressions. -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=- -=( Bird Hall Lane, STOCKPORT, SK3

Re: [PATCH v2 1/2] staging: comedi: cast function output to assigned variable type

2021-02-18 Thread Ian Abbott
e3 ("staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings") by B K Karthik. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9d5d041eebe3dcf7591ff7004896c329eb841ca6 -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in

Re: [PATCH] staging: comedi: cast to (unsigned int *)

2021-02-18 Thread Ian Abbott
the removal of the unused `data` and `data_len` members (which need to be kept in the user version of the struct for compatibility reasons). -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. addr.: S11 & 12 Building

Re: [PATCH] Staging: comedi: Replaced strlcpy to strscpy

2021-02-18 Thread Ian Abbott
EN); > + strscpy(devinfo.driver_name, dev->driver->driver_name, COMEDI_NAMELEN); > + strscpy(devinfo.board_name, dev->board_name, COMEDI_NAMELEN); > > s = comedi_file_read_subdevice(file); > if (s) > Thanks, but you are too late. It has already been fixe

Re: [PATCH] staging: comedi: cast to (unsigned int *)

2021-02-19 Thread Ian Abbott
ically typed members, which would look a bit odd. The union also kind of hides the problem. -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. addr.: S11 & 12 Building 67, Europa Business Pa

Re: [PATCH -next] staging: comedi dt2814: Removed unused variables

2021-02-22 Thread Ian Abbott
mmands in this driver has always been broken. I'm tempted to remove the code for handling asynchronous commands in this driver altogether for that reason. (The naive fix of writing the data to the Comedi buffer is insufficient without an additional check that the command is running. The end-

[PATCH 01/14] staging: comedi: addi_apci_1032: Fix endian problem for COS sample

2021-02-23 Thread Ian Abbott
rom the wrong end of the 32-bit integer. Fix it by transferring the value via a 16-bit integer. Fixes: 6bb45f2b0c86 ("staging: comedi: addi_apci_1032: use comedi_buf_write_samples()" Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/addi_apci_1032.c | 4 +++-

[PATCH 00/14] staging: comedi: Fix some command data endian problems

2021-02-23 Thread Ian Abbott
The `comedi_buf_read_samples()` and `comedi_buf_write_samples()` functions can read/write either 16-bit or 32-bit values from/to the Comedi buffer used for Comedi asynchonous command data. The width of the value depends on whether the subdevice sets the `SDF_LSAMPL` flag (indicating 32-bit samples

[PATCH 03/14] staging: comedi: adv_pci1710: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
short` since its address is passed to `pci1710_ai_read_sample()`. Fixes: a9c3a015c12f ("staging: comedi: adv_pci1710: use comedi_buf_write_samples()") Cc: # 4.0+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/adv_pci1710.c | 10 +- 1 file changed, 5 insertions(

[PATCH 04/14] staging: comedi: das6402: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
value. Fix it by changing the type of the variable holding the sample value to `unsigned short`. Fixes: d1d24cb65ee3 ("staging: comedi: das6402: read analog input samples in interrupt handler") Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/das6402.c | 2 +- 1

[PATCH 02/14] staging: comedi: addi_apci_1500: Fix endian problem for command sample

2021-02-23 Thread Ian Abbott
Cc: #4.0+ Signed-off-by: Ian Abbott --- .../staging/comedi/drivers/addi_apci_1500.c| 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1500.c b/drivers/staging/comedi/drivers/addi_apci_1500.c index 11efb21555e3..b04c15dcf

[PATCH 05/14] staging: comedi: das800: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
value. Fix it by changing the type of the variable holding the sample value to `unsigned short`. Fixes: ad9eb43c93d8 ("staging: comedi: das800: use comedi_buf_write_samples()" Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/das800.c | 2 +- 1 file changed, 1

[PATCH 06/14] staging: comedi: dmm32at: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
t 0c0eadadcbe6e ("staging: comedi: dmm32at: introduce dmm32_ai_get_sample()").] Fixes: 0c0eadadcbe6e ("staging: comedi: dmm32at: introduce dmm32_ai_get_sample()") Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dmm32at.c | 2 +- 1 file changed, 1 inse

[PATCH 07/14] staging: comedi: me4000: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
value. Fix it by changing the type of the variable holding the sample value to `unsigned short`. Fixes: de88924f67d ("staging: comedi: me4000: use comedi_buf_write_samples()") Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/me4000.c | 2 +- 1 file changed, 1

[PATCH 08/14] staging: comedi: pcl711: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
value. Fix it by changing the type of the variable holding the sample value to `unsigned short`. Fixes: 1f44c034de2e ("staging: comedi: pcl711: use comedi_buf_write_samples()") Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/pcl711.c | 2 +- 1 file changed, 1

[PATCH 09/14] staging: comedi: pcl818: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
i: pcl818: introduce pcl818_ai_write_sample()").] Fixes: d615416de615 ("staging: comedi: pcl818: introduce pcl818_ai_write_sample()") Cc: # 4.0+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/pcl818.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driv

[PATCH 10/14] staging: comedi: amplc_pc236_common: Use 16-bit 0 for interrupt data

2021-02-23 Thread Ian Abbott
o 0 to pass the value. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/amplc_pc236_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/amplc_pc236_common.c b/drivers/staging/comedi/drivers/amplc_pc236_common.c index 043752663

[PATCH 11/14] staging: comedi: comedi_parport: Use 16-bit 0 for interrupt data

2021-02-23 Thread Ian Abbott
address of a 32-bit integer `&s->state`. On bigendian machines, this will copy 2 bytes from the wrong end of the 32-bit integer. This isn't really a problem since `s->state` will always be 0 for this subdevice, but clean it up by using a 16-bit variable initialized to 0 to pass

[PATCH 13/14] staging: comedi: ni_65xx: Use 16-bit 0 for interrupt data

2021-02-23 Thread Ian Abbott
ess of a 32-bit integer `&s->state`. On bigendian machines, this will copy 2 bytes from the wrong end of the 32-bit integer. This isn't really a problem since `s->state` will always be 0 for this subdevice, but clean it up by using a 16-bit variable initialized to 0 to pass the val

[PATCH 12/14] staging: comedi: ni_6527: Use 16-bit 0 for interrupt data

2021-02-23 Thread Ian Abbott
ess of a 32-bit integer `&s->state`. On bigendian machines, this will copy 2 bytes from the wrong end of the 32-bit integer. This isn't really a problem since `s->state` will always be 0 for this subdevice, but clean it up by using a 16-bit variable initialized to 0 to pass the val

[PATCH 14/14] staging: comedi: pcl726: Use 16-bit 0 for interrupt data

2021-02-23 Thread Ian Abbott
ess of a 32-bit integer `&s->state`. On bigendian machines, this will copy 2 bytes from the wrong end of the 32-bit integer. This isn't really a problem since `s->state` will always be 0 for this subdevice, but clean it up by using a 16-bit variable initialized to 0 to pass the val

[PATCH 0/6] staging: comedi: dt2814: Fix broken AI command support

2021-03-01 Thread Ian Abbott
The DT2814 board is an old analog-to-digital ISA card supported by the Comedi "dt2814" driver. The board has a timed acquisition mode, and an end-of-conversion interrupt. The interrupt can be disabled by removing the jumper that sets the IRQ level. In Comedi, the board is a manually configured "

[PATCH 1/6] staging: comedi: dt2814: Clear stale AI data before operation

2021-03-01 Thread Ian Abbott
r the stale data. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c | 39 + 1 file changed, 39 insertions(+) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c index bd329d7b4893..7e73aa094eea 100644 --- a/dr

[PATCH 2/6] staging: comedi: dt2814: Don't wait for conversion in interrupt handler

2021-03-01 Thread Ian Abbott
functions for handling Comedi read instructions and for setting up asynchronous commands now call `dt2814_ai_clear()` to wait for and discard any spurious A/D conversion, let's remove that code from the interrupt handler. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c

[PATCH 3/6] staging: comedi: dt2814: Call dt2814_ai_clear() during initialization

2021-03-01 Thread Ian Abbott
nish and then clears any unread data or error condition. A non-zero return value from `dt2814_ai_clear()` indicates a time-out while waiting for the A/D converter to become non-busy. Return an error in that case. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c | 5 +---

[PATCH 4/6] staging: comedi: dt2814: Fix asynchronous command interrupt handling

2021-03-01 Thread Ian Abbott
n the Control register, leaving the current channel selected. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c | 72 ++--- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/

[PATCH 5/6] staging: comedi: dt2814: Remove struct dt2814_private

2021-03-01 Thread Ian Abbott
and remove the definition of `struct dt2814_private` since they are no longer needed. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt281

[PATCH 6/6] staging: comedi: dt2814: Clear stale AI data on detach

2021-03-01 Thread Ian Abbott
h" handler `dt2814_detach()` to do that if an interrupt handler has been set up. (There is no need to do it if no interrupt handler was set up because Comedi asynchronous command support is disabled in that case.) Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c | 15 +

Re: [PATCH] staging: comedi: replace slash in name

2021-03-15 Thread Ian Abbott
static const struct pcidas64_board pcidas64_boards[] = { > .has_8255 = 0, > }, > [BOARD_PCIDAS4020_12] = { > - .name = "pci-das4020/12", > + .name = "pci-das4020-12", > .

Re: [PATCH] staging: comedi: replace slash in name

2021-03-15 Thread Ian Abbott
On 15/03/2021 10:44, Ian Abbott wrote: > On 14/03/2021 03:57, Tong Zhang wrote: >> request_irq() wont accept a name which contains slash so we need to >> repalce it with something else -- otherwise it will trigger a warning >> and the entry in /proc/irq/ will not be create

Re: [PATCH] staging: comedi: cb_pcidas: replace slash in name

2021-03-15 Thread Ian Abbott
.name = "pci-das1602/16/jr", > + .name = "pci-das1602-16-jr", > .ai_speed = 5000, > .fifo_size = 512, > .is_16bit = 1, > As for cb_pcidas64, the board n

Re: [PATCH v2] staging: comedi: cb_pcidas: fix request_irq() warn

2021-03-16 Thread Ian Abbott
: [1.639976] proc_mkdir+0x18/0x20 [1.641946] request_threaded_irq+0xfe/0x160 [1.642186] cb_pcidas_auto_attach+0xf4/0x610 [cb_pcidas] Suggested-by: Ian Abbott Signed-off-by: Tong Zhang --- v2: revert changes to .name field so that we dont break userspace drivers/staging/comedi/drivers/

Re: [PATCH v2] staging: comedi: cb_pcidas64: fix request_irq() warn

2021-03-16 Thread Ian Abbott
: [1.574722] proc_mkdir+0x18/0x20 [1.576629] request_threaded_irq+0xfe/0x160 [1.576859] auto_attach+0x60a/0xc40 [cb_pcidas64] Suggested-by: Ian Abbott Signed-off-by: Tong Zhang --- v2: revert changes to .name field so that we dont break userspace drivers/staging/comedi/drivers/cb

Re: [PATCH] staging: comedi: replace slash in name

2021-03-16 Thread Ian Abbott
e argument of request_irq(), but that is "cio-das802/16" for one of the boards supported by the driver. On Mon, Mar 15, 2021 at 6:48 AM Ian Abbott wrote: On 15/03/2021 10:44, Ian Abbott wrote: On 14/03/2021 03:57, Tong Zhang wrote: request_irq() wont accept a name which contains slash s

Re: [PATCH] staging: comedi: das800: fix request_irq() warn

2021-03-17 Thread Ian Abbott
break userspace, so we are changing the parameters passed to request_irq() Suggested-by: Ian Abbott Signed-off-by: Tong Zhang --- drivers/staging/comedi/drivers/das800.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/st

Re: [PATCH 1/2] staging: comedi: Simplify conditional evaluation

2020-10-19 Thread Ian Abbott
), "find last source"); } NAK. It looks like you have inadvertently inverted some of the tests. -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. addr.: S11 & 12 Building 67, Europa Busine

Re: [PATCH 2/2] staging: comedi: combine split lines for improved readability

2020-10-19 Thread Ian Abbott
nittest(!route_register_is_valid(9, O(8), T), "find last source"); } void test_ni_check_trigger_arg(void) Is it worth breaking the 80-column limit for this? -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. add

Re: [Outreachy kernel] Re: [PATCH 2/2] staging: comedi: combine split lines for improved readability

2020-10-19 Thread Ian Abbott
On 19/10/2020 11:57, Deepak R Varma wrote: On Mon, Oct 19, 2020 at 12:41:14PM +0200, Julia Lawall wrote: On Mon, 19 Oct 2020, Ian Abbott wrote: On 18/10/2020 20:49, Deepak R Varma wrote: Instructions split on multiple lines can be combined on a single line for improved readability of the

Re: [Outreachy kernel] Re: [PATCH 2/2] staging: comedi: combine split lines for improved readability

2020-10-19 Thread Ian Abbott
On 19/10/2020 12:49, Deepak R Varma wrote: On Mon, Oct 19, 2020 at 12:34:15PM +0100, Ian Abbott wrote: On 19/10/2020 11:57, Deepak R Varma wrote: On Mon, Oct 19, 2020 at 12:41:14PM +0200, Julia Lawall wrote: On Mon, 19 Oct 2020, Ian Abbott wrote: On 18/10/2020 20:49, Deepak R Varma wrote

Re: [PATCH v2] staging: comedi: Simplify conditional evaluation

2020-10-19 Thread Ian Abbott
--- Changes since v1: - Corrected wrongly inverted tests. Feedback from Ian Abbott. - Note: This patch was sent earlier as part of a patch set containing 2 patches. The second patch of the patch set is dropped. Hence sending this standalone patch as v2 version. This is based

[PATCH] staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice

2020-10-21 Thread Ian Abbott
d to set it. This limits commands to use a single channel (either channel 0 or 1), but the limit should be two channels. Set the AO subdevice's `len_chanlist` member to be the same value as the `n_chan` member, which will be 2. Cc: Signed-off-by: Ian Abbott --- drivers/staging/comedi/dri

[PATCH] staging: comedi: cb_pcidas: reinstate delay removed from trimpot setting

2020-10-29 Thread Ian Abbott
oked like the most likely culprit. Fixes: eddd2a4c675c ("staging: comedi: cb_pcidas: refactor write_calibration_bitstream()") Cc: Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/cb_pcidas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/drivers/cb

Re: [PATCH] staging: comedi: cb_pcidas: reinstate delay removed from trimpot setting

2020-11-02 Thread Ian Abbott
On 29/10/2020 14:18, Ian Abbott wrote: Commit eddd2a4c675c ("staging: comedi: cb_pcidas: refactor write_calibration_bitstream()") inadvertently removed one of the `udelay(1)` calls when writing to the calibration register in `cb_pcidas_calib_write()`. Reinstate the delay. It may se

Re: [PATCH] staging: comedi: cb_pcidas: reinstate delay removed from trimpot setting

2020-11-02 Thread Ian Abbott
On 02/11/2020 10:25, Ian Abbott wrote: On 29/10/2020 14:18, Ian Abbott wrote: Commit eddd2a4c675c ("staging: comedi: cb_pcidas: refactor write_calibration_bitstream()") inadvertently removed one of the `udelay(1)` calls when writing to the calibration register in `cb_pcidas_c

Re: [PATCH] staging: comedi: cb_pcidas: reinstate delay removed from trimpot setting

2020-11-04 Thread Ian Abbott
On 02/11/2020 11:16, Ian Abbott wrote: On 02/11/2020 10:25, Ian Abbott wrote: On 29/10/2020 14:18, Ian Abbott wrote: Commit eddd2a4c675c ("staging: comedi: cb_pcidas: refactor write_calibration_bitstream()") inadvertently removed one of the `udelay(1)` calls when writing to the c

[PATCH] staging: comedi: mf6x4: Fix AI end-of-conversion detection

2020-12-07 Thread Ian Abbott
: 04b565021a83 ("comedi: Humusoft MF634 and MF624 DAQ cards driver") Cc: # v4.4+ Cc: Rostislav Lisovy Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/mf6x4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/mf6x4.c b/drive

[PATCH] staging: comedi: adl_pci7x3x: Add interrupt handling for PCI-7230

2021-01-18 Thread Ian Abbott
They all have two interrupt sources, although for PCI-7233 each interrupt source is triggered by a change of state of 16 digital inputs (0-15 and 16-31). The "clear IRQ" register is at a different offset for some boards. Signed-off-by: Bernd Harries Signed-off-by: Ian Abbott --

[PATCH 0/2] staging: comedi: adv_pci_dio: Interrupt handling for PCI-1730

2021-01-18 Thread Ian Abbott
from myself (Ian Abbott). My changes have bene tested by Bernd. The second patch allows the comedi asynchronous command to choose either the rising edge or the falling edge of the external digital input as the trigger source. 1) staging: comedi: adv_pci_dio: Add interrupt handling for PCI-1

[PATCH 1/2] staging: comedi: adv_pci_dio: Add interrupt handling for PCI-1730

2021-01-18 Thread Ian Abbott
lated digital inputs. For IDI0 and IDI1, use the 16 isolated digital inputs.) Currently, only rising edge triggers are supported. Support could be added for the PCI-1733 and PCI-1736. Signed-off-by: Bernd Harries Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/adv_pci_dio.c

[PATCH 2/2] staging: comedi: adv_pci_dio: Support falling edge triggers

2021-01-18 Thread Ian Abbott
of the asynchronous command for the subdevice, using the `CR_INVERT` bit of `scan_begin_arg` to indicate falling edge when set, or rising edge when clear. Also allow the `CR_EDGE` bit to be set, but ignore it. All other bits of `scan_begin_arg` must be zero. Signed-off-by: Ian Abbott --- drivers

Re: [PATCH v2] comedi/ni_pcidio: make all defines uppercase

2018-12-18 Thread Ian Abbott
comedi: ni_pcidio:". Apart from that, the patch seems fine. Reviewed-by: Ian Abbott drivers/staging/comedi/drivers/ni_pcidio.c | 442 +++-- 1 file changed, 222 insertions(+), 220 deletions(-) -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company regist

Re: [PATCH v3] staging: comedi: ni_pcidio: make defines uppercase

2019-01-10 Thread Ian Abbott
(-) Thanks for resending. The patch looks fine, thanks. Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park Road, Bramhall, STOCKPORT, SK7

Re: [PATCH] staging: comedi: Removed not necessary braces for single block

2019-01-16 Thread Ian Abbott
; int ret = 0; - if (copy_from_user(&insn, arg, sizeof(insn))) { + if (copy_from_user(&insn, arg, sizeof(insn))) return -EFAULT; - } + n_data = max(n_data, insn.n); The patch looks fine. Thanks for the fix! Reviewed-by: Ian Abbott -- -=( Ian Abbott

Re: [PATCH v2] staging: comedi: ni_660x: fix missing break in switch statement

2019-02-13 Thread Ian Abbott
OUTPUT_DIO: if (chan > 31) return -EINVAL; + break; default: return -EINVAL; } Thanks for the bug fix! Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in En

Re: [PATCH] staging: comedi: ni_660x: fix missing break in switch statement

2019-02-15 Thread Ian Abbott
uot;staging: comedi: ni_660x: cleanup the NI660X_DMA_CFG register helpers") How should we proceed with this patch? Hi Sasha, the bug was introduced in v4.7 and hasn't been backported to any earlier stable kernels, so no need to do a

[PATCH] staging: comedi: ni_tio: Allocate shadow regs for each counter chip

2019-02-25 Thread Ian Abbott
;raabej" (real name unknown) for an initial implementation of this in the out-of-tree fork of the Comedi drivers. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_tio.c | 71 - drivers/staging/comedi/drivers/ni_tio.h | 4 +- 2 files changed, 47 insertions(+

[PATCH] staging: comedi: ni_mio_common: Fix divide-by-zero for DIO cmdtest

2019-03-04 Thread Ian Abbott
orum/#!topic/comedi_list/4t9WlHzMhKM Fixes: f164cbf98fa8 ("staging: comedi: ni_mio_common: add finite regeneration to dio output") Cc: # 4.6+ Cc: Spencer E. Olson Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedidev.h| 2 ++ drivers/staging/comedi/drive

Re: [PATCH] staging: comedi: ni_mio_common: Fix divide-by-zero for DIO cmdtest

2019-03-05 Thread Ian Abbott
On 05/03/2019 11:10, Dan Carpenter wrote: On Mon, Mar 04, 2019 at 02:33:54PM +, Ian Abbott wrote: The problem was reported on the COMEDI mailing list here: https://groups.google.com/forum/#!topic/comedi_list/4t9WlHzMhKM Can you give Ivan a Reported-by tag? It's a public mailing li

Re: [PATCH] staging: comedi: ni_mio_common: Fix divide-by-zero for DIO cmdtest

2019-03-05 Thread Ian Abbott
On 05/03/2019 11:39, Dan Carpenter wrote: On Tue, Mar 05, 2019 at 11:32:18AM +, Ian Abbott wrote: On 05/03/2019 11:10, Dan Carpenter wrote: On Mon, Mar 04, 2019 at 02:33:54PM +, Ian Abbott wrote: The problem was reported on the COMEDI mailing list here: https://groups.google.com/forum

Re: [PATCH] staging: comedi: ni_mio_common: Fix divide-by-zero for DIO cmdtest

2019-03-06 Thread Ian Abbott
manually with 'git am'. However, I was able to apply the the patch to the stable kernels with 'patch -p1' (with some fuzz), so I'm hoping that it will be 'git cherry-pick'able after it enters the mainline repo. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV

Re: [PATCH] staging: comedi: ni_mio_common: Fix divide-by-zero for DIO cmdtest

2019-03-13 Thread Ian Abbott
On 04/03/2019 14:33, Ian Abbott wrote: `ni_cdio_cmdtest()` validates Comedi asynchronous commands for the DIO subdevice (subdevice 2) of supported National Instruments M-series cards. It is called when handling the `COMEDI_CMD` and `COMEDI_CMDTEST` ioctls for this subdevice. There are two

[PATCH 4/4] staging: comedi: ni_mio_common: use insn->n in ni_m_series_eeprom_insn_read()

2019-03-19 Thread Ian Abbott
omes from a local copy of the EEPROM contents. Also, follow the usual Comedi convention and return `insn->n` from the handler to indicate success (although any non-negative value will do). Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_mio_common.c | 6 -- 1 file changed

[PATCH 0/4] staging: comedi: ni_mio_common: Don't assume insn->n is 1

2019-03-19 Thread Ian Abbott
For insn_read and insn_write handlers for the EEPROM and calibration subdevices currently assume that insn->n is 1 and access data[0] without checking insn->n. data[0] exists because the Comedi core ensures it, but in the case of the insn_write handler it will contain some random, uninitialized va

[PATCH 1/4] staging: comedi: ni_mio_common: Use insn->n in ni_calib_insn_write()

2019-03-19 Thread Ian Abbott
e handler to indicate success (although any non-negative return value will do as far as the Comedi core is concerned). Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_mio_common.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drive

[PATCH 2/4] staging: comedi: ni_mio_common: use insn->n in ni_calib_insn_read()

2019-03-19 Thread Ian Abbott
though any non-negative value will do). Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_mio_common.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c inde

  1   2   3   4   5   6   7   8   9   10   >