diff -ruPN a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
--- a/drivers/spi/spi-omap2-mcspi.c	2015-05-05 18:39:05.000000000 +0200
+++ b/drivers/spi/spi-omap2-mcspi.c	2015-05-15 12:15:43.000000000 +0200
@@ -31,6 +31,7 @@
 #include <linux/slab.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
+#include <linux/of_gpio.h>
 #include <linux/of_device.h>
 #include <linux/gcd.h>
 
@@ -138,6 +139,7 @@
 	struct omap2_mcspi_regs ctx;
 	int			fifo_depth;
 	unsigned int		pin_dir:1;
+  u32 num_hw_cs;
 };
 
 struct omap2_mcspi_cs {
@@ -150,6 +152,22 @@
 	u32			chconf0, chctrl0;
 };
 
+static u32 mcspi_get_hwcs(struct spi_device *spi)
+{
+  struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master);
+  if (spi->cs_gpio >= 0)
+  {
+    if (mcspi->num_hw_cs == 0)
+      return 0;
+    else
+      return (mcspi->num_hw_cs - 1);
+  }
+  else
+  {
+    return spi->chip_select;
+  }
+}
+
 static inline void mcspi_write_reg(struct spi_master *master,
 		int idx, u32 val)
 {
@@ -252,6 +270,11 @@
 	else
 		l &= ~OMAP2_MCSPI_CHCONF_FORCE;
 
+  if (spi->mode & SPI_CS_HIGH)
+    cs_active = !cs_active;
+  if (spi->cs_gpio >= 0)
+    gpio_set_value(spi->cs_gpio, !cs_active);
+
 	mcspi_write_chconf0(spi, l);
 }
 
@@ -367,7 +390,7 @@
 {
 	struct spi_device *spi = data;
 	struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master);
-	struct omap2_mcspi_dma *mcspi_dma = &mcspi->dma_channels[spi->chip_select];
+	struct omap2_mcspi_dma *mcspi_dma = &mcspi->dma_channels[mcspi_get_hwcs(spi)];
 
 	/* We must disable the DMA RX request */
 	omap2_mcspi_set_dma_req(spi, 1, 0);
