diff mbox

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

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

Commit Message

Hemanth V Feb. 18, 2010, 10:48 a.m. UTC
None
diff mbox

Patch

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)
 {