From: Jiri Slaby <jslaby@suse.cz>
To: Ian Abbott <abbotti@mev.co.uk>, stable@vger.kernel.org
Subject: Re: [PATCH 3.7 - 3.12] staging: comedi: adl_pci7x3x: fix digital output on PCI-7230
Date: Wed, 16 Sep 2015 21:38:34 +0200 [thread overview]
Message-ID: <55F9C53A.6050708@suse.cz> (raw)
In-Reply-To: <1442397489-15559-1-git-send-email-abbotti@mev.co.uk>
On 09/16/2015, 11:58 AM, Ian Abbott wrote:
> 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.
>
> Fixes: 8f567c373c4b ("staging: comedi: new adl_pci7x3x driver")
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Applied to 3.12. Thanks.
> ---
> drivers/staging/comedi/drivers/adl_pci7x3x.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/adl_pci7x3x.c b/drivers/staging/comedi/drivers/adl_pci7x3x.c
> index 81b7203..c570ede 100644
> --- a/drivers/staging/comedi/drivers/adl_pci7x3x.c
> +++ b/drivers/staging/comedi/drivers/adl_pci7x3x.c
> @@ -116,10 +116,21 @@ static int adl_pci7x3x_do_insn_bits(struct comedi_device *dev,
> unsigned 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);
> }
>
> /*
>
--
js
suse labs
prev parent reply other threads:[~2015-09-16 19:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 9:58 [PATCH 3.7 - 3.12] staging: comedi: adl_pci7x3x: fix digital output on PCI-7230 Ian Abbott
2015-09-16 19:38 ` Jiri Slaby [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55F9C53A.6050708@suse.cz \
--to=jslaby@suse.cz \
--cc=abbotti@mev.co.uk \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.