From: Vitaly Wool <vwool@ru.mvista.com>
To: david-b@pacbell.net
Cc: linux-kernel@vger.kernel.org, spi-devel-general@sourceforge.net
Subject: [PATCH 2.6-git] SPI: add set_clock() to bitbang
Date: Thu, 22 Dec 2005 18:04:49 +0300 [thread overview]
Message-ID: <20051222180449.4335a8e6.vwool@ru.mvista.com> (raw)
Hi David,
inlined is the small patch that adds set_clock function to the spi_bitbang structure.
Currently SPI bus clock can be configured either in chipselect() (which is _wrong_) or in txrx_buf (also doesn't encourage me much). Making it a separate function adds readability for the code.
Also, it seems to be redundant to set clock on each transfer, so it's proposed to do per-message clock setting. If SPI bus clock setting involves some PLL reconfiguration it's definitely gonna save some time.
Vitaly
Signed-off-by: Vitaly Wool <vwool@ru.mvista.com>
drivers/spi/spi_bitbang.c | 3 +++
include/linux/spi/spi_bitbang.h | 1 +
2 files changed, 4 insertions(+)
Index: linux-2.6.orig/drivers/spi/spi_bitbang.c
===================================================================
--- linux-2.6.orig.orig/drivers/spi/spi_bitbang.c
+++ linux-2.6.orig/drivers/spi/spi_bitbang.c
@@ -263,6 +263,9 @@ nsecs = 100;
chipselect = 0;
status = 0;
+ if (bitbang->set_clock)
+ bitbang->set_clock(spi);
+
for (;;t++) {
if (bitbang->shutdown) {
status = -ESHUTDOWN;
Index: linux-2.6.orig/include/linux/spi/spi_bitbang.h
===================================================================
--- linux-2.6.orig.orig/include/linux/spi/spi_bitbang.h
+++ linux-2.6.orig/include/linux/spi/spi_bitbang.h
@@ -31,6 +31,7 @@ struct spi_bitbang {
struct spi_master *master;
void (*chipselect)(struct spi_device *spi, int is_on);
+ void (*set_clock)(struct spi_device *spi);
int (*txrx_bufs)(struct spi_device *spi, struct spi_transfer *t);
u32 (*txrx_word[4])(struct spi_device *spi,
next reply other threads:[~2005-12-22 15:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-22 15:04 Vitaly Wool [this message]
2005-12-22 16:40 ` David Brownell
2005-12-22 21:23 ` Vitaly Wool
2005-12-22 21:37 ` David Brownell
2005-12-22 21:42 ` Vitaly Wool
2005-12-23 0:37 ` David Brownell
2005-12-23 7:08 ` Vitaly Wool
2005-12-23 8:28 ` David Brownell
2005-12-23 8:38 ` Vitaly Wool
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=20051222180449.4335a8e6.vwool@ru.mvista.com \
--to=vwool@ru.mvista.com \
--cc=david-b@pacbell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=spi-devel-general@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®