From: Sergii Kovalchuk <sentinelofsetch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Assert CS, wait for IRQ, write data sequence
Date: Mon, 11 Oct 2010 19:22:23 +0300 [thread overview]
Message-ID: <201010111922.23952.sentinelofsetch@gmail.com> (raw)
In-Reply-To: <AANLkTi=-v_fEX+TkBw8HA_KM2CPQUqbOzRy8vb3k6EAc-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Thursday 07 October 2010 19:36:18 Grant Likely wrote:
> On Wed, Oct 6, 2010 at 7:49 AM, Sergii Kovalchuk
>
> <sentinelofsetch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > Hi,
> >
> > I'm implementing an SPI protocol driver for TI WL12xx combo chip.
> > According to the spec, for write transaction I should complete the
> > following sequence:
> >
> > 1. Assert CS
> > 2. Wait until chip will trigger IRQ
> > 3. Write data
> >
> > Looking at spi_transfer structure I wondering, how I can implement such
> > logic - there is no explicit ways to implement "wait for an event"
> > within single spi_message processing.
> >
> > As current workarround I use a simple delay in 5 us, but for sleep states
> > it might be not sufficient, since wake-up time are ususally greater.
>
> Wow. That's nasty. The SPI layer really doesn't have a mechanism for
> handling that. What you *could* do is lock the spi bus; assert CS
> manually; wait for the irq, and then issue the transfer. Not exactly
> pretty, but it would work within the existing infrastructure.
>
> g.
Yes, seems to be nasty. This is what I'm doing now - locking the bus and
waiting for IRQ, but this is really ugly. Just wondered, if there is some
hidden way.
Not sure, if it more or less common situation. If so, may be it will be worth
to extend spi_tranfer to handle "timed wait for IRQ/event" in some kind of
busy loop or completion - depending of context?
Of course, any modifications to generic SPI subsystem are hard to push, but
this is simple extending and will not break existing functionality. Controller
drivers may or may not support this initially.
If it will be useful for others and worth implementing.
--
Best regards,
Sergii
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
next prev parent reply other threads:[~2010-10-11 16:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-06 13:49 Assert CS, wait for IRQ, write data sequence Sergii Kovalchuk
[not found] ` <201010061649.45237.sentinelofsetch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-10-07 16:36 ` Grant Likely
[not found] ` <AANLkTi=-v_fEX+TkBw8HA_KM2CPQUqbOzRy8vb3k6EAc-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-11 16:22 ` Sergii Kovalchuk [this message]
[not found] ` <201010111922.23952.sentinelofsetch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-10-12 0:51 ` Jassi Brar
[not found] ` <AANLkTi=sognho1_nuZw2xJmOTXQ4MMudVwktX6CniM+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-12 16:22 ` Sergii Kovalchuk
[not found] ` <201010121922.36420.sentinelofsetch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-10-12 16:34 ` Grant Likely
[not found] ` <AANLkTi=PfdvuGrLth6wnptMvGDb47qQv4Dec4FZb2oxU-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-12 17:29 ` Sergii Kovalchuk
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=201010111922.23952.sentinelofsetch@gmail.com \
--to=sentinelofsetch-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@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 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).