From patchwork Tue Aug 27 00:50:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?546L5a6H6Iiq?= X-Patchwork-Id: 270003 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (unknown [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E5B342C009F for ; Tue, 27 Aug 2013 10:51:59 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VE7Vb-0007fZ-Fu; Tue, 27 Aug 2013 00:51:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VE7VZ-0005Hc-LC; Tue, 27 Aug 2013 00:51:45 +0000 Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VE7VX-0005G0-BL for linux-mtd@lists.infradead.org; Tue, 27 Aug 2013 00:51:43 +0000 Received: by mail-pb0-f52.google.com with SMTP id wz12so4083642pbc.39 for ; Mon, 26 Aug 2013 17:51:21 -0700 (PDT) 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=GfkmgIywFAth27qCkZ2biNhv8/CRNrKhwq5o0/1kzdM=; b=EW0iYsoHSqj5WD6d27us3PGAtzTmPnxpHxD80rcVoVpdiKTQ6Jailw6pyzhnW3ldEC m7yC7GHrAxZYHTEv/2xgFLJdFpr9PyjY2nY7g96YRDQeW0eWpdvWrXw4OEEOKnE68LZO e3zJPBFkZibT6BGjXW9cy/Za52dezJs9HhRwTmZSO/M0l81hfOTICIasKS3emd+5LMBg S9ofADy5RJFqQAXymJJvZzz3GZ+6S3y8dECTTdeLBvhvOZ4Htsab0ctny3qAr4jog9p6 I45jixvGWkr0hNCdwRK5lUtXiGh3dhqyMYNaMkChAVSw3nPiGHx4umMXrRs/MYEEGVUL tP1Q== X-Received: by 10.68.236.168 with SMTP id uv8mr18194050pbc.124.1377564681792; Mon, 26 Aug 2013 17:51:21 -0700 (PDT) Received: from localhost.localdomain ([218.24.172.134]) by mx.google.com with ESMTPSA id yo2sm22962216pab.8.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 Aug 2013 17:51:21 -0700 (PDT) From: wangyuhang To: broonie@kernel.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [PATCH V2 2/2] spi: dual and quad support(device tree) Date: Tue, 27 Aug 2013 08:50:03 +0800 Message-Id: <1377564603-4030-2-git-send-email-wangyuhang2014@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1377564603-4030-1-git-send-email-wangyuhang2014@gmail.com> References: <1377564603-4030-1-git-send-email-wangyuhang2014@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130826_205143_474613_CB89FC74 X-CRM114-Status: UNSURE ( 9.10 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.8 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (wangyuhang2014[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (wangyuhang2014[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: sourav.poddar@ti.com, pekon@ti.com, wangyuhang X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add spi-tmax-nbits and spi-rmax-nbits for spi slave node. Modify the related dt document(spi-bus.txt) spi-tmax-nbits:Max number of bits slave will use for MOSI(writting) spi-rmax-nbits:Max number of bits slave will use for MISO(reading) Support for spi-tx/rmax-nbits in SPI framework has been picked[1]. [1]: http://comments.gmane.org/gmane.linux.kernel.spi.devel/14420 Commit Id:f477b7fb13df2b843997559ff34e87d054ba6538 Signed-off-by: wangyuhang Acked-by: Pekon Gupta --- Documentation/devicetree/bindings/spi/spi-bus.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/spi/spi-bus.txt b/Documentation/devicetree/bindings/spi/spi-bus.txt index 296015e..211336c 100644 --- a/Documentation/devicetree/bindings/spi/spi-bus.txt +++ b/Documentation/devicetree/bindings/spi/spi-bus.txt @@ -55,6 +55,22 @@ contain the following properties. chip select active high - spi-3wire - (optional) Empty property indicating device requires 3-wire mode. +- spi-tmax-nbits - (optional) Max number of bits slave will use for + MOSI(writting) +- spi-rmax-nbits - (optional) Max number of bits slave will use for + MISO(reading) + +So if for example the slave has 4 wires for writting and 2 wires for reading, +and the spi-tx/rx-nbits property should be set as follows: + +spi-tmax-nbits = <4>; +spi-rmax-nbits = <2>; + +Now the value that spi-tmax-nbits and spi-rmax-nbits can receive is only +1(single), 2(dual) and 4(quad). If you don't set spi-tmax-nbits or spi-rmax-nbits, +spi_device mode will be set in single(1 wire) as default. Another point, if +property:spi-3wire is set, spi-t/rmax-nbits is forbidden to set to <2 or 4>, +otherwise, an errro will return. If a gpio chipselect is used for the SPI slave the gpio number will be passed via the cs_gpio