From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Mike Frysinger <vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
David Brownell
<dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
Michael Hennerich
<michael.hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>,
uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org
Subject: Re: [Uclinux-dist-devel] [PATCH 1/2] spi/bfin_spi: only request GPIO on first load
Date: Fri, 22 Oct 2010 01:25:45 -0600 [thread overview]
Message-ID: <20101022072545.GA8205@angua.secretlab.ca> (raw)
In-Reply-To: <AANLkTi=-yDBTJPhSgP7XjaKpqp7T+=inf5F1DCMZT4CZ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Fri, Oct 22, 2010 at 02:41:12AM -0400, Mike Frysinger wrote:
> On Fri, Oct 22, 2010 at 02:30, Grant Likely wrote:
> > On Fri, Oct 22, 2010 at 02:01:47AM -0400, Mike Frysinger wrote:
> >> From: Michael Hennerich <michael.hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org>
> >>
> >> The gpiolib code does not allow people to do gpio_request() on a GPIO
> >> once it has already been requested. So make sure we only request the
> >> pin on the first setup of a SPI device. Otherwise, if you attempts to
> >> reconfigure a SPI device on the fly (like change bit sizes), the setup
> >> function incorrectly fails.
> >
> > Doesn't that mean that the gpio pin be requested at device probe time
> > instead of in a function that can be repeatedly called?
>
> not sure what you mean. this is a pin specific to a spi slave device.
> there is no "spi probe" function for spi slave devices, only the "spi
> setup" function.
The spi master device is responsible for managing its own cs lines,
and it should know what they are at bfin_spi_probe time. Looking at
commit d3cc71f7 which reworked the cs_gpio bits, I see that the
blackfin driver places the gpio information with the slave instance.
One could be argue that the spi_slave can be considered the owner of
spi ss lines, but that runs counter to current conventions, and
counter to how I want to implement common infrastructure for handling
gpio slave select lines.
I see that this patch is a bug fix, and the driver already implements
bad behaviour, so I have little choice but to pick it up. However, it
is only a band-aid solution and in the long term it should be
refactored to store the gpio slave-select lines with the spi_master
device (probably after some common gpio-slave-select infrastructure is
put in place).
g.
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
next prev parent reply other threads:[~2010-10-22 7:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-22 6:01 [PATCH 1/2] spi/bfin_spi: only request GPIO on first load Mike Frysinger
[not found] ` <1287727308-26653-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2010-10-22 6:01 ` [PATCH 2/2] spi/bfin_spi: handle error/status changes after data interrupts Mike Frysinger
[not found] ` <1287727308-26653-2-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2010-10-22 7:28 ` Grant Likely
2010-10-22 6:30 ` [PATCH 1/2] spi/bfin_spi: only request GPIO on first load Grant Likely
[not found] ` <20101022063004.GA3311-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-22 6:41 ` Mike Frysinger
[not found] ` <AANLkTi=-yDBTJPhSgP7XjaKpqp7T+=inf5F1DCMZT4CZ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-22 7:25 ` Grant Likely [this message]
[not found] ` <20101022072545.GA8205-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-10-22 7:33 ` Mike Frysinger
[not found] ` <AANLkTinFwZrtzPARy65oTnFgn2gxpniPXvONfWzjzF8z-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-31 4:07 ` Grant Likely
2010-10-22 7:27 ` 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=20101022072545.GA8205@angua.secretlab.ca \
--to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
--cc=dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=michael.hennerich-OyLXuOCK7orQT0dZR+AlfA@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b@public.gmane.org \
--cc=vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).