summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-24 09:30:20 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-24 09:30:20 -0700
commite264ac8cad5a3f2e717ac68eb300766eef61f568 (patch)
treef6230e79ef751783d9a723c826dd64efde7d53c0 /drivers/spi
parent200460067d19db4aab7f1d9f5c95dd644d260337 (diff)
parent06fb01fd1dc624d891cbe039a88a44bc8a8a9ec1 (diff)
downloadlinux-3.10-e264ac8cad5a3f2e717ac68eb300766eef61f568.tar.gz
linux-3.10-e264ac8cad5a3f2e717ac68eb300766eef61f568.tar.bz2
linux-3.10-e264ac8cad5a3f2e717ac68eb300766eef61f568.zip
Merge branch 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6
* 'devicetree/merge' of git://git.secretlab.ca/git/linux-2.6: spi/pl022: Add loopback support for the SPI on 5500 spi/omap_mcspi: Fix broken last word xfer of/flattree: minor cleanups dt: eliminate OF_NO_DEEP_PROBE and test for NULL match table dt: protect against NULL matches passed to of_match_node() dt: Refactor of_platform_bus_probe()
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/amba-pl022.c20
-rw-r--r--drivers/spi/omap2_mcspi.c6
2 files changed, 22 insertions, 4 deletions
diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c
index 5c2b092a915..5a4e0afb9ad 100644
--- a/drivers/spi/amba-pl022.c
+++ b/drivers/spi/amba-pl022.c
@@ -324,6 +324,7 @@ struct vendor_data {
bool unidir;
bool extended_cr;
bool pl023;
+ bool loopback;
};
/**
@@ -1983,7 +1984,7 @@ static int pl022_setup(struct spi_device *spi)
SSP_WRITE_BITS(chip->cr0, clk_freq.scr, SSP_CR0_MASK_SCR, 8);
/* Loopback is available on all versions except PL023 */
- if (!pl022->vendor->pl023) {
+ if (pl022->vendor->loopback) {
if (spi->mode & SPI_LOOP)
tmp = LOOPBACK_ENABLED;
else
@@ -2233,6 +2234,7 @@ static struct vendor_data vendor_arm = {
.unidir = false,
.extended_cr = false,
.pl023 = false,
+ .loopback = true,
};
@@ -2242,6 +2244,7 @@ static struct vendor_data vendor_st = {
.unidir = false,
.extended_cr = true,
.pl023 = false,
+ .loopback = true,
};
static struct vendor_data vendor_st_pl023 = {
@@ -2250,6 +2253,16 @@ static struct vendor_data vendor_st_pl023 = {
.unidir = false,
.extended_cr = true,
.pl023 = true,
+ .loopback = false,
+};
+
+static struct vendor_data vendor_db5500_pl023 = {
+ .fifodepth = 32,
+ .max_bpw = 32,
+ .unidir = false,
+ .extended_cr = true,
+ .pl023 = true,
+ .loopback = true,
};
static struct amba_id pl022_ids[] = {
@@ -2283,6 +2296,11 @@ static struct amba_id pl022_ids[] = {
.mask = 0xffffffff,
.data = &vendor_st_pl023,
},
+ {
+ .id = 0x10080023,
+ .mask = 0xffffffff,
+ .data = &vendor_db5500_pl023,
+ },
{ 0, 0 },
};
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index 3a5ed06d3d2..6f86ba0175a 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)
dev_vdbg(&spi->dev, "read-%d %02x\n",
word_len, *(rx - 1));
}
- } while (c > (word_len>>3));
+ } while (c);
} else if (word_len <= 16) {
u16 *rx;
const u16 *tx;
@@ -564,7 +564,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
dev_vdbg(&spi->dev, "read-%d %04x\n",
word_len, *(rx - 1));
}
- } while (c > (word_len>>3));
+ } while (c >= 2);
} else if (word_len <= 32) {
u32 *rx;
const u32 *tx;
@@ -611,7 +611,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
dev_vdbg(&spi->dev, "read-%d %08x\n",
word_len, *(rx - 1));
}
- } while (c > (word_len>>3));
+ } while (c >= 4);
}
/* for TX_ONLY mode, be sure all words have shifted out */