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: 675549 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BEDAC77B7C for ; Wed, 19 Apr 2023 06:28:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231580AbjDSG2U (ORCPT ); Wed, 19 Apr 2023 02:28:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231925AbjDSG2R (ORCPT ); Wed, 19 Apr 2023 02:28:17 -0400 Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C222E6A6E for ; Tue, 18 Apr 2023 23:27:58 -0700 (PDT) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20230419062756epoutp021619167a24dafe564be731a6778c866c~XQhyipmu72618726187epoutp02X for ; Wed, 19 Apr 2023 06:27:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20230419062756epoutp021619167a24dafe564be731a6778c866c~XQhyipmu72618726187epoutp02X 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+vMnuwOVxfcknZo9NqzrZ PO5c28PmsXlJvUffllWMHp83yQWwRWXbZKQmpqQWKaTmJeenZOal2yp5B8c7x5uaGRjqGlpa mCsp5CXmptoqufgE6Lpl5gAdpqRQlphTChQKSCwuVtK3synKLy1JVcjILy6xVUotSMkpMC/Q K07MLS7NS9fLSy2xMjQwMDIFKkzIzmg5fZG14DdfxYLf01gbGDfwdDFyckgImEh8WXSRuYuR i0NIYAejxNOGk6wgCSGBT0DO3iiIxDdGiS37+phgOpqXHWSDSOxllOhtOcQO4XxklHi46zs7 SBWbgLbE9/WLWUESIgKLGSX2/v0CtoRZ4AajRPebzSwgVcICPhIf515iA7FZBFQlpqy/DLaD V8BW4nNvLyvEPnmJ1RsOMIPYnAJ2Egs/XQPbLSHwiF3izdMlLBBFLhInGrvYIGxhiVfHt7BD 2FISL/vboOxsifbpf6CGVkhc3DAbqt5YYtazdsYuRg6g6zQl1u/SBzElBJQljtwCm84swCfR cfgvO0SYV6KjTQiiUU3i/tRzUENkJCYdWQkNIQ+JKx3boGE6kVHizuFP7BMY5WYhLFjAyLiK USy1oDg3PbXYqMAQHmXJ+bmbGMEpT8t1B+Pktx/0DjEycTAeYpTgYFYS4T3jap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76Usu3/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> Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.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); };