From patchwork Mon Mar 20 05:57:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 71996 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1038723wrt; Sun, 19 Mar 2023 23:02:07 -0700 (PDT) X-Google-Smtp-Source: AK7set/HnmIT8/1Tj357hURyQ9SQ9BRYK1lL8WFfBItjv7y3Sf1BA6GEcABOuq2s+WBBGYk9bclB X-Received: by 2002:a05:6a20:1585:b0:d9:a977:fae with SMTP id h5-20020a056a20158500b000d9a9770faemr2260188pzj.3.1679292127274; Sun, 19 Mar 2023 23:02:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679292127; cv=none; d=google.com; s=arc-20160816; b=OHw6OjGJVZRLdqygtL+lxn0Ki8PxCEX+cBHenq2VcyG1TAqTqZRemZssTIaUfw5ED+ +EBN5prFyNX3hJHdFJ58I9G/qwCun5yDVsW1KsmGlWTIeQ2IZmSX7tg2BI4aYsjcOAjr ulK9NxYn0J24KQWBgWYT7NcPyy34Jkl9WnpFEThgf3qvNcvyJPdB12dzJqQ+ZO750L/b P97xWNGbNCDpn64RFLlUbF0ah0lVAZtzUrCOnBCA3Ga9nEraw+C28xy6jwcCzmP1z91H 2mLhoL0xh7INfGLVodqNqTEWCxNfoYlEq62IQqNHb+LO9Xk3lETYnYaohjvfRCgIeAbd 0MUQ== 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:mime-version:date :dkim-signature; bh=5UZlQUAmu7strlARsPQbQHPgHSDO20yOQ6kUECkItXc=; b=sfITHQDQBj0IK4xXjQQdavA29n5hlNWEPHULecSP+nGrq5Ue5AYe9XxGOIfLPQeRS7 HS6t8xrvitLrhS/Mm54EtiNHbICQhNqGLG92jfikL2lr9Ugnk/Mhaz4RdDezJ2xkz01G hpjQeMkDzq4d+kjYFEoJMYsgePFBNrvKEECnnyJGR8tfAY4Z20WpqS+hij1ZYsLILXy4 VB9X+fKXoIxq44NOVB9RTL5E/5mIeicsDZq3rI05FG0+yUEHLb7IKUw0u5E6tmPNLjrr E++lMr8WjgDmmgWqvzKI+0UIS5ScniafF4R3lGrT8vhHidUm6P6S1FQJ0CGZlDPWvVgL OyTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ZGoucMXz; 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 bc22-20020a656d96000000b00503a029385asi9322778pgb.849.2023.03.19.23.01.54; Sun, 19 Mar 2023 23:02:07 -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=20210112 header.b=ZGoucMXz; 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 S229579AbjCTF6Z (ORCPT + 99 others); Mon, 20 Mar 2023 01:58:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbjCTF6X (ORCPT ); Mon, 20 Mar 2023 01:58:23 -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 4CC001C590 for ; Sun, 19 Mar 2023 22:58:22 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-544b71b3114so101682367b3.13 for ; Sun, 19 Mar 2023 22:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679291901; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=5UZlQUAmu7strlARsPQbQHPgHSDO20yOQ6kUECkItXc=; b=ZGoucMXzkK8RqTMy7kBVUHeV2x3N35UO0fn9jRYc+Wjus9NaoUiSWkJaajLEQfHP3M ju46UGN9iptwq1DJfcGaJnVRvdpuAANsUenZ5jhM+EzRz7v6kbz8UWrXS9vpB84gmRgn 7Pt2oHhruERAujOw5jkT+D2jD124DQVdCFLb3VxaMGYeIXMlU3NKl4eXZbKoadiEhl1g 840EERPWrEUBTmUt91m1oBAvMO1cpG15MZIV78pnQNzyMP0DEC7bKWgRTA+UIJ8Ypnn0 sPn8vV5VJMLc5bR9vdaRFKs5soo4RWPR0TnxJ7OSmGFfKbrSfWPOObbHGmLs7UeXvxsm Bjow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679291901; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5UZlQUAmu7strlARsPQbQHPgHSDO20yOQ6kUECkItXc=; b=3R8UcEhRSbS2joKtMgffJsFl6Q5HKevdLnie0aQpvflnUqsM4gPDX65xJLjGWFTAVG nrZMFu9q28bW8xTDUYi0HyrcM2ER1XufLNmMjmiwC1OXuuVF0F7uYl3MaO14I4KXOvR9 514b/z5o038IGj8GNhAbmS2OCN9lMrwom0u+jxT0wR5JT3QtSSP9GGwaXEZa9grQhNVQ 8cO5YPnvkxw5Re59IJaXEfVxQOEDWjKqvKEN7HaWs51cJ+ffNW3ahWX3RfPeKI/LwULj 1p9OaVd4NF7FZ11t3ytSmR8y1uFDitBgnzGCBDF+Xv15xXT5gHp/kJGqjMh+fBhf1H1x ROzA== X-Gm-Message-State: AO0yUKUw8QQUTs2+ZBxBnqYhUtUILEtxLQj4BfvYKYk1X/YFBM6Jr+Yl 95qnXlfrm/ZFo/H2be1mZaYH8o0Ubv/mBA== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a5b:9d0:0:b0:b46:4a5e:365f with SMTP id y16-20020a5b09d0000000b00b464a5e365fmr4714335ybq.8.1679291901466; Sun, 19 Mar 2023 22:58:21 -0700 (PDT) Date: Mon, 20 Mar 2023 05:57:46 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.40.0.rc1.284.g88254d51c5-goog Message-ID: <20230320055746.2070049-1-joychakr@google.com> Subject: [PATCH] spi: dw: Add 32 bpw support to DW DMA Controller From: Joy Chakraborty To: Serge Semin , Mark Brown 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,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?1760865421840955813?= X-GMAIL-MSGID: =?utf-8?q?1760865421840955813?= If DW Controller is capable of 32 bits per word support then SW or DMA controller has to write 32bit or 4byte data to the FIFO at a time. This Patch adds support for AxSize = 4 bytes configuration from dw dma driver if n_bytes i.e. number of bytes per write to fifo is 4. Signed-off-by: Joy Chakraborty --- drivers/spi/spi-dw-dma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c index ababb910b391..7d06ecfdebe1 100644 --- a/drivers/spi/spi-dw-dma.c +++ b/drivers/spi/spi-dw-dma.c @@ -212,6 +212,8 @@ static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes) return DMA_SLAVE_BUSWIDTH_1_BYTE; else if (n_bytes == 2) return DMA_SLAVE_BUSWIDTH_2_BYTES; + else if (n_bytes == 4) + return DMA_SLAVE_BUSWIDTH_4_BYTES; return DMA_SLAVE_BUSWIDTH_UNDEFINED; }