From patchwork Wed Apr 19 06:06:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaewon Kim X-Patchwork-Id: 13216427 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2DF9C6FD18 for ; Wed, 19 Apr 2023 06:29:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ATJ4ASwXkJyeVNnB/W5LjiH9K4eABqkTvHDr3krvsEs=; b=DksB4YF5KLN8Vg UNyceCqz70aLHtHFpnawhkL6TqJGDxV6qz9L5bvzOzKG4gRw6PS6+Og2IErjglGbJQkrlbmqX9v6o wDRjpoA9ZFZs+Dx/J1nPMWnAH/WvB1KJv+tu4EUUkLe+EtV5Z8ok/aOSgwUfA41gKem8Xganv5yUW ywu2DMIgn1bQMjzoonhjaqOdJVFUNKNMlp2kq072EeIuBMt2HjUCrrDAlefdF72x0HYBviTW5A55R N8r00HoA0yotSs08sOmR1bc8QRgCTBFOEMW+2qB6U/iTQVU0bpQ7G5Cn6MDwihQcXqGns/ChPI2ao ATObcs/uXNMNe4g0/mmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pp1Ii-004EZV-1t; Wed, 19 Apr 2023 06:28:20 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pp1IS-004EKL-23 for linux-arm-kernel@lists.infradead.org; Wed, 19 Apr 2023 06:28:09 +0000 Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20230419062756epoutp04daf7cb8c6859a170f12fe0755ff0802a~XQhylBCgq1322713227epoutp04u for ; Wed, 19 Apr 2023 06:27:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20230419062756epoutp04daf7cb8c6859a170f12fe0755ff0802a~XQhylBCgq1322713227epoutp04u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1681885676; bh=SJljSJk+BMBPb/xhoTc9Ctr+o1SwRSTtNgez3xm6XqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jycHWtvIST3bnvW4CVUCpqNdDiYgXOlVdbB0tPUHILcHt1uhzSoW8q9jJ9Mme8VZc fZkeQ9kXgenJHVYGWuFCbSr4ZTXUiOa5LC07lYZnf6diE/uGAsRSVbXCeLDrX02QSH KKkD/LY3uh31PK/EWqy9L6EkeQEcTFwpKqnB7btk= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20230419062756epcas2p1732c93edbc4837a46c910d198313a988~XQhyPygOA0776907769epcas2p1E; Wed, 19 Apr 2023 06:27:56 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.92]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4Q1W7H6sJPz4x9Q8; Wed, 19 Apr 2023 06:27:55 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 54.C2.09961.BE98F346; Wed, 19 Apr 2023 15:27:55 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20230419062755epcas2p1370c1ca60d88d6b114a7c7c1de3f15c0~XQhxNQgMp1254712547epcas2p1D; Wed, 19 Apr 2023 06:27:55 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20230419062755epsmtrp16b19ddf937434c40320e1b50ed1e9587~XQhxMcZF62169721697epsmtrp1E; Wed, 19 Apr 2023 06:27:55 +0000 (GMT) X-AuditID: b6c32a45-e13fa700000026e9-50-643f89eba21d Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 0C.65.08279.AE98F346; Wed, 19 Apr 2023 15:27:55 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.55]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230419062754epsmtip29dca3d187ac7f77ba5c31d8211f9c2a1~XQhw-k_mh0489404894epsmtip2r; Wed, 19 Apr 2023 06:27:54 +0000 (GMT) From: Jaewon Kim To: Mark Brown , Krzysztof Kozlowski , Andi Shyti , Alim Akhtar Cc: linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Chanho Park , Jaewon Kim Subject: [PATCH v2 1/4] spi: s3c64xx: changed to PIO mode if there is no DMA Date: Wed, 19 Apr 2023 15:06:36 +0900 Message-Id: <20230419060639.38853-2-jaewon02.kim@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230419060639.38853-1-jaewon02.kim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPKsWRmVeSWpSXmKPExsWy7bCmue7rTvsUg3enTS0ezNvGZrH4x3Mm i6kPn7BZXN6vbbGj4Qirxd7XW9ktNj2+xmpxedccNosZ5/cxWTR+vMnuwOVx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pH6z5To1/aaLYSXsSizFGYmGWsxFxYkAGsSYCAIEAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFLMWRmVeSWpSXmKPExsWy7bCSvO7rTvsUg42vmSwezNvGZrH4x3Mm i6kPn7BZXN6vbbGj4Qirxd7XW9ktNj2+xmpxedccNosZ5/cxWTR+vMnuwOVxfcknZo9NqzrZ PO5c28PmsXlJvUffllWMHp83yQWwRXHZpKTmZJalFunbJXBltJy+yFrwm69iwe9prA2MG3i6 GDk5JARMJJqXHWTrYuTiEBLYzSix4vdcFoiEjMTyZ31sELawxP2WI6wQRe8ZJVb9vMwMkmAT 0Jb4vn4xK4gtIrCUUeJmtxRIEbPAPUaJl5O+MYEkhAV8JD7OvQQ2iUVAVWLK+stgcV4BW4nP vb2sEBvkJVZvOAA2lFPATmLhp2tg9UJANbvnvWWfwMi3gJFhFaNkakFxbnpusWGBYV5quV5x Ym5xaV66XnJ+7iZGcHBqae5g3L7qg94hRiYOxkOMEhzMSiK8Z1ytUoR4UxIrq1KL8uOLSnNS iw8xSnOwKInzXug6GS8kkJ5YkpqdmlqQWgSTZeLglGpgSjqTtKWlqWalw6wVmv6NZ1SnNxay f76Usu3/ot+T1r6wcN6QHz65//8d49vS0aclWhPNy9LdL6c9UpOMFVi/qi85gH3re3ehs7Fr /WSfyR97MqHwk6bplRdKJ9N0Ti/1MThqOok7amIcG7N2JofdNOFtzjkRyyrOH/5rcPr0uU6O LczPvj8Pevnhrn/bLfWgWT0rnX7/sTc0LLhrrST266ypTKHEDI8a5WOpLhyl+xx+7VaTqb+W nzlFlHOute2dglfsgmEzeppfZmf+6X1cEnhE48mEX2s/MxX7JX0yqtDK+vEwTKv8S+bG2To7 F07eai8yicfcUpT30uyDjde/ztLgnWM8z/S95P2vP9/cUGIpzkg01GIuKk4EAEGOHZm9AgAA X-CMS-MailID: 20230419062755epcas2p1370c1ca60d88d6b114a7c7c1de3f15c0 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230419062755epcas2p1370c1ca60d88d6b114a7c7c1de3f15c0 References: <20230419060639.38853-1-jaewon02.kim@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230418_232805_219558_BBC0BE94 X-CRM114-Status: GOOD ( 19.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Polling mode supported with qurik if there was no DMA in the SOC. However, there are cased where we cannot or do not want to use DMA. To support this case, if DMA is not set, it is switched to polling mode. Signed-off-by: Jaewon Kim --- drivers/spi/spi-s3c64xx.c | 8 ++++++-- include/linux/platform_data/spi-s3c64xx.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 71d324ec9a70..273aa02322d9 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -19,7 +19,6 @@ #include #define MAX_SPI_PORTS 12 -#define S3C64XX_SPI_QUIRK_POLL (1 << 0) #define S3C64XX_SPI_QUIRK_CS_AUTO (1 << 1) #define AUTOSUSPEND_TIMEOUT 2000 @@ -116,7 +115,7 @@ #define S3C64XX_SPI_TRAILCNT S3C64XX_SPI_MAX_TRAILCNT #define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t) -#define is_polling(x) (x->port_conf->quirks & S3C64XX_SPI_QUIRK_POLL) +#define is_polling(x) (x->cntrlr_info->polling) #define RXBUSY (1<<2) #define TXBUSY (1<<3) @@ -1067,6 +1066,11 @@ static struct s3c64xx_spi_info *s3c64xx_spi_parse_dt(struct device *dev) sci->num_cs = temp; } + if (!of_find_property(dev->of_node, "dmas", NULL)) { + dev_warn(dev, "cannot find DMA, changed to PIO mode\n"); + sci->polling = 1; + } + sci->no_cs = of_property_read_bool(dev->of_node, "no-cs-readback"); return sci; diff --git a/include/linux/platform_data/spi-s3c64xx.h b/include/linux/platform_data/spi-s3c64xx.h index 5df1ace6d2c9..cb7b8ddc899f 100644 --- a/include/linux/platform_data/spi-s3c64xx.h +++ b/include/linux/platform_data/spi-s3c64xx.h @@ -35,6 +35,7 @@ struct s3c64xx_spi_info { int src_clk_nr; int num_cs; bool no_cs; + bool polling; int (*cfg_gpio)(void); };