From patchwork Sat Dec 26 15:53:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Weseloh X-Patchwork-Id: 7922111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0113A9F387 for ; Sat, 26 Dec 2015 15:55:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19E43202FF for ; Sat, 26 Dec 2015 15:55:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30BD9202EB for ; Sat, 26 Dec 2015 15:55:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aCrA5-00077a-9D; Sat, 26 Dec 2015 15:53:41 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aCrA2-00075w-0U for linux-arm-kernel@lists.infradead.org; Sat, 26 Dec 2015 15:53:39 +0000 Received: by mail-wm0-x22d.google.com with SMTP id p187so220375183wmp.0 for ; Sat, 26 Dec 2015 07:53:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5OfWOsQ5REk9JAidAEnIa52jwU2Swl72AUM+wZwIm2M=; b=KxBlSLUcVumGCblVg6noto1rzKGHukcB+bzsJMvBoSdeEJv0qTmghcREI/GIBaxkQc SQuWkQU5TDYNpPKQxH2/JmQgKbfE+f/hTSMIOCObXzBpa6di24msMJ7mwP5lcn7mP2yX fYLnvDpoToSEFfMmjfiXYnzRl2Vn0IaFbzXSaa4+N2oW8caFbB2xW9p2BdM3ilqPYGw9 uJSVZlo11hWqy8aDAYM7MT1xwXSlGz7MCmi8/InZNcOSdrChgDXIBGSZJiKeW2cMLSLI DlcrGAvk4dna4J7z1hu/m5Ejtwby0d/KJs0DjR+NMemy3Kx+czddg5DoKv0GUSQRPFbs gkpg== X-Received: by 10.194.82.229 with SMTP id l5mr55235835wjy.140.1451145200489; Sat, 26 Dec 2015 07:53:20 -0800 (PST) Received: from speedy.fritz.box (p5793D053.dip0.t-ipconnect.de. [87.147.208.83]) by smtp.gmail.com with ESMTPSA id l7sm49396737wjx.14.2015.12.26.07.53.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 26 Dec 2015 07:53:18 -0800 (PST) From: Marcus Weseloh To: linux-sunxi@googlegroups.com Subject: [PATCH v6 1/3] spi: dts: Add new device property to specifcy a wait time between word transmissions Date: Sat, 26 Dec 2015 16:53:04 +0100 Message-Id: <1451145186-14235-2-git-send-email-mweseloh42@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1451145186-14235-1-git-send-email-mweseloh42@gmail.com> References: <1451145186-14235-1-git-send-email-mweseloh42@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151226_075338_245606_1BE52DE6 X-CRM114-Status: GOOD ( 11.54 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Pawel Moll , Ian Campbell , Mark Brown , linux-kernel@vger.kernel.org, Rob Herring , linux-spi@vger.kernel.org, Chen-Yu Tsai , Marcus Weseloh , Kumar Gala , Maxime Ripard , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Adds a new property "spi-word-wait-ns" to the spi-bus binding that allows SPI slave devices to set a wait time between the transmission of words. Signed-off-by: Marcus Weseloh Reviewed-by: Maxime Ripard Acked-by: Rob Herring --- Documentation/devicetree/bindings/spi/spi-bus.txt | 2 ++ drivers/spi/spi.c | 2 ++ include/linux/spi/spi.h | 2 ++ 3 files changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt index bbaa857..434d321 100644 --- a/Documentation/devicetree/bindings/spi/spi-bus.txt +++ b/Documentation/devicetree/bindings/spi/spi-bus.txt @@ -61,6 +61,8 @@ contain the following properties. used for MOSI. Defaults to 1 if not present. - spi-rx-bus-width - (optional) The bus width(number of data wires) that used for MISO. Defaults to 1 if not present. +- spi-word-wait-ns - (optional) Delay between transmission of words + in nanoseconds Some SPI controllers and devices support Dual and Quad SPI transfer mode. It allows data in the SPI system to be transferred in 2 wires(DUAL) or 4 wires(QUAD). diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 2b0a8ec..186373b 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1467,6 +1467,8 @@ of_register_spi_device(struct spi_master *master, struct device_node *nc) if (of_find_property(nc, "spi-lsb-first", NULL)) spi->mode |= SPI_LSB_FIRST; + of_property_read_u32(nc, "spi-word-wait-ns", &spi->word_wait_ns); + /* Device DUAL/QUAD mode */ if (!of_property_read_u32(nc, "spi-tx-bus-width", &value)) { switch (value) { diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index cce80e6..ea3037f 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -118,6 +118,7 @@ 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 * when not using a GPIO line) + * @word_wait_ns: A wait time between word transfers in nanoseconds * * @statistics: statistics for the spi_device * @@ -158,6 +159,7 @@ struct spi_device { void *controller_data; char modalias[SPI_NAME_SIZE]; int cs_gpio; /* chip select gpio */ + u32 word_wait_ns; /* wait time between words */ /* the statistics */ struct spi_statistics statistics;