public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH PM 0/1] OMAP3: MCSPI: Fix to spi save/restore
@ 2009-02-03 13:35 Jouni Hogander
  2009-02-03 13:35 ` [PATCH PM 1/1] OMAP3 McSPI: Fix to restore chconf for all CSs Jouni Hogander
  0 siblings, 1 reply; 3+ messages in thread
From: Jouni Hogander @ 2009-02-03 13:35 UTC (permalink / raw)
  To: linux-omap

There is a bug in SPI save/restore. This patch is supposed to fix that.

omap2_mcspi.c |   15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH PM 1/1] OMAP3 McSPI: Fix to restore chconf for all CSs
  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
  2009-02-27 18:27   ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Jouni Hogander @ 2009-02-03 13:35 UTC (permalink / raw)
  To: linux-omap

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH PM 1/1] OMAP3 McSPI: Fix to restore chconf for all CSs
  2009-02-03 13:35 ` [PATCH PM 1/1] OMAP3 McSPI: Fix to restore chconf for all CSs Jouni Hogander
@ 2009-02-27 18:27   ` Tony Lindgren
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2009-02-27 18:27 UTC (permalink / raw)
  To: Jouni Hogander; +Cc: linux-omap

* Jouni Hogander <jouni.hogander@nokia.com> [090203 05:37]:
> This patch saves/restores chconf0 for all CSs instead of only for CS0

This should be sent to David Brownell to LKML for integration to
the mainline tree. For the right mailing list, please take a look
at "SPI SUBSYSTEM" in the MAINTAINERS file.

Regards,

Tony
 
> 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
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-27 18:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03 13:35 [PATCH PM 0/1] OMAP3: MCSPI: Fix to spi save/restore Jouni Hogander
2009-02-03 13:35 ` [PATCH PM 1/1] OMAP3 McSPI: Fix to restore chconf for all CSs Jouni Hogander
2009-02-27 18:27   ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox