All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jouni Hogander <jouni.hogander@nokia.com>
To: linux-omap@vger.kernel.org
Subject: [PATCH PM 1/1] OMAP3 McSPI: Fix to restore chconf for all CSs
Date: Tue,  3 Feb 2009 15:35:21 +0200	[thread overview]
Message-ID: <1233668121-32200-2-git-send-email-jouni.hogander@nokia.com> (raw)
In-Reply-To: <1233668121-32200-1-git-send-email-jouni.hogander@nokia.com>

This patch saves/restores chconf0 for all CSs instead of only for CS0

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
---
 drivers/spi/omap2_mcspi.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index a7ee3b7..45632dd 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -142,7 +142,7 @@ struct omap2_mcspi_cs {
 struct omap2_mcspi_regs {
 	u32 sysconfig;
 	u32 modulctrl;
-	u32 chconf0;
+	u32 chconf0[4];
 	u32 wakeupenable;
 };
 
@@ -238,8 +238,8 @@ static void omap2_mcspi_set_master_mode(struct spi_master *master)
 
 static void omap2_mcspi_restore_ctx(struct omap2_mcspi *mcspi)
 {
-	struct spi_master *spi_cntrl;
-	spi_cntrl = mcspi->master;
+	struct spi_master *spi_cntrl = mcspi->master;
+	int i;
 
 	/* McSPI: context restore */
 	mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_MODULCTRL,
@@ -248,9 +248,9 @@ static void omap2_mcspi_restore_ctx(struct omap2_mcspi *mcspi)
 	mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_SYSCONFIG,
 			omap2_mcspi_ctx[spi_cntrl->bus_num - 1].sysconfig);
 
-	mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_CHCONF0,
-			omap2_mcspi_ctx[spi_cntrl->bus_num - 1].chconf0);
-
+	for (i = 0; i < spi_cntrl->num_chipselect; i++)
+		mcspi_write_reg(spi_cntrl, i * 0x14 + OMAP2_MCSPI_CHCONF0,
+				omap2_mcspi_ctx[spi_cntrl->bus_num - 1].chconf0[i]);
 
 	mcspi_write_reg(spi_cntrl, OMAP2_MCSPI_WAKEUPENABLE,
 			omap2_mcspi_ctx[spi_cntrl->bus_num - 1].wakeupenable);
@@ -593,7 +593,7 @@ static int omap2_mcspi_setup_transfer(struct spi_device *spi,
 
 	mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, l);
 
-	omap2_mcspi_ctx[spi_cntrl->bus_num - 1].chconf0 = l;
+	omap2_mcspi_ctx[spi_cntrl->bus_num - 1].chconf0[spi->chip_select] = l;
 
 	dev_dbg(&spi->dev, "setup: speed %d, sample %s edge, clk %s\n",
 			OMAP2_MCSPI_MAX_FREQ / (1 << div),
-- 
1.6.0.1


  reply	other threads:[~2009-02-03 13:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03 13:35 [PATCH PM 0/1] OMAP3: MCSPI: Fix to spi save/restore Jouni Hogander
2009-02-03 13:35 ` Jouni Hogander [this message]
2009-02-27 18:27   ` [PATCH PM 1/1] OMAP3 McSPI: Fix to restore chconf for all CSs Tony Lindgren

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=1233668121-32200-2-git-send-email-jouni.hogander@nokia.com \
    --to=jouni.hogander@nokia.com \
    --cc=linux-omap@vger.kernel.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 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.