Linux Framebuffer Layer development
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>,
	David Brownell <dbrownell@users.sourceforge.net>,
	linux-fbdev-devel@lists.sourceforge.net,
	Haavard Skinnemoen <hskinnemoen@atmel.com>,
	Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org,
	David Brownell <david-b@pacbell.net>,
	Ben Gardner <bgardner@wabtec.com>,
	Eric Miao <eric.miao@marvell.com>,
	Philipp Zabel <philipp.zabel@gmail.com>,
	Sam Ravnborg <sam@ravnborg.org>,
	linux-arm-kernel@lists.arm.linux.org.uk,
	Russell King <rmk@arm.linux.org.uk>
Subject: Re: [Linux-fbdev-devel] [RFC 2.6.27 1/1] gpiolib: add support for batch set of pins
Date: Wed, 26 Nov 2008 13:08:57 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.64.0811261306260.2632@anakin> (raw)
In-Reply-To: <45a44e480811260225k5dc2bedal41ccac33626f3b4c@mail.gmail.com>

On Wed, 26 Nov 2008, Jaya Kumar wrote:
> On Wed, Nov 26, 2008 at 5:08 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > On Wed, 26 Nov 2008, Jaya Kumar wrote:
> >> On Wed, Nov 26, 2008 at 4:09 AM, Paulius Zaleckas
> >> <paulius.zaleckas@teltonika.lt> wrote:
> >> > Jaya Kumar wrote:
> >> >>   * @to_irq: optional hook supporting non-static gpio_to_irq() mappings;
> >> >>   *   implementation may not sleep
> >> >>   * @dbg_show: optional routine to show contents in debugfs; default code
> >> >> @@ -84,6 +86,9 @@ struct gpio_chip {
> >> >>                                               unsigned offset, int value);
> >> >>       void                    (*set)(struct gpio_chip *chip,
> >> >>                                               unsigned offset, int value);
> >> >> +     void                    (*set_bus)(struct gpio_chip *chip,
> >> >> +                                             unsigned offset, int values,
> >> >
> >> > I think values should be unsigned
> >>
> >> Okay, can do but it is unusual no? since set uses int value, i figured
> >> set_bus should be similar right?
> >
> > ->set() sets one pin, right? So it's either 0 or 1.
> >
> > ->set_bus() sets multiple pins. With `int', it will fail for bit 31, as that's
> > the sign bit.
> 
> I'm not sure I understood this. I imagine the usage will be like
> 
> int values = 0x8000_0000;
> set_bus(..., start_pin, values);
> 
> write_32(register, values); // will still work to set bit 31

Tehcnically, it will work. But it's more confusing if it's int.

> (values >> 31) == 1;

However, be careful with shifts, as right shifts on signed values will
duplicate te sign bit.

> > Perhaps you even want u32, to make it clear what's the maximum number of pins
> > you can set in one shot?
> 
> Yes, I agree, I will change to use u32 as it is then explicit.

OK. Thx!

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

  reply	other threads:[~2008-11-26 12:08 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-25 22:52 [RFC 2.6.27 1/1] gpiolib: add support for batch set of pins Jaya Kumar
2008-11-26  1:20 ` Eric Miao
2008-11-26  3:27   ` Jaya Kumar
2008-11-26  4:15   ` David Brownell
2008-11-26  5:51     ` Jaya Kumar
2008-11-27 20:01       ` Sam Ravnborg
2008-11-27 23:43         ` Jaya Kumar
2008-11-28  5:47           ` Sam Ravnborg
2008-11-29 22:48         ` David Brownell
2008-11-29 23:33           ` Jaya Kumar
2008-11-29 22:54       ` David Brownell
2008-11-29 23:52         ` Jaya Kumar
2008-11-30 17:55           ` David Brownell
2008-12-01  1:10             ` Jaya Kumar
2008-12-27 14:55               ` Jaya Kumar
2008-12-28 18:46                 ` Robin Getz
2008-12-28 22:00                   ` Ben Nizette
2008-12-29  0:28                     ` Jaya Kumar
2008-12-29 20:32                       ` David Brownell
2008-12-29 19:59                     ` David Brownell
2009-01-06 23:02                     ` Robin Getz
2009-01-07  1:52                       ` Ben Nizette
2008-12-29 19:56                   ` David Brownell
2008-12-30  0:20                     ` Jamie Lokier
2008-12-30  0:43                       ` David Brownell
2008-12-31  4:55                     ` Robin Getz
2008-12-31  4:58                       ` Jaya Kumar
2008-12-31  5:02                         ` Jaya Kumar
2008-12-31 17:38                         ` Robin Getz
2008-12-31 18:05                           ` Jaya Kumar
2009-01-06 22:41                             ` Robin Getz
2009-01-10  7:37                               ` Jaya Kumar
2008-12-29 19:32                 ` David Brownell
2008-12-30 15:45                   ` Jaya Kumar
2008-12-29 19:06               ` David Brownell
2008-11-26  9:09 ` Paulius Zaleckas
2008-11-26  9:18   ` Jaya Kumar
2008-11-26 10:08     ` [Linux-fbdev-devel] " Geert Uytterhoeven
2008-11-26 10:25       ` Jaya Kumar
2008-11-26 12:08         ` Geert Uytterhoeven [this message]
2008-11-29 22:47     ` David Brownell
2008-11-29 23:04       ` Jaya Kumar
2008-11-30  3:27         ` David Brownell

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=Pine.LNX.4.64.0811261306260.2632@anakin \
    --to=geert@linux-m68k.org \
    --cc=bgardner@wabtec.com \
    --cc=david-b@pacbell.net \
    --cc=dbrownell@users.sourceforge.net \
    --cc=eric.miao@marvell.com \
    --cc=greg@kroah.com \
    --cc=hskinnemoen@atmel.com \
    --cc=jayakumar.lkml@gmail.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulius.zaleckas@teltonika.lt \
    --cc=philipp.zabel@gmail.com \
    --cc=rmk@arm.linux.org.uk \
    --cc=sam@ravnborg.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox