All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: Ben Gamari <bgamari.foss@gmail.com>
Cc: beagleboard <beagleboard@googlegroups.com>,
	linux-omap <linux-omap@vger.kernel.org>,
	David Brownell <dbrownell@users.sourceforge.net>,
	Michael Hennerich <michael.hennerich@analog.com>,
	spi-devel-general <spi-devel-general@lists.sourceforge.net>,
	Eric Miao <eric.miao@canonical.com>
Subject: Re: [PATCH] mcspi: Add support for GPIO chip select lines
Date: Thu, 23 Dec 2010 20:28:19 -0700	[thread overview]
Message-ID: <20101224032819.GC2491@angua.secretlab.ca> (raw)
In-Reply-To: <87y67fx5vb.fsf@gmail.com>

On Thu, Dec 23, 2010 at 09:27:20PM -0500, Ben Gamari wrote:
> On Thu, 23 Dec 2010 17:37:12 -0700, Grant Likely <grant.likely@secretlab.ca> wrote:
> > On Thu, Dec 23, 2010 at 4:09 PM, Ben Gamari <bgamari.foss@gmail.com> wrote:
> > > The reason I left this up to the board is it's easy to foresee cases
> > > where you want a non-trivial mapping between logical CS numbers and CS
> > > pin states. In my case, I using a 2-to-4 multiplexer as the source of
> > > chip select.
> > 
> > Hi Ben,
> > 
> > I understand and appreciate the motivation.  However in practice, the
> > gpio api is sufficient for pretty much any use case, even when the
> > backing gpio controller driver ends up driving some oddball device
> > with different constraints.  The big downside to using a callback is
> > that it forces all users to do the extra work of implementing the
> > callback.  With the gpio api, only the oddball cases have to do extra
> > code (to adapt the custom device to the gpio api).
> 
> I understand your concerns, but I'm not sure how to satisfy them without
> crippling the design's ability to accomodate my use-case. I can't pass a
> GPIO line per spi_board_info since in my case of a multiplexed CS
> configuration a single pin's state does not uniquely determine the
> desired CS. The only other option I can think of is that we somehow
> provide a list of GPIOs for each bus and map the CS numbers to
> permutations of GPIO states. Unfortunately, I don't know of any suitable
> structure to put this GPIO list in. Perhaps I'm missing something obvious?

Close, but not quite.  Assign one gpio number to each cs state, and
write a gpio controller driver that maps the linux-gpio number to the
physical gpio state permutation.  The mapping from gpio# to ss# is
1:1, but the driver behind the gpio# can do whatever you need it to
do.

g.


  reply	other threads:[~2010-12-24  3:28 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-20 19:47 (no subject) Ben Gamari
2010-01-21  0:04 ` Ben Dooks
2010-01-21  0:04 ` (no subject) Ben Dooks
2010-01-21  0:04 ` Ben Dooks
2010-01-22 15:53 ` Re: Ben Gamari
2010-01-28  4:10 ` McSPI questions pertaining to GPIO chip select support Ben Gamari
2010-01-28  4:15   ` Bill Gatliff
2010-01-28  4:25     ` Ben Gamari
2010-01-28  4:27       ` Bill Gatliff
2010-01-28  4:33   ` jassi brar
2010-12-21 17:56     ` [RFC PATCH] GPIO chip select support for McSPI Ben Gamari
     [not found]     ` <1b68c6791001272033q60dd31dbif4de285cd9bac83d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-29  0:32       ` McSPI questions pertaining to GPIO chip select support Ben Gamari
2010-01-29  1:09         ` jassi brar
     [not found]           ` <1b68c6791001281709l7d11da30lee486632e85b99cb-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-01-29  1:58             ` Ben Gamari
2010-12-21 17:56       ` [RFC PATCH] GPIO chip select support for McSPI Ben Gamari
2010-12-21 17:56       ` [PATCH] mcspi: Add support for GPIO chip select lines Ben Gamari
2010-12-21 17:56     ` Ben Gamari
2010-12-23 19:59       ` Tony Lindgren
2010-12-23 21:38       ` Grant Likely
2010-12-23 23:09         ` Ben Gamari
2010-12-24  0:37           ` Grant Likely
2010-12-24  2:27             ` Ben Gamari
2010-12-24  3:28               ` Grant Likely [this message]
2010-12-24  6:05                 ` Ben Gamari
2011-02-12  8:33                   ` Grant Likely
2011-02-13 22:07                     ` Ben Gamari
2011-08-30 10:14   ` McSPI questions pertaining to GPIO chip select support Raju Sana
2011-08-30 13:50     ` Ben Gamari
2011-08-30 13:50       ` [PATCH] mcspi: Add support for GPIO chip select lines Ben Gamari
2011-08-30 13:52       ` [PATCH] beagledaq: Hack in cs_gpios Ben Gamari
     [not found]         ` <1314712343-27367-1-git-send-email-bgamari.foss-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-09-05 12:42           ` Raju Sana
2010-01-28  4:10 ` McSPI questions pertaining to GPIO chip select support Ben Gamari
2011-03-13 19:04 GPIO chip select support in McSPI Ben Gamari
2011-03-13 19:05 ` [PATCH] mcspi: Add support for GPIO chip select lines Ben Gamari
2011-03-14 19:27   ` Grant Likely
2011-03-15  2:06     ` Ben Gamari
2011-03-15  2:10       ` Grant Likely

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=20101224032819.GC2491@angua.secretlab.ca \
    --to=grant.likely@secretlab.ca \
    --cc=beagleboard@googlegroups.com \
    --cc=bgamari.foss@gmail.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=eric.miao@canonical.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    /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.