From: Anton Vorontsov <avorontsov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org
Subject: [PATCH 2/3] [SPI] Add new mode: SPI_LOOP
Date: Thu, 26 Jul 2007 17:50:51 +0400 [thread overview]
Message-ID: <20070726135051.GB5550@localhost.localdomain> (raw)
In-Reply-To: <20070726134754.GA3539-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
Loopback mode is supported by various controllers, this mode
is useful for testing, especially in conjunction with spidev
driver.
Signed-off-by: Anton Vorontsov <avorontsov-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
---
drivers/spi/spidev.c | 2 +-
include/linux/spi/spi.h | 1 +
include/linux/spi/spidev.h | 1 +
3 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index 4c51a61..24c8d4d 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -57,7 +57,7 @@ static unsigned long minors[N_SPI_MINORS / BITS_PER_LONG];
/* Bit masks for spi_device.mode management */
#define SPI_MODE_MASK (SPI_CPHA | SPI_CPOL | SPI_CS_HIGH | \
- SPI_LSB_FIRST | SPI_3WIRE)
+ SPI_LSB_FIRST | SPI_3WIRE | SPI_LOOP)
struct spidev_data {
struct device dev;
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 302b81d..e180615 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -77,6 +77,7 @@ struct spi_device {
#define SPI_CS_HIGH 0x04 /* chipselect active high? */
#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */
#define SPI_3WIRE 0x10 /* SI/SO signals shared */
+#define SPI_LOOP 0x20 /* loopback mode */
u8 bits_per_word;
int irq;
void *controller_state;
diff --git a/include/linux/spi/spidev.h b/include/linux/spi/spidev.h
index 369d42e..c93ef9d 100644
--- a/include/linux/spi/spidev.h
+++ b/include/linux/spi/spidev.h
@@ -38,6 +38,7 @@
#define SPI_CS_HIGH 0x04
#define SPI_LSB_FIRST 0x08
#define SPI_3WIRE 0x10
+#define SPI_LOOP 0x20
/*---------------------------------------------------------------------------*/
--
1.5.0.6
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
next prev parent reply other threads:[~2007-07-26 13:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-26 13:47 [PATCH 0/3] [SPI] loopback mode support, [POWERPC] loopback mode for spi_mpc83xx Anton Vorontsov
[not found] ` <20070726134754.GA3539-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-26 13:50 ` [PATCH 1/3] [SPI] Sync spidev.{h, c} with spi.h Anton Vorontsov
[not found] ` <20070726135041.GA5550-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-27 3:02 ` David Brownell
2007-07-26 13:50 ` Anton Vorontsov [this message]
[not found] ` <20070726135051.GB5550-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2007-07-27 3:07 ` [PATCH 2/3] [SPI] Add new mode: SPI_LOOP David Brownell
[not found] ` <200707262007.07537.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2007-07-27 3:34 ` Ned Forrester
[not found] ` <46A967D5.30606-/d+BM93fTQY@public.gmane.org>
2007-08-01 18:25 ` David Brownell
2007-07-27 13:27 ` Anton Vorontsov
2007-07-26 13:51 ` [PATCH 3/3] [POWERPC][SPI] spi_mpc83xx: add support for loopback mode Anton Vorontsov
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=20070726135051.GB5550@localhost.localdomain \
--to=avorontsov-hkdhdckh98+b+jhodadfcq@public.gmane.org \
--cc=linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@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).