From: Ben Nizette <bn@niasdigital.com>
To: "Daniel Glöckner" <dg@emlix.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] gpiolib: allow poll on gpio value
Date: Sat, 06 Jun 2009 13:46:42 +1000 [thread overview]
Message-ID: <1244260002.22690.21.camel@linux-51e8.site> (raw)
In-Reply-To: <1244212590-15620-1-git-send-email-dg@emlix.com>
Hey, good stuff Daniel. There's a fair few common features missing but
they can be added at a later date.
- Ability to honour rising and falling filters even if the hardware only
supports both-edge (as lots of gpio interrupts do)
- Support for polling the gpio at some interval for gpios which don't
support irqs at all
- Debounce support
- Reporting of number of changes since last read
These are all things which exist in many out-of-tree or
platform-specific implementations of this kind of thing and until
they're there I reckon people will largely stick with what they've got.
But that's really their problem of course, this is still valuable.
Regarding the code itself, not much but:
On Fri, 2009-06-05 at 16:36 +0200, Daniel Glöckner wrote:
>
> + "poll_edge" ... reads as either "none", "rising", "falling", or
IMO this is misleading, sounds like you're polling the gpio.
> +
> + struct sysfs_dirent *value_sd;
> };
No CONFIG_ option to turn all this off?
What's the .text and .data impact of this? Sure it's going to be small,
but to some people (especially those likely to care about gpio) 1k
of .data is something worth being able to turn off.
Using an IDR keyed to the gpio value and just allocating your useful
data structures when poll_edge != "none" would help too. It makes the
whole thing more future-proof as well as the addition of features from
the above list would probably bloat each struct gpio_desc further.
> static struct gpio_desc gpio_desc[ARCH_NR_GPIOS];
>
> @@ -188,10 +193,10 @@ static DEFINE_MUTEX(sysfs_lock);
> * /value
> * * always readable, subject to hardware behavior
> * * may be writable, as zero/nonzero
> - *
> - * REVISIT there will likely be an attribute for configuring async
> - * notifications, e.g. to specify polling interval or IRQ trigger type
> - * that would for example trigger a poll() on the "value".
> + * /poll_edge
> + * * configures behavior of poll on /value
Personally I like seeing poll(2) rather than poll, that word is so
overloaded clarification is be useful.
Technically the rest looks fine :-)
--Ben.
next prev parent reply other threads:[~2009-06-06 3:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 14:36 [PATCH] gpiolib: allow poll on gpio value Daniel Glöckner
2009-06-06 3:46 ` Ben Nizette [this message]
2009-06-06 3:53 ` Ben Nizette
2009-06-06 6:01 ` David Brownell
2009-06-06 6:51 ` Ben Nizette
2009-06-06 5:41 ` David Brownell
2009-06-10 12:36 ` [PATCH v2] gpiolib: allow poll(2) " Daniel Glöckner
2009-07-01 23:05 ` David Brownell
2009-07-02 0:19 ` Ben Nizette
2009-07-02 11:15 ` Jani Nikula
2009-07-02 18:57 ` David Brownell
2009-07-02 21:37 ` Jani Nikula
2009-07-02 22:16 ` David Brownell
2009-07-14 19:26 ` [PATCH v3] " Daniel Glöckner
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=1244260002.22690.21.camel@linux-51e8.site \
--to=bn@niasdigital.com \
--cc=dbrownell@users.sourceforge.net \
--cc=dg@emlix.com \
--cc=linux-kernel@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.