Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1692932imu; Sat, 26 Jan 2019 08:32:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN6pf4uptNXPwztzvIHs9K2L620vzSoRYtIpccKT6oaAm3ZqwloK3ljZgDUvNRrnpan+sVtf X-Received: by 2002:a17:902:9a04:: with SMTP id v4mr15759292plp.34.1548520374724; Sat, 26 Jan 2019 08:32:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548520374; cv=none; d=google.com; s=arc-20160816; b=ognJ0fkD8yFQ7odTZeVbHnmZK6d+t4JYqVwu7Kk0sQTKnWtta4bcoG+jCNWcQx2Mdk Zi3rFGeAOhFfe+1NBblsWK5vGvEzTyPimkOu6PXAUThYLZsCZaZX1ocqPaK6lYXLNkCc jVMVDQyN7kVtxhksbz954yGzniUEwDvb5GQ44dd56PWkzVDznS9+7lF70kfHgWROz/8l jxXc5B9E0CdEaS6Yo9QgtT76Vt+jQvU1xSsXTw5Mf6kWpJzUsXdoDesg6A3lQMsOPw03 /ogwkCSLkj0CVB7L7BnTcJY4Y6PmqXw92ll5q+nBWRCxHhmEYD7I/tezw/hSMNj89Sau Dbwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PsBSv2w17w6lFrPapCk73CTS8LZT3j2+sF5Y7dWKzLc=; b=vulktLfkYfW5njHKxy74rtR364KQoCesx9SFJkOAhHSbZxHcgff73GCRkJ9oa6JOZ5 EZpmxsaZ2kY+uZLT5BJ9yvIagEGrHb0ytPFWRZ8N8rx28u/0g3dPYd778Ocube9l9CzJ /BIs3UzBa15+t8y+jH7XpUIQkBOYLqa5vRfSpAwU3EXsaEWQH5OTVKKKJ+LS4T4HQzs5 Es/qCkADblMexYqSK53+71Ethg9D1In5jYN9+5/rXj7ynGWPxp6H4+Ov/ANy3fQmBBdP WJ5nLAtF/qxWIzVvrgfBo4swMe3N/xOBbIzzp965X/Lp7He9MXYMiMpnoLdg9hZaqu16 AQkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@norrbonn-se.20150623.gappssmtp.com header.s=20150623 header.b=VN86UBu8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p4si20635779pga.514.2019.01.26.08.32.39; Sat, 26 Jan 2019 08:32:54 -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=pass header.i=@norrbonn-se.20150623.gappssmtp.com header.s=20150623 header.b=VN86UBu8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726309AbfAZQca (ORCPT + 99 others); Sat, 26 Jan 2019 11:32:30 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:44053 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbfAZQc2 (ORCPT ); Sat, 26 Jan 2019 11:32:28 -0500 Received: by mail-lf1-f67.google.com with SMTP id z13so9006603lfe.11 for ; Sat, 26 Jan 2019 08:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=norrbonn-se.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PsBSv2w17w6lFrPapCk73CTS8LZT3j2+sF5Y7dWKzLc=; b=VN86UBu8NBXSChaiDHPIstNyAefKEC644yIFDOL81BghZ99qWqiGI4VWBaPrtVo+1S K2hAmpRAt7//vves1VSuPUaUdz4yAnsjEQPYdukgaHSVgxxgJ6rCJdgaB78Q7/nGNum7 2nWXt14pDtC3/z57oLpwMD8LoHhcJxMu1ZiAhQeASDKqJzmeTogsRbkMHpxh3eY17+fd eqW9vCKXIxQOqQGE+hwH+fWGjy0+g8d+AUVUOa7mS8ShT3t/OjFr075jfkO3LR4BlCP6 j58ehEqZ3rOK/s1teXBzJWt55x4rd7OWdBsfxpgVe/ZFQ2IIcOGtbKlYibtpppGcfRog 6+jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PsBSv2w17w6lFrPapCk73CTS8LZT3j2+sF5Y7dWKzLc=; b=i7hYQJsNiIIBMibduEQpd2eeXI5k0cB0F0RygHRkRz/dlchKLdOCUPajGOpWjquA3H QTjq0mqImG732stH3SvP5tgp7AwLLgjWyeogvMRG9ZEFCClh18rmSAzAuBj9Wj4scb7u ts4UXKt+8XNxSpIsja8xoPI5VyVcCdII+wcthZWr3Nq8sqbJWRLhEG/jHBdV7lkDpIcI rXQouTzFbH2yfgS0DQIK0JeWUiNJ+95f/h5Ds8CTFZVmWVuGSVzgNPCvHIAnb0kJdZxR e/zFWMgdIt3BQt/Q+S+1HLmThHAaO4UgubfY7sZTBjE+YOq+3rkvcmsqRJEq0EHGeG3T wdEQ== X-Gm-Message-State: AJcUukfzTvHycZOR/JRU3XRL315ya7hDMubxKvCmu9jJFDwVcFzWCcGL IRYGeUNpBQGmlAcvs02IJyfWrIlDI48= X-Received: by 2002:a19:c954:: with SMTP id z81mr11943281lff.150.1548520345708; Sat, 26 Jan 2019 08:32:25 -0800 (PST) Received: from mimer.lan (h-29-16.A159.priv.bahnhof.se. [79.136.29.16]) by smtp.gmail.com with ESMTPSA id e94sm2170532lfi.23.2019.01.26.08.32.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Jan 2019 08:32:25 -0800 (PST) From: Jonas Bonn To: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org Cc: Jonas Bonn , Mark Brown , Rob Herring , Mark Rutland , devicetree@vger.kernel.org Subject: [PATCH v3 1/2] spi: support inter-word delay requirement for devices Date: Sat, 26 Jan 2019 17:32:19 +0100 Message-Id: <20190126163220.26421-2-jonas@norrbonn.se> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190126163220.26421-1-jonas@norrbonn.se> References: <20190126163220.26421-1-jonas@norrbonn.se> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some devices are slow and cannot keep up with the SPI bus and therefore require a short delay between words of the SPI transfer. The example of this that I'm looking at is a SAMA5D2 with a minimum SPI clock of 400kHz talking to an AVR-based SPI slave. The AVR cannot put bytes on the bus fast enough to keep up with the SoC's SPI controller even at the lowest bus speed. This patch introduces the ability to specify a required inter-word delay for SPI devices. It is up to the controller driver to configure itself accordingly in order to introduce the requested delay. Signed-off-by: Jonas Bonn CC: Mark Brown CC: Rob Herring CC: Mark Rutland CC: linux-spi@vger.kernel.org CC: devicetree@vger.kernel.org --- include/linux/spi/spi.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index 314d922ca607..8e410de02af4 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -118,6 +118,8 @@ void spi_statistics_add_transfer_stats(struct spi_statistics *stats, * for driver coldplugging, and in uevents used for hotplugging * @cs_gpio: gpio number of the chipselect line (optional, -ENOENT when * not using a GPIO line) + * @word_delay: microsecond delay to be inserted between consecutive words + * of a transfer * * @statistics: statistics for the spi_device * @@ -164,6 +166,7 @@ struct spi_device { char modalias[SPI_NAME_SIZE]; const char *driver_override; int cs_gpio; /* chip select gpio */ + uint16_t word_delay; /* inter-word delay (us) */ /* the statistics */ struct spi_statistics statistics; -- 2.19.1