From patchwork Thu Apr 27 12:33:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 88250 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp247004vqo; Thu, 27 Apr 2023 06:00:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4xXSqDPMSl+YDwuVu+tLzg0515yJ3bjV2GCOHHxBe7FgXIhppbUVG+aAtl2M+FU5O4ebHG X-Received: by 2002:a05:6a20:9150:b0:f5:d6cc:e3f1 with SMTP id x16-20020a056a20915000b000f5d6cce3f1mr1804525pzc.20.1682600404679; Thu, 27 Apr 2023 06:00:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682600404; cv=none; d=google.com; s=arc-20160816; b=n9dZGa2I7frVayNh0hNIcNhZl84dn0Jf9B9NCdYQOveBfG9Tyi5kmHPz/yv/iFFGWX 8Hue+++1kYYlstbscgRXgOps69sUTwlqcXeIppgHYzgLyJTxSdJlcTivhDIHrIKGpVoW EPzoyr78kRQbXSgXucFqsJ0Dab13WyWKKdrjgIE0yqwAoCNZprg9ZcCjlV82EYzzEfLS F+++GpsiwIz82kU+apqSuu8htcTzdTOo2dz+poMG20Nu/UDi9rLJ6KJHvw88ElzTgIPT S5pXDgXCdLvrJ/ReKRbpdh0cHwujuh81rJ82MorUJCI27NC9D9oZlWw6ET7ft7KZLgdB E+cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=Adm4j45gizFfC/DwqDNV4am9AZ8vYB5z8Xwbghf5BGo=; b=PV9siqg502TQMcZlWy5T47noCpUM3EXO5vnI2Uzr48DKP/198iTVphTznynLGHAnFE JVrdcsS1xLsrS980gb/HUwACwqtOOPJSwxzca0epDpBTvxfQ+2yuqpeG7cLPEPZC3vVk sHuk+SUEHtm0y0jttHLyr9jijsxCa4JrS5rMow26OCI1qm1UO4cKpfcuQeOLTrLjCVRN sugpKeT6urDHQIgMJCXJTcdEc00qZ8qO62t9sisSJgmUrurhAFMMXDhi+jFckUU3vi2W 9AuTylQM/2pXAua/F+tdLnxYaPE2qkaW1iucraEbZpaiVR5PkBfClN+axr7KoNZ91DwF KPZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=zsszPebu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r23-20020a63e517000000b004fbd7827010si18604335pgh.263.2023.04.27.05.59.49; Thu, 27 Apr 2023 06:00:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=zsszPebu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243654AbjD0Mdg (ORCPT + 99 others); Thu, 27 Apr 2023 08:33:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243563AbjD0Mdd (ORCPT ); Thu, 27 Apr 2023 08:33:33 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D1624C03 for ; Thu, 27 Apr 2023 05:33:31 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-b9a2abd8f7bso4215441276.2 for ; Thu, 27 Apr 2023 05:33:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682598810; x=1685190810; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Adm4j45gizFfC/DwqDNV4am9AZ8vYB5z8Xwbghf5BGo=; b=zsszPebuf3cwDmVN7gVllalvKOsKsT+K5wl7znryh8N/HuMkkoSIt3lbU+p0W3aYVh SSSaO27ReLEqOCzG3BSuuDNm2DML74Zfb99YQZlQWs65vMnUHWeMpPKTpa65fLps3gi2 vSlUH4rS8Pu+gwunef7GF7styB0VyU+lahLQDrrM1XEL1K1PH+DfH0h555dj0y86CX4S lKaRbe6XIL1XAsx1lcGj5DnQdzwgD/3Qx6kdhWH5H24GnIS9WomZLqartGvw6G98OBZf 1P06hkAeYdfaQtcpR4dTlCKGVVZ+Bs7kqxOzix3okyVRG7k5QpKflpKuUzNRhgNZeD0I XdeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682598810; x=1685190810; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Adm4j45gizFfC/DwqDNV4am9AZ8vYB5z8Xwbghf5BGo=; b=ZZDIGjurqAcPnt1fr+K7uELCTVgFMPNvKfitLyGWHf0Wy24NkQgCYe2KaHegbYlMOE uboimyC4L1IOzNoE+ZLPCb1uEWCSF1k4PYuGnmqoQAMGAg7Ttme6ZVjsZY04nIL9gr0U y6BatLcOlc5siyB67YIjVjI3x2/QPOMCEbovn/LgtSQyoKISsTsuko/RKH3gQv44HjoY mELLi9y7HcQa6WwiX0VHOixqJrXKb4q3f39c4NEnH9q0bg++lU8tWi7Jp/zVoClUBG5U gDdt4S3ogQ7PdKjsRSlil5n9TvDDvv5/H+6RG4dJaBgvmlGq5t4xwV1ltjJ/71GqTbN5 s2LQ== X-Gm-Message-State: AC+VfDxuXUugVHYhJYa+k31sc2cUJjKEdSmwGOrJ/907AKierR6jGt2J 5k/UByCJ8BtA/+0r84ZAo9NBRRhESf9Gfg== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a25:c041:0:b0:b96:5b8a:3c34 with SMTP id c62-20020a25c041000000b00b965b8a3c34mr441564ybf.11.1682598810419; Thu, 27 Apr 2023 05:33:30 -0700 (PDT) Date: Thu, 27 Apr 2023 12:33:11 +0000 In-Reply-To: <20230427123314.1997152-1-joychakr@google.com> Mime-Version: 1.0 References: <20230427123314.1997152-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230427123314.1997152-3-joychakr@google.com> Subject: [PATCH v9 2/5] spi: dw: Move dw_spi_can_dma() From: Joy Chakraborty To: Serge Semin , Mark Brown , Andy Shevchenko Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, manugautam@google.com, rohitner@google.com, Joy Chakraborty X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764334401942169649?= X-GMAIL-MSGID: =?utf-8?q?1764334401942169649?= Move dw_spi_can_dma() implementation below dw_spi_dma_convert_width() for handing compile dependency in future patches. Signed-off-by: Joy Chakraborty Reviewed-by: Serge Semin Tested-by: Serge Semin * tested on Baikal-T1 based system with DW SPI-looped back interface transferring a chunk of data with DFS:8,12,16. --- drivers/spi/spi-dw-dma.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c index c1b42cb59965..f19c092920a1 100644 --- a/drivers/spi/spi-dw-dma.c +++ b/drivers/spi/spi-dw-dma.c @@ -198,14 +198,6 @@ static irqreturn_t dw_spi_dma_transfer_handler(struct dw_spi *dws) return IRQ_HANDLED; } -static bool dw_spi_can_dma(struct spi_controller *master, - struct spi_device *spi, struct spi_transfer *xfer) -{ - struct dw_spi *dws = spi_controller_get_devdata(master); - - return xfer->len > dws->fifo_len; -} - static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes) { switch (n_bytes) { @@ -220,6 +212,14 @@ static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes) } } +static bool dw_spi_can_dma(struct spi_controller *master, + struct spi_device *spi, struct spi_transfer *xfer) +{ + struct dw_spi *dws = spi_controller_get_devdata(master); + + return xfer->len > dws->fifo_len; +} + static int dw_spi_dma_wait(struct dw_spi *dws, unsigned int len, u32 speed) { unsigned long long ms;