All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: linux-kernel@vger.kernel.org
Cc: Grant Likely <grant.likely@secretlab.ca>,
	Eric Miao <eric.y.miao@gmail.com>,
	Russell King <linux@arm.linux.org.uk>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	chao.bi@intel.com,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	cxie4@marvell.com, ytang5@marvell.com,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH v3 08/10] spi/pxa2xx: add support for SPI_LOOP
Date: Tue, 22 Jan 2013 12:26:31 +0200	[thread overview]
Message-ID: <1358850393-23111-9-git-send-email-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <1358850393-23111-1-git-send-email-mika.westerberg@linux.intel.com>

This is useful when testing the functionality of the controller from userspace
and there aren't any real SPI slave devices connected to the bus.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/spi/spi-pxa2xx.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 7f8f939..8a5ba0a 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -846,6 +846,9 @@ static int setup(struct spi_device *spi)
 	chip->cr1 |= (((spi->mode & SPI_CPHA) != 0) ? SSCR1_SPH : 0)
 			| (((spi->mode & SPI_CPOL) != 0) ? SSCR1_SPO : 0);
 
+	if (spi->mode & SPI_LOOP)
+		chip->cr1 |= SSCR1_LBM;
+
 	/* NOTE:  PXA25x_SSP _could_ use external clocking ... */
 	if (!pxa25x_ssp_comp(drv_data))
 		dev_dbg(&spi->dev, "%ld Hz actual, %s\n",
@@ -939,7 +942,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
 	master->dev.parent = &pdev->dev;
 	master->dev.of_node = pdev->dev.of_node;
 	/* the spi->mode bits understood by this driver: */
-	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
+	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LOOP;
 
 	master->bus_num = ssp->port_id;
 	master->num_chipselect = platform_info->num_chipselect;
-- 
1.7.10.4


  parent reply	other threads:[~2013-01-22 10:25 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-22 10:26 [PATCH v3 00/10] spi/pxa2xx: add Intel Lynxpoint SPI controller support Mika Westerberg
2013-01-22 10:26 ` [PATCH v3 01/10] spi/pxa2xx: allow building on a 64-bit kernel Mika Westerberg
2013-01-26  7:21   ` Mark Brown
2013-01-22 10:26 ` [PATCH v3 02/10] spi/pxa2xx: fix warnings when compiling " Mika Westerberg
2013-01-26  7:22   ` Mark Brown
2013-01-22 10:26 ` [PATCH v3 03/10] spi/pxa2xx: convert to the pump message infrastructure Mika Westerberg
2013-01-26  7:23   ` Mark Brown
2013-01-22 10:26 ` [PATCH v3 04/10] spi/pxa2xx: convert to the common clk framework Mika Westerberg
2013-01-26  7:23   ` Mark Brown
2013-01-22 10:26 ` [PATCH v3 05/10] spi/pxa2xx: break out the private DMA API usage into a separate file Mika Westerberg
2013-02-04 19:43   ` Linus Walleij
2013-02-05  6:15     ` Mika Westerberg
2013-02-08 12:13   ` Mark Brown
2013-01-22 10:26 ` [PATCH v3 06/10] spi/pxa2xx: add support for DMA engine Mika Westerberg
2013-02-04 19:46   ` Linus Walleij
2013-02-08 12:13   ` Mark Brown
2013-01-22 10:26 ` [PATCH v3 07/10] spi/pxa2xx: add support for runtime PM Mika Westerberg
2013-02-08 12:14   ` Mark Brown
2013-01-22 10:26 ` Mika Westerberg [this message]
2013-02-08 12:14   ` [PATCH v3 08/10] spi/pxa2xx: add support for SPI_LOOP Mark Brown
2013-01-22 10:26 ` [PATCH v3 09/10] spi/pxa2xx: add support for Intel Low Power Subsystem SPI Mika Westerberg
2013-02-08 13:14   ` Mark Brown
2013-01-22 10:26 ` [PATCH v3 10/10] spi/pxa2xx: add support for Lynxpoint SPI controllers Mika Westerberg
2013-02-08 13:16   ` Mark Brown
     [not found] ` <CACb1VKtD+pc5cAJAqBg82uCXH_icm9fk1yLB_UnwmEq4Lq-NVQ@mail.gmail.com>
2013-02-01 10:22   ` [PATCH v3 00/10] spi/pxa2xx: add Intel Lynxpoint SPI controller support Mika Westerberg
2013-02-04  9:45     ` Mark Brown
2013-02-04  9:52       ` Mika Westerberg
2013-02-08 21:37         ` Linus Walleij
2013-02-09  3:43           ` Mika Westerberg
2013-02-08  7:34       ` Mika Westerberg

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=1358850393-23111-9-git-send-email-mika.westerberg@linux.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=chao.bi@intel.com \
    --cc=cxie4@marvell.com \
    --cc=eric.y.miao@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=haojian.zhuang@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rafael.j.wysocki@intel.com \
    --cc=ytang5@marvell.com \
    /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.