From patchwork Thu Feb 18 10:48:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemanth V X-Patchwork-Id: 80243 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1IAn3xp029823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 18 Feb 2010 10:49:40 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Ni3wM-0000PC-S6; Thu, 18 Feb 2010 10:49:02 +0000 Received: from sfi-mx-4.v28.ch3.sourceforge.com ([172.29.28.124] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Ni3wL-0000P6-SL for spi-devel-general@lists.sourceforge.net; Thu, 18 Feb 2010 10:49:01 +0000 Received-SPF: pass (sfi-mx-4.v28.ch3.sourceforge.com: domain of ti.com designates 198.47.26.153 as permitted sender) client-ip=198.47.26.153; envelope-from=hemanthv@ti.com; helo=devils.ext.ti.com; Received: from devils.ext.ti.com ([198.47.26.153]) by sfi-mx-4.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1Ni3wL-00020L-16 for spi-devel-general@lists.sourceforge.net; Thu, 18 Feb 2010 10:49:01 +0000 Received: from dlep34.itg.ti.com ([157.170.170.115]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o1IAmtOm009114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Feb 2010 04:48:55 -0600 Received: from dbdmail.itg.ti.com (localhost [127.0.0.1]) by dlep34.itg.ti.com (8.13.7/8.13.7) with ESMTP id o1IAmqY7020444; Thu, 18 Feb 2010 04:48:53 -0600 (CST) Received: from 10.24.255.18 (SquirrelMail authenticated user x0099946); by dbdmail.itg.ti.com with HTTP; Thu, 18 Feb 2010 16:18:54 +0530 (IST) Message-ID: <50566.10.24.255.18.1266490134.squirrel@dbdmail.itg.ti.com> Date: Thu, 18 Feb 2010 16:18:54 +0530 (IST) From: "Hemanth V" To: grant.likely@secretlab.ca User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal 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 SPF_PASS SPF: sender matches SPF record -0.0 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Ni3wL-00020L-16 Cc: spi-devel-general@lists.sourceforge.net, linux-omap@vger.kernel.org Subject: [spi-devel-general] [RESEND][PATCH V2 3/3] Add support for Slave mode 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 (demeter.kernel.org [140.211.167.41]); Thu, 18 Feb 2010 10:49:40 +0000 (UTC) diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index 75a3f04..03d61cf 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c @@ -428,6 +428,18 @@ static void omap2_mcspi_set_master_mode(struct spi_master *master) omap2_mcspi_ctx[master->bus_num - 1].modulctrl = l; } +static void omap2_mcspi_set_slave_mode(struct spi_master *master) +{ + u32 l; + + l = mcspi_read_reg(master, OMAP2_MCSPI_MODULCTRL); + MOD_REG_BIT(l, OMAP2_MCSPI_MODULCTRL_STEST, 0); + MOD_REG_BIT(l, OMAP2_MCSPI_MODULCTRL_MS, 1); + mcspi_write_reg(master, OMAP2_MCSPI_MODULCTRL, l); + + omap2_mcspi_ctx[master->bus_num - 1].modulctrl = l; +} + static int mcspi_wait_for_reg_bit(void __iomem *reg, unsigned long bit) {