From patchwork Fri Jun 17 07:57:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 9182939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 789466075F for ; Fri, 17 Jun 2016 07:59:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 682EB25819 for ; Fri, 17 Jun 2016 07:59:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CE30283A9; Fri, 17 Jun 2016 07:59:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0CECD25819 for ; Fri, 17 Jun 2016 07:59:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDofE-0005qg-Dg; Fri, 17 Jun 2016 07:58:04 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bDof5-0005lk-0P for linux-arm-kernel@lists.infradead.org; Fri, 17 Jun 2016 07:57:55 +0000 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O8W024MQORTI610@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 17 Jun 2016 16:57:29 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.115]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 04.22.04903.96DA3675; Fri, 17 Jun 2016 16:57:29 +0900 (KST) X-AuditID: cbfee690-f79056d000001327-ef-5763ad69f37f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id F7.FD.06657.96DA3675; Fri, 17 Jun 2016 16:57:29 +0900 (KST) Received: from samsunx.samsung ([10.113.63.54]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O8W00H9UORQH320@mmp2.samsung.com>; Fri, 17 Jun 2016 16:57:28 +0900 (KST) From: Andi Shyti To: Mark Brown Subject: [PATCH 3/5] spi: s3c64xx: consider the case where the CS line is not connected Date: Fri, 17 Jun 2016 16:57:23 +0900 Message-id: <1466150245-2648-4-git-send-email-andi.shyti@samsung.com> X-Mailer: git-send-email 2.8.1 In-reply-to: <1466150245-2648-1-git-send-email-andi.shyti@samsung.com> References: <1466150245-2648-1-git-send-email-andi.shyti@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRmVeSWpSXmKPExsWyRsSkWDdzbXK4QfcjFYvtR56xWiz+8ZzJ YurDJ2wWr18YWvQ/fs1ssenxNVaLy7vmsFk0frzJ7sDhcX3JJ2aPTas62Tw2L6n36NuyitHj 8ya5ANYoLpuU1JzMstQifbsEroyWfV9ZC+ZwV6zb+JutgXErZxcjJ4eEgInE+/O97BC2mMSF e+vZuhi5OIQEVjBKvD63BCjBAVbUutkKIj6LUWJ/xwZGCOcjo8SVZWtYQLrZBDQlmm7/YAOx RQSUJa5+38sCUsQs8JNR4uqdVrAiYYFIie/fXzKD2CwCqhLzbixnArF5BVwlprX9YYM4Q07i 8vQHYDangJvEwiufGUGuEAKquf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3MjCyNzA0tjIzNlcR5H/9fFyYkkJ5Y kpqdmlqQWgTTx8TBKdXAqDqr9vHEDZ+5NApuezgrFHKlml5aouh5Zt+XeNN///bFOISky2t4 FfbcOeInX1zR8WDFdU3l+zt8Zk2TmmuwiCt57t+YbhWzYB2f16uiG9Tc3++2WHC/u4U5hb0h cveeSf1VVf//Xz+9eE2KfbIN95f2aKtDkX8uiShXVljMP/x2S8j8J66pSizFGYmGWsxFxYkA gDXym74CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160617_005755_192835_3663E20C X-CRM114-Status: GOOD ( 12.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof Kozlowski , linux-kernel@vger.kernel.org, Andi Shyti , linux-spi@vger.kernel.org, Kukjin Kim , Andi Shyti , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When the CS line is not connected, it is not needed to enable or disable the chip selection functionality from the s3c64xx devices. Keep et enable already at the initialization (by writing '0' in the S3C64XX_SPI_SLAVE_SEL register) and never disable it. Signed-off-by: Andi Shyti --- drivers/spi/spi-s3c64xx.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 972367d..3d54c5f 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -315,6 +315,9 @@ static void s3c64xx_spi_set_cs(struct spi_device *spi, bool enable) struct s3c64xx_spi_driver_data *sdd = spi_master_get_devdata(spi->master); + if (!sdd->master->num_chipselect) + return; + if (enable) { if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) { writel(0, sdd->regs + S3C64XX_SPI_SLAVE_SEL); @@ -960,7 +963,9 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd, int channel) sdd->cur_speed = 0; - if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) + if (!sdd->master->num_chipselect) + writel(0, sdd->regs + S3C64XX_SPI_SLAVE_SEL); + else if (!(sdd->port_conf->quirks & S3C64XX_SPI_QUIRK_CS_AUTO)) writel(S3C64XX_SPI_SLAVE_SIG_INACT, sdd->regs + S3C64XX_SPI_SLAVE_SEL); /* Disable Interrupts - we use Polling if not DMA mode */