aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorPhilippe Langlais <philippe.langlais@linaro.org>2011-03-23 06:05:16 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-03-23 23:27:35 -0400
commit06fb01fd1dc624d891cbe039a88a44bc8a8a9ec1 (patch)
treee9e198d3281cac335d2e3bfc47069ffc1e66fe14 /drivers/spi
parent95c5c3ab7db0dcaeebeb771b90152cd47aa27243 (diff)
spi/pl022: Add loopback support for the SPI on 5500
Extend the vendor data with a loopback field, and add new amba-pl022 vendor data for the DB5500 pl023, as the pl023 on db8500 and db5500 vary. Signed-off-by: Prajadevi H <prajadevi.h@stericsson.com> Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/amba-pl022.c20
1 files changed, 19 insertions, 1 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