From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751618AbdDBRGO (ORCPT ); Sun, 2 Apr 2017 13:06:14 -0400 Received: from 1.mo69.mail-out.ovh.net ([178.33.251.173]:38810 "EHLO 1.mo69.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751033AbdDBRGN (ORCPT ); Sun, 2 Apr 2017 13:06:13 -0400 Subject: Re: [PATCH v5 2/6] mtd: m25p80: add support of SPI 1-2-2 and 1-4-4 protocols To: Cyrille Pitchen , marek.vasut@gmail.com, linux-mtd@lists.infradead.org, jartur@cadence.com, kdasu.kdev@gmail.com, mar.krzeminski@gmail.com References: <3426fd033830e2df15eae27c1b5284983961fa8e.1490220411.git.cyrille.pitchen@atmel.com> Cc: boris.brezillon@free-electrons.com, richard@nod.at, nicolas.ferre@microchip.com, linux-kernel@vger.kernel.org, computersforpeace@gmail.com, dwmw2@infradead.org From: Cyrille Pitchen Message-ID: <278ef3b6-599a-5254-932d-33ceb1b73a88@wedev4u.fr> Date: Sun, 2 Apr 2017 19:05:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <3426fd033830e2df15eae27c1b5284983961fa8e.1490220411.git.cyrille.pitchen@atmel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 3423580144584316773 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelhedrleehgddutdelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenuc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 23/03/2017 à 00:33, Cyrille Pitchen a écrit : > Before this patch, m25p80_read() supported few SPI protocols: > - regular SPI 1-1-1 > - SPI Dual Output 1-1-2 > - SPI Quad Output 1-1-4 > On the other hand, m25p80_write() only supported SPI 1-1-1. > > This patch updates both m25p80_read() and m25p80_write() functions to let > them support SPI 1-2-2 and SPI 1-4-4 protocols for Fast Read and Page > Program SPI commands. > > It adopts a conservative approach to avoid regressions. Hence the new > implementations try to be as close as possible to the old implementations, > so the main differences are: > - the tx_nbits values now being set properly for the spi_transfer > structures carrying the (op code + address/dummy) bytes > - and the spi_transfer structure being split into 2 spi_transfer > structures when the numbers of I/O lines are different for op code and > for address/dummy byte transfers on the SPI bus. > > Besides, the current spi-nor framework supports neither the SPI 2-2-2 nor > the SPI 4-4-4 protocols. So, for now, we don't need to update the > m25p80_{read|write}_reg() functions as SPI 1-1-1 is the only one possible > protocol. > > Signed-off-by: Cyrille Pitchen Applied to github/spi-nor