diff mbox

[V2,3/3] Add support for Slave mode

Message ID 9735.10.24.255.17.1265192526.squirrel@dbdmail.itg.ti.com (mailing list archive)
State Superseded
Headers show

Commit Message

Hemanth V Feb. 3, 2010, 10:22 a.m. UTC
None
diff mbox

Patch

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