@@ -379,7 +402,7 @@
 {
 	struct spi_device *spi = data;
 	struct omap2_mcspi *mcspi = spi_master_get_devdata(spi->master);
-	struct omap2_mcspi_dma *mcspi_dma = &mcspi->dma_channels[spi->chip_select];
+	struct omap2_mcspi_dma *mcspi_dma = &mcspi->dma_channels[mcspi_get_hwcs(spi)];
 
 	/* We must disable the DMA TX request */
 	omap2_mcspi_set_dma_req(spi, 0, 0);
@@ -396,7 +419,7 @@
 	unsigned int		count;
 
 	mcspi = spi_master_get_devdata(spi->master);
-	mcspi_dma = &mcspi->dma_channels[spi->chip_select];
+	mcspi_dma = &mcspi->dma_channels[mcspi_get_hwcs(spi)];
 	count = xfer->len;
 
 	if (mcspi_dma->dma_tx) {
@@ -437,7 +460,7 @@
 	int			word_len, element_count;
 	struct omap2_mcspi_cs	*cs = spi->controller_state;
 	mcspi = spi_master_get_devdata(spi->master);
-	mcspi_dma = &mcspi->dma_channels[spi->chip_select];
+	mcspi_dma = &mcspi->dma_channels[mcspi_get_hwcs(spi)];
 	count = xfer->len;
 	dma_count = xfer->len;
 
@@ -553,7 +576,7 @@
 	int			wait_res;
 
 	mcspi = spi_master_get_devdata(spi->master);
-	mcspi_dma = &mcspi->dma_channels[spi->chip_select];
+	mcspi_dma = &mcspi->dma_channels[mcspi_get_hwcs(spi)];
 	l = mcspi_cached_chconf0(spi);
 
 
@@ -946,8 +969,8 @@
 	unsigned sig;
 
 	mcspi = spi_master_get_devdata(master);
-	mcspi_dma = mcspi->dma_channels + spi->chip_select;
-
+	mcspi_dma = mcspi->dma_channels + mcspi_get_hwcs(spi);
+  
 	init_completion(&mcspi_dma->dma_rx_completion);
 	init_completion(&mcspi_dma->dma_tx_completion);
 
@@ -988,21 +1011,37 @@
 	struct omap2_mcspi_regs	*ctx = &mcspi->ctx;
 	struct omap2_mcspi_dma	*mcspi_dma;
 	struct omap2_mcspi_cs	*cs = spi->controller_state;
+  u32 chipsel;
 
-	mcspi_dma = &mcspi->dma_channels[spi->chip_select];
+	mcspi_dma = &mcspi->dma_channels[mcspi_get_hwcs(spi)];
 
 	if (!cs) {
 		cs = kzalloc(sizeof *cs, GFP_KERNEL);
 		if (!cs)
 			return -ENOMEM;
-		cs->base = mcspi->base + spi->chip_select * 0x14;
-		cs->phys = mcspi->phys + spi->chip_select * 0x14;
+    chipsel = mcspi_get_hwcs(spi);
+		cs->base = mcspi->base + chipsel * 0x14;
+		cs->phys = mcspi->phys + chipsel * 0x14;
 		cs->mode = 0;
 		cs->chconf0 = 0;
 		cs->chctrl0 = 0;
 		spi->controller_state = cs;
 		/* Link this to context save list */
 		list_add_tail(&cs->node, &ctx->cs);
+    
+    // Configure CS GPIO
+    if (spi->cs_gpio >= 0)
+    {
+      ret = gpio_request(spi->cs_gpio, "SPI CSn");
+      if (ret < 0)
+        return ret;
+      ret = gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
+      if (ret < 0)
+      {
+        gpio_free(spi->cs_gpio);
+        return ret;
+      }
+    }
 	}
 
 	if (!mcspi_dma->dma_rx || !mcspi_dma->dma_tx) {
@@ -1027,6 +1066,7 @@
 	struct omap2_mcspi	*mcspi;
 	struct omap2_mcspi_dma	*mcspi_dma;
 	struct omap2_mcspi_cs	*cs;
+  u32 chipsel;
 
 	mcspi = spi_master_get_devdata(spi->master);
 
@@ -1038,8 +1078,11 @@
 		kfree(cs);
 	}
 
-	if (spi->chip_select < spi->master->num_chipselect) {
-		mcspi_dma = &mcspi->dma_channels[spi->chip_select];
+  gpio_free(spi->cs_gpio);
+
+  chipsel = mcspi_get_hwcs(spi);
+	if (chipsel < spi->master->num_chipselect) {
+		mcspi_dma = &mcspi->dma_channels[chipsel];
 
 		if (mcspi_dma->dma_rx) {
 			dma_release_channel(mcspi_dma->dma_rx);
@@ -1075,7 +1118,7 @@
 
 	spi = m->spi;
 	master = spi->master;
-	mcspi_dma = mcspi->dma_channels + spi->chip_select;
+	mcspi_dma = mcspi->dma_channels + mcspi_get_hwcs(spi);
 	cs = spi->controller_state;
 	cd = spi->controller_data;
 
@@ -1214,7 +1257,7 @@
 
 	spi = m->spi;
 	mcspi = spi_master_get_devdata(master);
-	mcspi_dma = mcspi->dma_channels + spi->chip_select;
+	mcspi_dma = mcspi->dma_channels + mcspi_get_hwcs(spi);
 	m->actual_length = 0;
 	m->status = 0;
 
@@ -1360,17 +1403,16 @@
 
 	match = of_match_device(omap_mcspi_of_match, &pdev->dev);
 	if (match) {
-		u32 num_cs = 1; /* default number of chipselect */
+		mcspi->num_hw_cs = 1; /* default number of chipselect */
 		pdata = match->data;
 
-		of_property_read_u32(node, "ti,spi-num-cs", &num_cs);
-		master->num_chipselect = num_cs;
+		of_property_read_u32(node, "ti,spi-num-cs", &(mcspi->num_hw_cs));
 		master->bus_num = bus_num++;
 		if (of_get_property(node, "ti,pindir-d0-out-d1-in", NULL))
 			mcspi->pin_dir = MCSPI_PINDIR_D0_OUT_D1_IN;
 	} else {
 		pdata = dev_get_platdata(&pdev->dev);
-		master->num_chipselect = pdata->num_cs;
+		mcspi->num_hw_cs = pdata->num_cs;
 		if (pdev->id != -1)
 			master->bus_num = pdev->id;
 		mcspi->pin_dir = pdata->pin_dir;
@@ -1397,15 +1439,16 @@
 
 	INIT_LIST_HEAD(&mcspi->ctx.cs);
 
-	mcspi->dma_channels = devm_kcalloc(&pdev->dev, master->num_chipselect,
-					   sizeof(struct omap2_mcspi_dma),
-					   GFP_KERNEL);
+	mcspi->dma_channels = devm_kcalloc(&pdev->dev, mcspi->num_hw_cs,
+			sizeof(struct omap2_mcspi_dma),
+			GFP_KERNEL);
+
 	if (mcspi->dma_channels == NULL) {
 		status = -ENOMEM;
 		goto free_master;
 	}
 
-	for (i = 0; i < master->num_chipselect; i++) {
+	for (i = 0; i < mcspi->num_hw_cs; i++) {
 		char *dma_rx_ch_name = mcspi->dma_channels[i].dma_rx_ch_name;
 		char *dma_tx_ch_name = mcspi->dma_channels[i].dma_tx_ch_name;
 		struct resource *dma_res;
