Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754361AbbHYBql (ORCPT ); Mon, 24 Aug 2015 21:46:41 -0400 Received: from mailout.micron.com ([137.201.242.129]:57522 "EHLO mailout.micron.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753807AbbHYBqj convert rfc822-to-8bit (ORCPT ); Mon, 24 Aug 2015 21:46:39 -0400 From: =?iso-2022-jp?B?QmVhbiBIdW8gGyRCcDlJTElMGyhCIChiZWFuaHVvKQ==?= To: Cyrille Pitchen , "nicolas.ferre@atmel.com" , "broonie@kernel.org" , "linux-spi@vger.kernel.org" , "dwmw2@infradead.org" , "computersforpeace@gmail.com" , "zajec5@gmail.com" , "juhosg@openwrt.org" , "marex@denx.de" , "shijie.huang@intel.com" , "ben@decadent.org.uk" CC: "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "robh+dt@kernel.org" , "pawel.moll@arm.com" , "mark.rutland@arm.com" , "ijc+devicetree@hellion.org.uk" , "galak@codeaurora.org" , "linux-mtd@lists.infradead.org" Subject: RE: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for Atmel QSPI controller Thread-Topic: [PATCH linux-next v4 5/5] mtd: atmel-quadspi: add driver for Atmel QSPI controller Thread-Index: AQHQ3lfXCndbkplq1UW7U7VFb2oTgp4b7y2A Date: Tue, 25 Aug 2015 01:44:57 +0000 Message-ID: References: In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.167.84.5] X-TM-AS-Product-Ver: SMEX-11.0.0.4179-8.000.1202-21766.005 X-TM-AS-Result: No--1.022800-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No x-mt-checkinternalsenderrule: True Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1786 Lines: 63 >+ nor->read_reg = atmel_qspi_read_reg; >+ nor->write_reg = atmel_qspi_write_reg; >+ nor->read = atmel_qspi_read; >+ nor->write = atmel_qspi_write; >+ nor->erase = atmel_qspi_erase; >+ nor->set_protocol = atmel_qspi_set_protocol; This is very good, the structure of spi_nor should add a hook function to notify spi controller That spi nor transfer protocol already changed. >+ >+ if (of_modalias_node(child, modalias, sizeof(modalias)) < 0) { >+ err = -ENODEV; >+ goto release_channel; >+ } >+ >+ err = of_property_read_u32(child, "spi-max-frequency", &aq->clk_rate); >+ if (err < 0) >+ goto release_channel; >+ >+ err = atmel_qspi_init(aq); >+ if (err) >+ goto release_channel; >+ >+ nor->dev->of_node = child; >+ err = spi_nor_scan(nor, modalias, SPI_NOR_QUAD); > goto release_channel; >+ ....... >static inline struct spi_nor *mtd_to_spi_nor(struct mtd_info *mtd) { return mtd->priv; >@@ -944,6 +960,11 @@ static int micron_quad_enable(struct spi_nor *nor) > return ret; > } > >+ /* switch protocol to Quad CMD 4-4-4 */ >+ ret = spi_nor_set_protocol(nor, SPI_PROTO_4_4_4); >+ if (ret) >+ return ret; >+ This make sense,from spi nor side,once its protocol being changed, Mtd layer must notify this status to spi nor controller immediately, And spi nor controller also should re-adjust its protocol. Otherwise, following reading SR operation will fail. > > ret = spi_nor_wait_till_ready(nor); > if (ret) > return ret; If my ack has any value in here, feel free to add it. Acked-by: Bean Huo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/