Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6444793imu; Wed, 30 Jan 2019 15:03:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN71ijLA2HQCPiTt/FLKh/dxq45Oe9QkNf3BUTuD2ECWI5i9SjHe1eVOn98yYV65oMdTr5aJ X-Received: by 2002:a17:902:aa82:: with SMTP id d2mr32426932plr.153.1548889404293; Wed, 30 Jan 2019 15:03:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548889404; cv=none; d=google.com; s=arc-20160816; b=idO2gRH4yXX6sYOAGS5Mri41tTI/EPDzI/Oia+6AQMyEZMj48DB8QC/syhDJqp+jOM 8c+8ueYMKCFsQDmTqyQbASxUxiqPjwLNx7jpAIDcFuWSjTmw2gQMqy15cT3ycv8fMgaU oheEDaSMklIk+hJQoSnoTRio1W86zfyBoLzefo8z2oZRYLgWfDgkuKBTPUk0N5FToHwl xba3EkkN+929DqIXyCSzP8hS465JrLDexWJ3HDYiZ2OtxJS5EfBHWvHptWE6UlzO7LDA ZECJYRhQK534QWU+4TYhqyK8xnHWRBm+WVWNzirsKNaoQklpItqGis8yU2l7APhKafQr QM5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=LQY6Rl/QQPWOOJEftcW1GrzBpJlT0qScx46dLh7/KiE=; b=h7UGnwUxoFOLR7ATvpwmuuGq3P1jcRcANPdRe7+DNey7Q/OqY8K/It6cRUOswhxgwa en0eNs714QbugOmIOwhsXvU3sigH6ikFJHaSCYKHGJxTy9vEv+iQzVcH+lGmFzXHFEww e6a3tybqOqOm/SD7BI9uXrYV1K+o6enuzke6w9CjJZd5xTo8khmw+X9N3jj45nM50DdZ LSlunBcPIPsne+AbjEuW9x7H776YD9OepRR6wZMHXDR6C304OTEiTrv1X/2PPJFoJccP EIsMe0sybXmAXU4ESFdRtP2uZfYuosq3tg3YhQ+tY0RIg0nOBFYrYjhWX6lIiehtn53n T3MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=QcuPORGF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15si2664980pgt.498.2019.01.30.15.03.09; Wed, 30 Jan 2019 15:03:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=QcuPORGF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727974AbfA3XDE (ORCPT + 99 others); Wed, 30 Jan 2019 18:03:04 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:56420 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725798AbfA3XC7 (ORCPT ); Wed, 30 Jan 2019 18:02:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=LQY6Rl/QQPWOOJEftcW1GrzBpJlT0qScx46dLh7/KiE=; b=QcuPORGFYnUq 5XnpDKQxGwAbpo8nIdD0nV3vI8w2aZFQxeke9Gs2/CU+MFJ3lGfY15S61CbSx5YPaFTN+Hikq1DbM gdMhH98C61Mo0y9SCozYw7VuNAnDP6zQSur9b0bWzx5+kw+ruu5SvFG7GqX+E42kt08VlQMhqMwOf 0LYWk=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1goysc-0000DG-GN; Wed, 30 Jan 2019 23:02:50 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id C3857440082; Wed, 30 Jan 2019 23:02:47 +0000 (GMT) From: Mark Brown To: Jonas Bonn Cc: Nicolas Ferre , Mark Brown , linux-kernel@vger.kernel.org, Nicolas Ferre , Mark Brown , Alexandre Belloni , Ludovic Desroches , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org Subject: Applied "spi-atmel: support inter-word delay" to the spi tree In-Reply-To: <20190130084005.18649-3-jonas@norrbonn.se> X-Patchwork-Hint: ignore Message-Id: <20190130230247.C3857440082@finisterre.ee.mobilebroadband> Date: Wed, 30 Jan 2019 23:02:47 +0000 (GMT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch spi-atmel: support inter-word delay has been applied to the spi tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 473a78a7bbeb7c77b81b596095f59ce4fbbd49dc Mon Sep 17 00:00:00 2001 From: Jonas Bonn Date: Wed, 30 Jan 2019 09:40:05 +0100 Subject: [PATCH] spi-atmel: support inter-word delay If the SPI slave requires an inter-word delay, configure the DLYBCT register accordingly. Tested on a SAMA5D2 board (derived from SAMA5D2-Xplained reference board). Signed-off-by: Jonas Bonn Acked-by: Nicolas Ferre CC: Nicolas Ferre CC: Mark Brown CC: Alexandre Belloni CC: Ludovic Desroches CC: linux-spi@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org Signed-off-by: Mark Brown --- drivers/spi/spi-atmel.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c index f53f0c5e63da..4954f0ab1606 100644 --- a/drivers/spi/spi-atmel.c +++ b/drivers/spi/spi-atmel.c @@ -1201,13 +1201,14 @@ static int atmel_spi_setup(struct spi_device *spi) csr |= SPI_BIT(CSAAT); /* DLYBS is mostly irrelevant since we manage chipselect using GPIOs. - * - * DLYBCT would add delays between words, slowing down transfers. - * It could potentially be useful to cope with DMA bottlenecks, but - * in those cases it's probably best to just use a lower bitrate. */ csr |= SPI_BF(DLYBS, 0); - csr |= SPI_BF(DLYBCT, 0); + + /* DLYBCT adds delays between words. This is useful for slow devices + * that need a bit of time to setup the next transfer. + */ + csr |= SPI_BF(DLYBCT, + (as->spi_clk / 1000000 * spi->word_delay_usecs) >> 5); asd = spi->controller_state; if (!asd) { -- 2.20.1