aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/amba-pl022.c20
-rw-r--r--drivers/spi/omap2_mcspi.c6
-rw-r--r--drivers/spi/xilinx_spi.c3
3 files changed, 24 insertions, 5 deletions
diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c
index 5c2b092a915e..5a4e0afb9ad6 100644
--- a/drivers/spi/amba-pl022.c
+++ b/drivers/spi/amba-pl022.c
@@ -324,6 +324,7 @@ struct vendor_data {
324 bool unidir; 324 bool unidir;
325 bool extended_cr; 325 bool extended_cr;
326 bool pl023; 326 bool pl023;
327 bool loopback;
327}; 328};
328 329
329/** 330/**
@@ -1983,7 +1984,7 @@ static int pl022_setup(struct spi_device *spi)
1983 1984
1984 SSP_WRITE_BITS(chip->cr0, clk_freq.scr, SSP_CR0_MASK_SCR, 8); 1985 SSP_WRITE_BITS(chip->cr0, clk_freq.scr, SSP_CR0_MASK_SCR, 8);
1985 /* Loopback is available on all versions except PL023 */ 1986 /* Loopback is available on all versions except PL023 */
1986 if (!pl022->vendor->pl023) { 1987 if (pl022->vendor->loopback) {
1987 if (spi->mode & SPI_LOOP) 1988 if (spi->mode & SPI_LOOP)
1988 tmp = LOOPBACK_ENABLED; 1989 tmp = LOOPBACK_ENABLED;
1989 else 1990 else
@@ -2233,6 +2234,7 @@ static struct vendor_data vendor_arm = {
2233 .unidir = false, 2234 .unidir = false,
2234 .extended_cr = false, 2235 .extended_cr = false,
2235 .pl023 = false, 2236 .pl023 = false,
2237 .loopback = true,
2236}; 2238};
2237 2239
2238 2240
@@ -2242,6 +2244,7 @@ static struct vendor_data vendor_st = {
2242 .unidir = false, 2244 .unidir = false,
2243 .extended_cr = true, 2245 .extended_cr = true,
2244 .pl023 = false, 2246 .pl023 = false,
2247 .loopback = true,
2245}; 2248};
2246 2249
2247static struct vendor_data vendor_st_pl023 = { 2250static struct vendor_data vendor_st_pl023 = {
@@ -2250,6 +2253,16 @@ static struct vendor_data vendor_st_pl023 = {
2250 .unidir = false, 2253 .unidir = false,
2251 .extended_cr = true, 2254 .extended_cr = true,
2252 .pl023 = true, 2255 .pl023 = true,
2256 .loopback = false,
2257};
2258
2259static struct vendor_data vendor_db5500_pl023 = {
2260 .fifodepth = 32,
2261 .max_bpw = 32,
2262 .unidir = false,
2263 .extended_cr = true,
2264 .pl023 = true,
2265 .loopback = true,
2253}; 2266};
2254 2267
2255static struct amba_id pl022_ids[] = { 2268static struct amba_id pl022_ids[] = {
@@ -2283,6 +2296,11 @@ static struct amba_id pl022_ids[] = {
2283 .mask = 0xffffffff, 2296 .mask = 0xffffffff,
2284 .data = &vendor_st_pl023, 2297 .data = &vendor_st_pl023,
2285 }, 2298 },
2299 {
2300 .id = 0x10080023,
2301 .mask = 0xffffffff,
2302 .data = &vendor_db5500_pl023,
2303 },
2286 { 0, 0 }, 2304 { 0, 0 },
2287}; 2305};
2288 2306
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index 3a5ed06d3d2f..6f86ba0175ac 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -517,7 +517,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
517 dev_vdbg(&spi->dev, "read-%d %02x\n", 517 dev_vdbg(&spi->dev, "read-%d %02x\n",
518 word_len, *(rx - 1)); 518 word_len, *(rx - 1));
519 } 519 }
520 } while (c > (word_len>>3)); 520 } while (c);
521 } else if (word_len <= 16) { 521 } else if (word_len <= 16) {
522 u16 *rx; 522 u16 *rx;
523 const u16 *tx; 523 const u16 *tx;
@@ -564,7 +564,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
564 dev_vdbg(&spi->dev, "read-%d %04x\n", 564 dev_vdbg(&spi->dev, "read-%d %04x\n",
565 word_len, *(rx - 1)); 565 word_len, *(rx - 1));
566 } 566 }
567 } while (c > (word_len>>3)); 567 } while (c >= 2);
568 } else if (word_len <= 32) { 568 } else if (word_len <= 32) {
569 u32 *rx; 569 u32 *rx;
570 const u32 *tx; 570 const u32 *tx;
@@ -611,7 +611,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
611 dev_vdbg(&spi->dev, "read-%d %08x\n", 611 dev_vdbg(&spi->dev, "read-%d %08x\n",
612 word_len, *(rx - 1)); 612 word_len, *(rx - 1));
613 } 613 }
614 } while (c > (word_len>>3)); 614 } while (c >= 4);
615 } 615 }
616 616
617 /* for TX_ONLY mode, be sure all words have shifted out */ 617 /* for TX_ONLY mode, be sure all words have shifted out */
diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index 4d2c75df886c..c69c6f2c2c5c 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -18,6 +18,7 @@
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/of.h> 19#include <linux/of.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/mfd/core.h>
21#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
22#include <linux/spi/spi_bitbang.h> 23#include <linux/spi/spi_bitbang.h>
23#include <linux/spi/xilinx_spi.h> 24#include <linux/spi/xilinx_spi.h>
@@ -470,7 +471,7 @@ static int __devinit xilinx_spi_probe(struct platform_device *dev)
470 struct spi_master *master; 471 struct spi_master *master;
471 u8 i; 472 u8 i;
472 473
473 pdata = dev->dev.platform_data; 474 pdata = mfd_get_data(dev);
474 if (pdata) { 475 if (pdata) {
475 num_cs = pdata->num_chipselect; 476 num_cs = pdata->num_chipselect;
476 little_endian = pdata->little_endian; 477 little_endian = pdata->little_endian;