[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180925101523.GD3332@localhost>
Date: Tue, 25 Sep 2018 12:15:23 +0200
From: Johan Hovold <johan@...nel.org>
To: Karoly Pados <pados@...os.hu>
Cc: Johan Hovold <johan@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
Loic Poulain <loic.poulain@...aro.org>
Subject: Re: [PATCH v6] USB: serial: ftdi_sio: implement GPIO support for
FT-X devices
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
Powered by blists - more mailing lists