linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: 21cnbao@gmail.com (Barry Song)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] spi: sirf: set SPI controller in RISC IO chipselect mode
Date: Mon, 14 Apr 2014 14:29:58 +0800	[thread overview]
Message-ID: <1397457001-5266-3-git-send-email-21cnbao@gmail.com> (raw)
In-Reply-To: <1397457001-5266-1-git-send-email-21cnbao@gmail.com>

From: Qipan Li <Qipan.Li@csr.com>

SPI bitbang supply "chipselect" interface for change chip-select line
, in the SiRFSoC SPI controller, we need to enable "SPI_CS_IO_MODE",
otherwise, spi_sirfsoc_chipselect() has no effect.
now the driver is working is because SPI controller will control CS
automatically without SPI_CS_IO_MODE. this patch makes the CS controller
really controlled by software.

Signed-off-by: Qipan Li <Qipan.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
---
 drivers/spi/spi-sirf.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/spi-sirf.c b/drivers/spi/spi-sirf.c
index 51d7c98..9b30743 100644
--- a/drivers/spi/spi-sirf.c
+++ b/drivers/spi/spi-sirf.c
@@ -559,6 +559,11 @@ spi_sirfsoc_setup_transfer(struct spi_device *spi, struct spi_transfer *t)
 		regval &= ~SIRFSOC_SPI_CMD_MODE;
 		sspi->tx_by_cmd = false;
 	}
+	/*
+	 * set spi controller in RISC chipselect mode, we are controlling CS by
+	 * software BITBANG_CS_ACTIVE and BITBANG_CS_INACTIVE.
+	 */
+	regval |= SIRFSOC_SPI_CS_IO_MODE;
 	writel(regval, sspi->base + SIRFSOC_SPI_CTRL);
 
 	if (IS_DMA_VALID(t)) {
-- 
1.7.5.4

  parent reply	other threads:[~2014-04-14  6:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-14  6:29 [PATCH 0/5] spi : sirf: some chip-select, DMA and checkpatch fixes Barry Song
2014-04-14  6:29 ` [PATCH 1/5] spi: sirf: correct TXFIFO empty interrupt status bit Barry Song
2014-04-14 20:02   ` Mark Brown
2014-04-14  6:29 ` Barry Song [this message]
2014-04-14 20:03   ` [PATCH 2/5] spi: sirf: set SPI controller in RISC IO chipselect mode Mark Brown
2014-04-14  6:29 ` [PATCH 3/5] spi: sirf: make GPIO chipselect function work well Barry Song
2014-04-14 20:03   ` Mark Brown
2014-04-14  6:30 ` [PATCH 4/5] spi: sirf: fix line over 80 characters style issue Barry Song
2014-04-14 20:04   ` Mark Brown
2014-04-14  6:30 ` [PATCH 5/5] spi: sirf: fix spi full-duplex DMA transferring issue Barry Song
2014-04-14 20:06   ` Mark Brown
2014-04-15  1:43     ` Barry Song
2014-04-15  9:26       ` Mark Brown
2014-04-15  9:57         ` Barry Song
2014-04-15 10:12           ` Mark Brown

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=1397457001-5266-3-git-send-email-21cnbao@gmail.com \
    --to=21cnbao@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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).