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: 9182977 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 1081B6075F for ; Fri, 17 Jun 2016 08:01:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F40C225819 for ; Fri, 17 Jun 2016 08:01:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8FD72837A; Fri, 17 Jun 2016 08:01:55 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9444325819 for ; Fri, 17 Jun 2016 08:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755275AbcFQH5d (ORCPT ); Fri, 17 Jun 2016 03:57:33 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:59906 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754013AbcFQH5b (ORCPT ); Fri, 17 Jun 2016 03:57:31 -0400 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>; 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 Cc: Kukjin Kim , Krzysztof Kozlowski , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Andi Shyti , Andi Shyti 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 8vQHYDangJvEwiufGUGuEAKqufhSE2SmhMAydolbP+axQcw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H/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 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.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 */