Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4926266rwe; Mon, 17 Apr 2023 22:31:38 -0700 (PDT) X-Google-Smtp-Source: AKy350b1pDIWZCx6VBCAzm32gfr2MJvM+KtIn51851UpPLzuR4LMd8NYFubI4wumf2nTFc+0M+PW X-Received: by 2002:a05:6a00:23d1:b0:63b:64f7:45a0 with SMTP id g17-20020a056a0023d100b0063b64f745a0mr20788469pfc.12.1681795898048; Mon, 17 Apr 2023 22:31:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681795898; cv=none; d=google.com; s=arc-20160816; b=Jq1KLMRFeiWDrSaahXsN2hlOeNGebfBOc7mejJUeH8aL7LOWvAAb2G9HAfdYScdcTF 4s68R+QpjWaM4vhQIPvKFGec/m8HaX/WNWlpUZ94g9EbySPKNjSti3B8tfyP7+ySV4l2 UouTIoCo7KCupKd03E9bvE2ReDwQb5DPEK57e0jnRsOWkSgWRvLqDBADp6ZhM/S4v0Y2 UKFpSmEUAeAk2G9YWqX1eBxyfdEi2R//M0d4JIb77RxHsL+iTukzR4UEoKRNidYpEoPC PU562jVZvmzhHcPakDuvYHSy9Y3v+8fNHdme5ObZfCfkYq2wvdh+0XlqXFVPeRjccYu2 BHMw== 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=nKDaeGp5EKkZDqIsokus1OmDmfvkWgZNrRNY08uRrUc=; b=q+lIdgxcE+qEo+P1VZ0R0Ps+ZDzFlv/03hCfUtS/6rzEd5V5BnIsMdezsZlK+z1CcR ngATpXBZMQiX+nXLsYq4SGS41jstB+eOurpQ5jDma4JgeCPsxDOY9E8E9wNUZlIqQ+Er z/ZIRyvbsDlLypQ31hoKd7Vfk74XNwAbwcZE6YGejKv7knbmgywo5dh7i3DLbDaUBGxm IcK+5U71a713VjfKgWpQBn0MS4xoqJw9pHjJbwrxKM2jCtEiCr4Vdi+UJIRoxbKdRo54 usOScAxGn8o9BwM84yEIo4Ye2k7N8WtVdkLAk4334XkTkoiqy5J43aG0hYzPPg1prmb2 6g2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=FYeN9SBM; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w188-20020a6262c5000000b0063d289b8d47si2866775pfb.126.2023.04.17.22.31.24; Mon, 17 Apr 2023 22:31:38 -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=FYeN9SBM; 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 S230308AbjDRF3U (ORCPT + 99 others); Tue, 18 Apr 2023 01:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbjDRF3O (ORCPT ); Tue, 18 Apr 2023 01:29:14 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70B0E5245 for ; Mon, 17 Apr 2023 22:29:13 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-552f169d85eso27237227b3.13 for ; Mon, 17 Apr 2023 22:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681795752; x=1684387752; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=nKDaeGp5EKkZDqIsokus1OmDmfvkWgZNrRNY08uRrUc=; b=FYeN9SBMek5PY0NUGiKB4PDLSCJlT+j7HehxrNt6HMPnXxkb2hDFelKYyUgKjiziLJ tVL1u6x5vxXSoC1takibB3sIH8S5a4H/zcAlUkmwd/KdiZUbajfB7BLtA9HeauREN51e nXpSIgJ6Rhyfs8s9UE+1sdCU+RjVrt24eppqDajoloeN9DjHFI1gZzPGdoKCX21oevkM 7BV4SlPWznZ6RPNiZJQNSzTfqp5FCxtuyrMusF6mbwi3CATBxDGXZAtz2m1Bj2gtnO1D rn6UAwLmvLFoSrIo1NjxrVFRxc7oNUiE8XEtQ3ICRudfANtgmGOv/eB+zA6LPING2H7J jDGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681795752; x=1684387752; 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=nKDaeGp5EKkZDqIsokus1OmDmfvkWgZNrRNY08uRrUc=; b=dALqd+OYa5KhdCJ4l9bO8MFBfL4Rf2Huoh7cbITabWYfnWc46hsGTWpNlLZnGCZXai bh46ajGmebyD6tJNUwFdzwZfhxH7gyTPZP60czBs3zyjL6Ggcp5Okw0lCZ4GHRweA4Rw QvwmMQlJyig5QfWXgloU5lC2thU29DXNqQmSqHbRYx2Oub9NmIh0iuJwc04DbAKw8fI0 dlb2v0CixSHjcDjz5qxb5KfetRF9XEhtVQqw6PqGonLcW74PU/eZ8whjqu4Iq399k0fM iqqQ1jp/bonBjj3fSu8UOXMICVrUHS/Mh9O6rrPpDpq9+0HuxQTi4dM3ABpO7iMpBOrA yNxw== X-Gm-Message-State: AAQBX9ezczfHePAA/98mZ0nOwtMuE72y5ooqaJhU+uhQRuMOy5eHhni4 RzLME+OQv3te4hCiqWtm2MkT0iTU7/L26g== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a81:ac57:0:b0:54d:3afc:d503 with SMTP id z23-20020a81ac57000000b0054d3afcd503mr11607964ywj.8.1681795752753; Mon, 17 Apr 2023 22:29:12 -0700 (PDT) Date: Tue, 18 Apr 2023 05:28:58 +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-2-joychakr@google.com> Subject: [PATCH v7 1/5] spi: dw: Add 32 bpw support to SPI DW DMA driver 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 Content-Type: text/plain; charset="UTF-8" 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 Add Support for AxSize = 4 bytes configuration from dw dma driver if n_bytes i.e. number of bytes per write to fifo is 4. Number of bytes written to fifo per write is depended on the bits/word configuration being used which the DW core driver translates to n_bytes. Hence, for bits per word values between 17 and 32 n_bytes should be equal to 4. Signed-off-by: Joy Chakraborty --- drivers/spi/spi-dw-dma.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c index ababb910b391..c1b42cb59965 100644 --- a/drivers/spi/spi-dw-dma.c +++ b/drivers/spi/spi-dw-dma.c @@ -208,12 +208,16 @@ static bool dw_spi_can_dma(struct spi_controller *master, static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes) { - if (n_bytes == 1) + switch (n_bytes) { + case 1: return DMA_SLAVE_BUSWIDTH_1_BYTE; - else if (n_bytes == 2) + case 2: return DMA_SLAVE_BUSWIDTH_2_BYTES; - - return DMA_SLAVE_BUSWIDTH_UNDEFINED; + case 4: + return DMA_SLAVE_BUSWIDTH_4_BYTES; + default: + return DMA_SLAVE_BUSWIDTH_UNDEFINED; + } } static int dw_spi_dma_wait(struct dw_spi *dws, unsigned int len, u32 speed) -- 2.40.0.634.g4ca3ef3211-goog