From: Greg KH <greg@kroah.com>
To: Michael Buesch <mb@bu3sch.de>
Cc: Randy Dunlap <randy.dunlap@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-kernel <linux-kernel@vger.kernel.org>,
David Brownell <david-b@pacbell.net>,
Piot Skamruk <piotr.skamruk@gmail.com>,
Pierre Ossman <drzeus-mmc@drzeus.cx>,
openwrt-devel@lists.openwrt.org
Subject: Re: [PATCH v2] Add GPIO-based MMC/SD driver
Date: Fri, 18 Jul 2008 15:59:52 -0700 [thread overview]
Message-ID: <20080718225952.GA4909@kroah.com> (raw)
In-Reply-To: <200807190038.07501.mb@bu3sch.de>
On Sat, Jul 19, 2008 at 12:38:07AM +0200, Michael Buesch wrote:
> Thanks for the comments.
>
> On Saturday 19 July 2008 00:10:37 Randy Dunlap wrote:
> > > +To add a new device, simply echo the configuration string to the "add" file.
> > > +The config string is composed out of the following elements:
> > > +
> > > +DEVNAME DIpin DOpin CLKpin CSpin SPIMODE MAXBUSSPEED NO_SPI_DELAY CSACTIVELOW
> > > +
> > > +DEVNAME is a unique name string for the device.
> > > +DIpin is the SPI DI GPIO pin.
> > > +DOpin is the SPI DO GPIO pin.
> > > +CLKpin is the SPI CLOCK GPIO pin.
> > > +CSpin is the SPI CHIPSELECT GPIO pin.
> > > +SPIMODE is the hardware mode the device will run at. Can be 0-3.
> > > +MAXBUSSPEED is the maximum bus speed in Hertz.
> > > +NO_SPI_DELAY can be 1 or 0. If it is 1, then the lowlevel SPI delay
> > > +will not be performed. This is not standards compliant, but may be required
> > > +to gain reasonable speeds on embedded hardware.
> > > +CSACTIVELOW can be 1 or 0. If it is 1, the chip is considered to be selected, if CS
> > > +is at a logical 0.
> > > +
> >
> > Would this be better done via configfs? sysfs files are supposed to be
> > single-value files.
>
>
> Well, I really want to avoid over-engineering this thing.
> I thought about using configfs, but that would require to keep lots of state
> information across the operations.
> So one would have to allocate a device with mkdir. Then configure the parameters.
> And then somehow tell the kernel to register it. State has to be maintained over
> this time and I'm not sure how that "register" operation would look like.
> Writing a "1" to a "register" file? So why not write all config parameters
> to an "add" file and be done with all the stuff. ;)
>
> It all depends on how you define "one thing per file", IMO.
> This "add" file does one thing. It creates a device. We must, of course, pass
> some configuration parameters, too.
We have precidence with this for the device id being "added" to a driver
at run time in PCI and USB. Not that I really like this, I do think
configfs would be better to do this with here instead of sysfs.
That being said, as this is a new sysfs file, please break this
documentation up into a file in the Documentation/ABI directory instead
of here.
thanks,
greg k-h
next prev parent reply other threads:[~2008-07-18 23:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-18 20:01 [PATCH v2] Add GPIO-based MMC/SD driver Michael Buesch
2008-07-18 22:10 ` Randy Dunlap
2008-07-18 22:38 ` Michael Buesch
2008-07-18 22:59 ` Greg KH [this message]
2008-07-18 23:19 ` Michael Buesch
2008-07-21 20:41 ` David Brownell
2008-07-21 20:53 ` Randy Dunlap
2008-07-27 23:30 ` David Brownell
2008-07-27 23:34 ` David Brownell
2008-07-28 13:11 ` Michael Buesch
2008-07-28 20:03 ` Piotr Skamruk
2008-07-21 21:21 ` Michael Buesch
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=20080718225952.GA4909@kroah.com \
--to=greg@kroah.com \
--cc=akpm@linux-foundation.org \
--cc=david-b@pacbell.net \
--cc=drzeus-mmc@drzeus.cx \
--cc=linux-kernel@vger.kernel.org \
--cc=mb@bu3sch.de \
--cc=openwrt-devel@lists.openwrt.org \
--cc=piotr.skamruk@gmail.com \
--cc=randy.dunlap@oracle.com \
--cc=sfr@canb.auug.org.au \
/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