All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
To: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
Cc: Ned Forrester <nforrester-/d+BM93fTQY@public.gmane.org>,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	Eric Miao <eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Russell King - ARM Linux
	<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Subject: Re: [PATCH] spi: pxa2xx_spi introduce chip select gpio to simplify the common cases
Date: Fri, 12 Sep 2008 19:18:17 +0100	[thread overview]
Message-ID: <48CAB269.8080301@cam.ac.uk> (raw)
In-Reply-To: <200809111135.44364.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>

David Brownell wrote:
> On Thursday 11 September 2008, Ned Forrester wrote:
> 
>> I'm puzzled.  What is there about the pxa2xx_spi.c that would be
>> simplified by doing anything with respect to SSPFRM?
> 
> The usage model ... callers must understand that option,
> evaluate whether it's even usable on their board, and
> then have an extra set of possibilities to debug.  And
> it's not a model needed with other SPI controllers...
> 
> The code ... has to support that more complex model.
> 
> Developers ... have to answer questions about that
> mechanism when they could be doing more useful things.

Having converted the boards I use over to a gpio model
(was all sfrm based before) I agree that this is probably 
the way to go.

There are a few use cases though where using the hardware
support (though broken as it is) would give higher performance.

For some devices it is necessary to deselect them for
between transfers for an amount of time equal to say 
4 times the SCK period.  Clearly the only way to
make this happen on various spi controllers is to 
set mdelay_usecs to the best value you can manage.
(at high speed this is somewhat tedious, and in most cases
the time to turn the gpio off and on again is sufficient)

However, there is always a fixed min delay between the 
transfers due to the passing of interrupts back to the
driver etc so in many cases the use of SFRM allows
this to be harnessed as it switches much closer to the
actual transmission than a gpio based control. 

As an example, take the vti sca3000 range of accelerometers.
The specs say that they must be deselected for 4 * the SCK
period.  As some of these devices go at 325kHz this comes
to 12.3 microsecs and a typical time I've observed for gpio
deselecting is only 7 microsecs this would be a device that
would benefit from such strategy (as long as the board
config had the option of specifying a minimum delay between
SRFM being deselected and control hitting the delay_usecs
code in pxa2xx_spi.c.

Still, despite the above being the case, I'm inclined
to agree that at the very least people should be strongly
discouraged from using SRFM!

Jonathan

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

      parent reply	other threads:[~2008-09-12 18:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f17812d70809040221y477ec4x5c05460650266be8@mail.gmail.com>
     [not found] ` <f17812d70809040403u4c33e376vd8b3a2c5f034081c@mail.gmail.com>
     [not found]   ` <f17812d70809040403u4c33e376vd8b3a2c5f034081c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-09  0:04     ` [PATCH] spi: pxa2xx_spi introduce chip select gpio to simplify the common cases David Brownell
     [not found]       ` <200809081704.43404.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-09-09  1:22         ` Ned Forrester
     [not found]           ` <48C5CFEE.6070601-/d+BM93fTQY@public.gmane.org>
2008-09-09  1:42             ` Eric Miao
     [not found]               ` <f17812d70809081842l703fa346k139cc14dc033d877-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-09  2:42                 ` Eric Miao
     [not found]                   ` <f17812d70809081942t718aa081p23f4711ee53d8019-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-09  2:52                     ` Ned Forrester
2008-09-09  2:50                 ` Ned Forrester
     [not found]                   ` <48C5E47F.7070705-/d+BM93fTQY@public.gmane.org>
2008-09-09  3:02                     ` Eric Miao
     [not found]                       ` <f17812d70809082002w4b7e3cd1n948ad39fd6cd7833-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2008-09-09 17:49                         ` David Brownell
2008-09-09 17:49             ` David Brownell
     [not found]               ` <200809091049.49327.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-09-10  1:25                 ` Eric Miao
2008-09-09 10:23         ` Jonathan Cameron
     [not found]           ` <48C64EBE.6090003-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
2008-09-11  6:08             ` David Brownell
     [not found]               ` <200809102308.31675.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-09-11 13:32                 ` Ned Forrester
     [not found]                   ` <48C91DFD.5020308-/d+BM93fTQY@public.gmane.org>
2008-09-11 18:35                     ` David Brownell
     [not found]                       ` <200809111135.44364.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-09-12 18:18                         ` Jonathan Cameron [this message]

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=48CAB269.8080301@cam.ac.uk \
    --to=jic23-kwpb1pkirijaa/9udqfwiw@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=eric.y.miao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
    --cc=nforrester-/d+BM93fTQY@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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 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.