Patch "staging: comedi: adl_pci7x3x: fix digital output on PCI-7230" has been added to the 3.10-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
staging: comedi: adl_pci7x3x: fix digital output on PCI-7230
to the 3.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
staging-comedi-adl_pci7x3x-fix-digital-output-on-pci-7230.patch
and it can be found in the queue-3.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
ad83dbd974feb2e2a8cc071a1d28782bd4d2c70eMon Sep 17 00:00:00 2001
From: Ian Abbott <[email protected]>
Date: Tue, 11 Aug 2015 13:05:10 +0100
Subject: staging: comedi: adl_pci7x3x: fix digital output on PCI-7230
From: Ian Abbott <[email protected]>
commit ad83dbd974feb2e2a8cc071a1d28782bd4d2c70e upstream.
The "adl_pci7x3x" driver replaced the "adl_pci7230" and "adl_pci7432" drivers in commits 8f567c373c4b ("staging: comedi: new adl_pci7x3x driver") and 657f77d173d3 ("staging: comedi: remove adl_pci7230 and adl_pci7432 drivers"). Although the new driver code agrees with the user manuals for the respective boards, digital outputs stopped working on the PCI-7230. This has 16 digital output channels and the previous adl_pci7230 driver shifted the 16 bit output state left by 16 bits before writing to the hardware register. The new adl_pci7x3x driver doesn't do that. Fix it in adl_pci7x3x_do_insn_bits() by checking for the special case of the subdevice having only 16 channels and duplicating the 16 bit output state into both halves of the 32-bit register. That should work both for what the board actually does and for what the user manual says it should do.
--- drivers/staging/comedi/drivers/adl_pci7x3x.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/staging/comedi/drivers/adl_pci7x3x.c +13 -2
@@ -119,10 +119,21 @@ static int adl_pci7x3x_do_insn_bits(struunsigned int bits = data[1 ];if (mask) { +unsigned int val; + s->state &= ~mask; s->state |= (bits & mask); - -outl (s->state, dev->iobase + reg); + val = s->state; +if (s->n_chan ==16 ) { +/* +* It seems the PCI-7230 needs the 16-bit DO state +* to be shifted left by 16 bits before being written +* to the 32-bit register. Set the value in both +* halves of the register to be sure. +*/ + val |= val <<16 ; + } +outl (val, dev->iobase + reg); }/*
Patches currently in stable-queue which might be from [email protected] are
queue-3.10/staging-comedi-adl_pci7x3x-fix-digital-output-on-pci-7230.patch