From patchwork Wed Nov 10 10:32:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory CLEMENT X-Patchwork-Id: 313662 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAAAwLa1031228 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 10 Nov 2010 10:58:47 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PG8Nb-0004CL-85; Wed, 10 Nov 2010 10:58:15 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PG8NZ-0004C1-UM for spi-devel-general@lists.sourceforge.net; Wed, 10 Nov 2010 10:58:13 +0000 Received-SPF: pass (sog-mx-4.v43.ch3.sourceforge.com: domain of free-electrons.com designates 88.190.12.23 as permitted sender) client-ip=88.190.12.23; envelope-from=gregory.clement@free-electrons.com; helo=mail.free-electrons.com; Received: from mail.free-electrons.com ([88.190.12.23]) by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.69) id 1PG8NY-0005mI-MB for spi-devel-general@lists.sourceforge.net; Wed, 10 Nov 2010 10:58:13 +0000 Received: by mail.free-electrons.com (Postfix, from userid 106) id E4601138; Wed, 10 Nov 2010 11:33:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.1 Received: from [192.168.100.11] (tra42-1-82-232-183-99.fbx.proxad.net [82.232.183.99]) by mail.free-electrons.com (Postfix) with ESMTPA id D850A1DF; Wed, 10 Nov 2010 11:33:04 +0100 (CET) Message-ID: <4CDA74DB.1060102@free-electrons.com> Date: Wed, 10 Nov 2010 11:32:59 +0100 From: Gregory CLEMENT User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Lightning/1.0b1 Thunderbird/3.0.10 MIME-Version: 1.0 To: spi-devel-general , linux-omap Subject: [PATCH v2 2/2] spi: Force CS to be in inactive state after off-mode transition X-Enigmail-Version: 1.0.1 X-Spam-Score: -1.5 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record 0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1PG8NY-0005mI-MB Cc: Kevin Hilman , David Brownell X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 10 Nov 2010 10:58:47 +0000 (UTC) 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