From: Johan Hovold <johan@kernel.org>
To: Karoly Pados <pados@pados.hu>
Cc: Johan Hovold <johan@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Loic Poulain <loic.poulain@linaro.org>
Subject: [v6] USB: serial: ftdi_sio: implement GPIO support for FT-X devices
Date: Tue, 25 Sep 2018 12:15:23 +0200 [thread overview]
Message-ID: <20180925101523.GD3332@localhost> (raw)
On Tue, Sep 25, 2018 at 12:06:35PM +0200, Johan Hovold wrote:
> On Mon, Sep 24, 2018 at 04:31:51PM +0200, Karoly Pados wrote:
> > +static void ftdi_gpio_set_multiple(struct gpio_chip *gc,
> > + unsigned long *mask, unsigned long *bits)
> > +{
> > + struct usb_serial_port *port = gpiochip_get_data(gc);
> > + struct ftdi_private *priv = usb_get_serial_port_data(port);
> > +
> > + mutex_lock(&priv->gpio_lock);
> > +
> > + priv->gpio_value &= ~(*mask);
> > + priv->gpio_value |= *bits;
>
> gpiolib doesn't clear bits not in mask for you, so you need to OR with
> *mask here to avoid setting random other bits.
That was of course meant to be: *AND* with *mask.
Johan
next reply other threads:[~2018-09-25 10:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-25 10:15 Johan Hovold [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-09-25 12:08 [v6] USB: serial: ftdi_sio: implement GPIO support for FT-X devices Johan Hovold
2018-09-25 11:11 Karoly Pados
2018-09-25 11:00 Johan Hovold
2018-09-25 10:47 Karoly Pados
2018-09-25 10:46 Karoly Pados
2018-09-25 10:06 Johan Hovold
2018-09-24 14:31 Karoly Pados
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=20180925101523.GD3332@localhost \
--to=johan@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=pados@pados.hu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).