From: David Brownell <david-b@pacbell.net>
To: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: spi-devel-general@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: spi transfer with zero length
Date: Sat, 16 Feb 2008 10:58:48 -0800 [thread overview]
Message-ID: <200802161058.49473.david-b@pacbell.net> (raw)
In-Reply-To: <20080216.230232.25478328.anemo@mba.ocn.ne.jp>
On Saturday 16 February 2008, Atsushi Nemoto wrote:
> Hi. Is it legal to use zero for 'len' field of struct spi_transfer?
> I mean, len=0, tx_buf=rx_buf=NULL, delay_usecs!=0.
Yes that should work ... it's uncommon, but not illegal. Some
controller drivers may even handle that right!
If the delay were zero and cs_change didn't indicate a need to
briefly deselect the chip, it might make sense to reject such
a NOP transfer. But that's not the case you identify.
> Some SPI devices need slightly long delay before first CLK edge after
> CS assertion.
For future reference ... could you identify a few such devices,
and say what "long" is relative to the clock period?
Some folk have just slowed down the clock in such cases, but
that's rather sub-optimal.
> To achieve this, I think inserting using a zero length
> transfer before real transfers. But it seems some drivers do not
> handle this case properly.
Feel free to submit patches fixing those bugs.
> Is this driver's bug, or we need additional delay field in struct
> spi_device for such case?
I'd like to avoid new parameters to cover case that can already
be expressed in the programming interface. Cases that can't be
expressed ... different issue. I suspect any patches updating
timing parameters should use nanoseconds not microseconds, fwiw.
- Dave
next prev parent reply other threads:[~2008-02-16 18:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-16 14:02 Atsushi Nemoto
2008-02-16 18:58 ` David Brownell [this message]
2008-02-17 14:16 ` Atsushi Nemoto
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=200802161058.49473.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=anemo@mba.ocn.ne.jp \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®