From patchwork Wed Feb 3 10:22:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemanth V X-Patchwork-Id: 76680 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 o13AMDTW018186 for ; Wed, 3 Feb 2010 10:22:49 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 1NccNB-0001z9-Kd; Wed, 03 Feb 2010 10:22:13 +0000 Received: from sfi-mx-3.v28.ch3.sourceforge.com ([172.29.28.123] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NccNB-0001z4-3E for spi-devel-general@lists.sourceforge.net; Wed, 03 Feb 2010 10:22:13 +0000 Received-SPF: pass (sfi-mx-3.v28.ch3.sourceforge.com: domain of ti.com designates 198.47.26.152 as permitted sender) client-ip=198.47.26.152; envelope-from=hemanthv@ti.com; helo=comal.ext.ti.com; Received: from comal.ext.ti.com ([198.47.26.152]) by sfi-mx-3.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1NccNA-0001uN-DY for spi-devel-general@lists.sourceforge.net; Wed, 03 Feb 2010 10:22:13 +0000 Received: from dlep34.itg.ti.com ([157.170.170.115]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o13AM65i026434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Feb 2010 04:22:06 -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 o13AM30r026563; Wed, 3 Feb 2010 04:22:04 -0600 (CST) Received: from 10.24.255.17 (SquirrelMail authenticated user x0099946); by dbdmail.itg.ti.com with HTTP; Wed, 3 Feb 2010 15:52:06 +0530 (IST) Message-ID: <9735.10.24.255.17.1265192526.squirrel@dbdmail.itg.ti.com> Date: Wed, 3 Feb 2010 15:52:06 +0530 (IST) From: "Hemanth V" To: spi-devel-general@lists.sourceforge.net User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 X-Priority: 3 (Normal) Importance: Normal References: In-Reply-To: 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: 1NccNA-0001uN-DY Cc: dbrownell@users.sourceforge.net, linux-omap@vger.kernel.org Subject: [spi-devel-general] [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]); Wed, 03 Feb 2010 10:22:49 +0000 (UTC) diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c index d8e8ea0..f6041bf 100644 --- a/drivers/spi/omap2_mcspi.c +++ b/drivers/spi/omap2_mcspi.c @@ -428,6 +428,16 @@ 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); +} + static int mcspi_wait_for_reg_bit(void __iomem *reg, unsigned long bit) { unsigned long timeout; @@ -827,10 +837,11 @@ static int omap2_mcspi_setup_transfer(struct spi_device