From patchwork Wed Mar 23 10:05:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 750 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:45:25 -0000 Delivered-To: patches@linaro.org Received: by 10.220.28.198 with SMTP id n6cs3044vcc; Wed, 23 Mar 2011 03:06:31 -0700 (PDT) Received: by 10.216.239.71 with SMTP id b49mr4395074wer.10.1300874790685; Wed, 23 Mar 2011 03:06:30 -0700 (PDT) Received: from eu1sys200aog111.obsmtp.com (eu1sys200aog111.obsmtp.com [207.126.144.131]) by mx.google.com with SMTP id a50si14778124wer.59.2011.03.23.03.06.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Mar 2011 03:06:29 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.131 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.131; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.131 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from source ([138.198.100.35]) (using TLSv1) by eu1sys200aob111.postini.com ([207.126.147.11]) with SMTP ID DSNKTYnGFaaWrNkegDoxDuFCpksfdvoJFuI0@postini.com; Wed, 23 Mar 2011 10:06:29 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 9B4FFA1; Wed, 23 Mar 2011 10:05:59 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 5617AB8F; Wed, 23 Mar 2011 10:05:59 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id A98D6A8081; Wed, 23 Mar 2011 11:05:24 +0100 (CET) Received: from localhost.localdomain (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.2.254.0; Wed, 23 Mar 2011 11:05:28 +0100 From: Linus Walleij To: Cc: Lee Jones , Philippe Langlais , Grant Likely , Prajadevi H , Linus Walleij Subject: [PATCH 5/6] spi/pl022: Add loopback support for the SPI on 5500 Date: Wed, 23 Mar 2011 11:05:16 +0100 Message-ID: <1300874717-14914-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.3.2 MIME-Version: 1.0 From: Philippe Langlais 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. Cc: Grant Likely Signed-off-by: Prajadevi H Signed-off-by: Philippe Langlais Signed-off-by: Linus Walleij --- drivers/spi/amba-pl022.c | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c index 95e58c7..fe79773 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; }; /** @@ -1984,7 +1985,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 @@ -2228,6 +2229,7 @@ static struct vendor_data vendor_arm = { .unidir = false, .extended_cr = false, .pl023 = false, + .loopback = true, }; @@ -2237,6 +2239,7 @@ static struct vendor_data vendor_st = { .unidir = false, .extended_cr = true, .pl023 = false, + .loopback = true, }; static struct vendor_data vendor_st_pl023 = { @@ -2245,6 +2248,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[] = { @@ -2278,6 +2291,11 @@ static struct amba_id pl022_ids[] = { .mask = 0xffffffff, .data = &vendor_st_pl023, }, + { + .id = 0x10080023, + .mask = 0xffffffff, + .data = &vendor_db5500_pl023, + }, { 0, 0 }, };