[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20101019160010.45750e1c.akpm@linux-foundation.org>
Date: Tue, 19 Oct 2010 16:00:10 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Florian Fainelli <florian@...nwrt.org>,
David Brownell <david-b@...bell.net>, Willy Tarreau <w@....eu>,
linux-kernel@...r.kernel.org, Samuel Ortiz <sameo@...ux.intel.com>,
Miguel Gaio <miguel.gaio@...xo.com>,
dbrownell@...rs.sourceforge.net, Juhos Gabor <juhosg@...nwrt.org>
Subject: Re: [PATCH v5] GPIO: add support for 74x164 serial-in/parallel-out
8-bit shift register
On Tue, 19 Oct 2010 09:26:42 +0200
Miguel Ojeda <miguel.ojeda.sandonis@...il.com> wrote:
> On Mon, Oct 18, 2010 at 9:35 PM, Florian Fainelli <florian@...nwrt.org> wrote:
> > From: Miguel Gaio <miguel.gaio@...xo.com>
> >
> > This patch adds support for generic 74x164 serial-in/parallel-out 8-bits
> > shift register. This driver can be used as a GPIO output expander.
> >
> ...
> > +struct gen_74x164_chip {
> > + struct spi_device *spi;
> > + struct gpio_chip gpio_chip;
> > + struct mutex lock;
> > + u8 port_config;
> > +};
> ...
> > +static void gen_74x164_set_value(struct gpio_chip *gc,
> > + unsigned offset, int val)
> > +{
> > + struct gen_74x164_chip *chip = gpio_to_chip(gc);
> > + bool refresh;
> > +
> > + mutex_lock(&chip->lock);
> > + if (val)
> > + chip->port_config |= (1 << offset);
> > + else
> > + chip->port_config &= ~(1 << offset);
>
> set_bit(), clear_bit() ?
They're only to be used on `unsigned long' types, and `port_config' is
u8.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists