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

Ian Abbott abbotti at mev.co.uk
Tue Sep 25 10:27:17 UTC 2018


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,
> INSN_DEVICE_CONFIG_CONNECT_ROUTE,
> INSN_DEVICE_CONFIG_DISCONNECT_ROUTE,
> INSN_DEVICE_CONFIG_GET_ROUTES
> for the ni mio devices.  This means that the new abstracted signal/terminal
> names can be used to define signal routing with regards to the PFI
> terminals and RTSI trigger bus lines.
> 
> This also adds ability to identify PFI and RTSI channels on the PFI and
> RTSI subdevices using the new device-global names.  This does not change
> the values that are set for channel output selections using the subdevice
> interfaces--these still require direct register values.
> 
> Annotates and updates tables of register values to reflect this new
> implementation status.
> 
> Signed-off-by: Spencer E. Olson <olsonse at umich.edu>
> ---
>   .../staging/comedi/drivers/ni_mio_common.c    | 687 ++++++++++++++++--
>   drivers/staging/comedi/drivers/ni_stc.h       |  68 ++
>   2 files changed, 683 insertions(+), 72 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
> index b033f0be9b8a..c42d480df7ff 100644
> --- a/drivers/staging/comedi/drivers/ni_mio_common.c
> +++ b/drivers/staging/comedi/drivers/ni_mio_common.c

In trying an experimental application of your patches to "staging-next" 
(to examine the code more carefully), this (PATCH 07/13) failed to apply 
with "git am".  When applying the failed patch manually with "patch 
-p1", there was one failed hunk (see below).

> @@ -5040,13 +5077,17 @@ static unsigned int ni_get_rtsi_routing(struct comedi_device *dev,
>   {
>   	struct ni_private *devpriv = dev->private;
>   
> +	if (chan >= TRIGGER_LINE(0))
> +		/* allow new and old names of rtsi channels to work. */
> +		chan -= TRIGGER_LINE(0);
> +
>   	if (chan < 4) {
>   		return NISTC_RTSI_TRIG_TO_SRC(chan,
>   					      devpriv->rtsi_trig_a_output_reg);
>   	} else if (chan < NISTC_RTSI_TRIG_NUM_CHAN(devpriv->is_m_series)) {
>   		return NISTC_RTSI_TRIG_TO_SRC(chan,
>   					      devpriv->rtsi_trig_b_output_reg);
> -	} else if (chan == NISTC_RTSI_TRIG_OLD_CLK_CHAN)
> +	} else if (chan == NISTC_RTSI_TRIG_OLD_CLK_CHAN) {
>   		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 <abbotti at mev.co.uk> || 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 3JZ, UK. )=-


More information about the devel mailing list