diff mbox

[v2,2/2] spi: Force CS to be in inactive state after off-mode transition

Message ID 4CDA74DB.1060102@free-electrons.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Gregory CLEMENT Nov. 10, 2010, 10:32 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index 2a651e6..938f14c 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -1139,6 +1139,15 @@  static u8 __initdata spi4_txdma_id[] = {
  };
  #endif
  +/* When SPI wake up, CS is in wrong state: force it to unactive state*/
+static void omap2_mcspi_resume(struct spi_device *spi)
+{
+	omap2_mcspi_enable_clocks( spi_master_get_devdata(spi->master));
+	/* We need to togle CS state for OMAP take this chang in account*/
+	omap2_mcspi_force_cs(spi, 1);
+	omap2_mcspi_force_cs(spi, 0);
+	omap2_mcspi_disable_clocks( spi_master_get_devdata(spi->master));
+}
  static int __init omap2_mcspi_probe(struct platform_device *pdev)
  {
  	struct spi_master	*master;
@@ -1194,6 +1203,7 @@  static int __init omap2_mcspi_probe(struct