public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Nizette <bn@niasdigital.com>
To: Trent Piepho <tpiepho@freescale.com>
Cc: David Brownell <david-b@pacbell.net>,
	lkml <linux-kernel@vger.kernel.org>,
	hartleys <hartleys@visionengravers.com>,
	Mike Frysinger <vapier.adi@gmail.com>,
	Bryan Wu <cooloney@kernel.org>
Subject: Re: [patch/rfc 2.6.25-git] gpio: sysfs interface
Date: Wed, 30 Apr 2008 20:33:47 +1000	[thread overview]
Message-ID: <1209551627.3641.12.camel@moss.renham> (raw)
In-Reply-To: <Pine.LNX.4.64.0804292003440.24287@t2.domain.actdsltmp>


On Tue, 2008-04-29 at 20:13 -0700, Trent Piepho wrote:
> On Wed, 30 Apr 2008, Ben Nizette wrote:
> >
> > So you're suggesting that the gpio-N links and control file live inside
> > the gpiochip-X folder along with info about the chip to which they're
> > attached?  I don't mind this, sounds good.  Certainly feels most
> > sysfsish.
> >
> > Scripting would be pretty simple assuming there's one control file per
> > chip and the gpio number written to said control file is relative to
> > that chip's base.  i.e. finding pcf9557:5 (assuming only one such
> > device) would just be
> >
> > - find the gpiochip-X folder whose /label == pcf9557
> > - echo "export 5" > <that_folder>/control
> > - read/write <that_folder>/gpio-5/{value,direction}
> 
> I don't suppose you could actually write the code to do this?
> 
> I already wrote the code, and am using it, for the way I have it work.
> 
> cat /sys/class/gpio/pcf9557-0:5
> 
> But I guess this is too easy.  "We can't have any of that!!  The Earth will
> turn in its grave!  And Slashdot will be decorated in Pink!  Teh End Daze
> arrive!  :)"
> 

I'm sure I could but I'd prefer to have us all come (as close as
possible) to an agreed theoretical interface first :-)

What you've got working there is nice but it still downsides (unless you
can set me straight).  First, we still have the problem of either 100s
of unused files or an index to use in a request.  Also, if you've got
many pcf9557s in a system you'll have a bunch of pcf9557-n; how do you
know which is which?

I think with the above solution we're coming very close to a sexy
system.  We don't need an index file, we have all the information we
need to find which device is which, there's no need to calculate any
full gpio number, there's no files which aren't going to be used, it's
safe, extensible, scriptable, sysfsish..  Am I missing anything?

--Ben

  reply	other threads:[~2008-04-30 10:34 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28 19:39 [patch/rfc 2.6.25-git] gpio: sysfs interface David Brownell
2008-04-28 20:46 ` Andrew Morton
2008-04-28 23:28   ` David Brownell
2008-04-29  2:54     ` Andrew Morton
2008-04-29  3:42       ` Greg KH
2008-04-29 18:45         ` David Brownell
2008-04-29 19:09           ` Andrew Morton
2008-05-02 20:36   ` Pavel Machek
2008-05-17 22:14     ` David Brownell
2008-05-18  0:36       ` [patch 2.6.26-rc2-git] " David Brownell
2008-05-20  7:17         ` Andrew Morton
2008-05-18  4:55       ` [patch/rfc 2.6.25-git] " Ben Nizette
2008-05-19 22:39       ` Pavel Machek
2008-05-20  1:26         ` David Brownell
2008-05-20  8:02           ` Pavel Machek
2008-04-28 23:01 ` Ben Nizette
2008-04-29  0:44   ` David Brownell
2008-04-29  1:58     ` Ben Nizette
2008-04-29  3:44       ` David Brownell
2008-04-29  4:47         ` Ben Nizette
2008-04-29 21:28           ` David Brownell
2008-04-29  6:17         ` Trent Piepho
2008-04-29 22:39           ` David Brownell
2008-04-28 23:09 ` Trent Piepho
2008-04-29  0:45   ` David Brownell
2008-04-29  5:48     ` Trent Piepho
2008-04-29 12:35       ` Ben Nizette
2008-04-29 18:15         ` Trent Piepho
2008-04-29 21:56           ` David Brownell
2008-04-30  0:49             ` Trent Piepho
2008-04-30 17:49               ` David Brownell
2008-04-29 21:55         ` David Brownell
2008-04-29 23:29           ` Ben Nizette
2008-04-30  1:04             ` David Brownell
2008-04-30  2:08               ` Ben Nizette
2008-04-30  3:13                 ` Trent Piepho
2008-04-30 10:33                   ` Ben Nizette [this message]
2008-04-30 17:42                 ` David Brownell
2008-04-30 21:34                   ` [patch/rfc 2.6.25-git v2] " David Brownell
2008-04-30 22:47                     ` Trent Piepho
2008-04-30 23:14                       ` Ben Nizette
2008-05-01  2:12                         ` David Brownell
2008-05-01  2:08                       ` David Brownell
2008-05-01  3:41                         ` Trent Piepho
2008-05-01  4:35                           ` David Brownell
2008-05-01 21:16                             ` Trent Piepho
2008-05-03  2:58                               ` David Brownell
2008-05-03  3:05                               ` David Brownell
2008-04-30 23:28                     ` Ben Nizette
2008-05-01 21:40                       ` David Brownell
2008-04-29  0:47   ` [patch/rfc 2.6.25-git] " Ben Nizette

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=1209551627.3641.12.camel@moss.renham \
    --to=bn@niasdigital.com \
    --cc=cooloney@kernel.org \
    --cc=david-b@pacbell.net \
    --cc=hartleys@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tpiepho@freescale.com \
    --cc=vapier.adi@gmail.com \
    /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