From patchwork Tue Apr 18 05:28:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 84580 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2599729vqo; Mon, 17 Apr 2023 22:36:29 -0700 (PDT) X-Google-Smtp-Source: AKy350agVlYwl+zFaMS4zVkESAX+c1WxTrMET4c+z7PjuN15NkEBj/oF1WK2OmAhDYCi4Xw5FXCF X-Received: by 2002:a05:6a00:148c:b0:63b:89a2:d624 with SMTP id v12-20020a056a00148c00b0063b89a2d624mr11254852pfu.12.1681796189397; Mon, 17 Apr 2023 22:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681796189; cv=none; d=google.com; s=arc-20160816; b=fitSbEs9jPnFYG8ma4GqQvXbxt9ZOTotWMyBgaa6MD+1S5aiy9nnI/2qt/wqJuc1L4 8/cBmPB1hE6cRQc9haN/ylbB6jg4THYjBWE4e2fGqOIW5hLVuvkx8vvoY3pMptWZo9fl i75LH8jlHgQ9LlHoPJ90fiNQshFgW3LzepJPcvzZKqJEsCVIIXRq7hkDPFLtyyRgCu18 +3VbwDXX+QIfCTo6y4r9gMJ1K7mAxUTzAXRTM8CrKRY8q6ljebT3BZjgJNu3HIj6Xarw 4gS+BSKvbSE2fBYD230aA82t5rmsX2DwuQaSBsRdrDyjKq+696CC8ZJajJmfXodtUFbK WlRg== 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=8xCBVt+yTzL9gm6ligFFQCFbRni90/tGiHt7eRsjBtY=; b=SqB8sZC5StSDSgLp0SL0LoYJknUL3Ih+6KZ3y27oICfOsAc2vauSGQKj8Tkw9mOXZL vzcXRBMxFG/p9pXCbhg/O12ClYZaHHt4NyBEieewoZ1j8dB4uQagYBqQgt+EwkRE1vU/ +LGdTTIir0sWQtBQskHgl2pgDcbs25BUTMwukZMVMOt6CH3OXyBYP3ZwXV0L8DhdMHFh hRyEMS4dxMdNxlOT0ONmUNkSiONYpFNSpXDpEakXwcdZ419YLRGYB/fBQUF0MM8BL3qB 8INHc4ao8mKL9WjZ18CXNDWW+8nBxuMzWN4H/VKn9G7kp/6CAESbBk9cY36FTjQDoRXM j/BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=6XqlMtOx; 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 g5-20020a625205000000b0063b72bd28absi9639092pfb.135.2023.04.17.22.36.14; Mon, 17 Apr 2023 22:36:29 -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=6XqlMtOx; 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 S230337AbjDRF3Y (ORCPT + 99 others); Tue, 18 Apr 2023 01:29:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbjDRF3U (ORCPT ); Tue, 18 Apr 2023 01:29:20 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C353159FE for ; Mon, 17 Apr 2023 22:29:17 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-54f8d4f1ca1so159228537b3.20 for ; Mon, 17 Apr 2023 22:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681795757; x=1684387757; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=8xCBVt+yTzL9gm6ligFFQCFbRni90/tGiHt7eRsjBtY=; b=6XqlMtOxsqrT/1r2wZChHQ9ZpRkAmrUq+OgSX89spFBhvd/cSZJLUdWgaOp8WIePRa PSSby6xBdcgXm6GSBJtUxdkkVhgbn76OAIzMm/qb3Jd3d3cOI/DxQZSDVfK1Gyavudy/ gqGBDA5QaQlZ1Vag2qsySvdPZlBZncqqptuZ3ZzRaiuuiXqI4vaA20IgbcB3lKGE8YfK IWIj5XP+2e2gi0GQshi/crBqMcV5H1AueWiSPrem+/BxIPu7Wrn2sn6kXDbbyHttpmfW 1NpPO6KsFIIaezfKaU82RfGgYofxQzOg3y5qII5BkT2eSoKsN3e77Y/Fesk/40vFvwX4 PwhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681795757; x=1684387757; 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=8xCBVt+yTzL9gm6ligFFQCFbRni90/tGiHt7eRsjBtY=; b=MUXVda2Ep5z9XG95kMb793gu3aKQLKe3hy4qoZgtdINXsiBcAQa9ZhsChF7waDwVud 8yt7pKg33tc6KHr0y1Jf3yBiztne4nBj7kq5XbYnh8D2GpBMBdgvNeEmp0KTAfhEiMNX cryTXGUhVFT+rVhmLYlr7HFnq6WcTcUJejKoeLPXTatLIvi3NRFATo7M1bycRXIiXgvO 94HALt8Tbfx0pvb1bYG9+tC1Cs8MsTrDrIejoAOgTjUc1ujVj8Zgs+hQqTU7Jk9ynpKu exlK/0IB+zbkPY3oeZGWyGsfNTds9v6y8SSrPX6aZv6DFXnT1l6ILJc/JJIx2lVkmjk9 I9LQ== X-Gm-Message-State: AAQBX9eghqB05ZziVMVm38YcDKrGkSURUnnm6zzed+Hvzg6E2UEXChAk sBrtRTCcPS+7PCoime7wHS35Bm58xqbxDg== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:706:b0:545:5f92:f7ee with SMTP id bs6-20020a05690c070600b005455f92f7eemr11663447ywb.2.1681795757018; Mon, 17 Apr 2023 22:29:17 -0700 (PDT) Date: Tue, 18 Apr 2023 05:28:59 +0000 In-Reply-To: <20230418052902.1336866-1-joychakr@google.com> Mime-Version: 1.0 References: <20230418052902.1336866-1-joychakr@google.com> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog Message-ID: <20230418052902.1336866-3-joychakr@google.com> Subject: [PATCH v7 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=unavailable 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?1763491121263728300?= X-GMAIL-MSGID: =?utf-8?q?1763491121263728300?= Move dw_spi_can_dma() implementation below dw_spi_dma_convert_width() for handing compile dependency in future patches. Signed-off-by: Joy Chakraborty --- 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;