From patchwork Tue Nov 26 07:35:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Poddar, Sourav" X-Patchwork-Id: 294285 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 ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6A4A12C0355 for ; Tue, 26 Nov 2013 21:17:07 +1100 (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 1VlDDl-0007KE-0g; Tue, 26 Nov 2013 07:38:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VlDD1-0002xz-KM; Tue, 26 Nov 2013 07:37:23 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VlDCF-0002k5-Bp for linux-mtd@lists.infradead.org; Tue, 26 Nov 2013 07:36:36 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id rAQ7aDh5021287; Tue, 26 Nov 2013 01:36:13 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id rAQ7aDCt002630; Tue, 26 Nov 2013 01:36:13 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Tue, 26 Nov 2013 01:36:12 -0600 Received: from a0131647.apr.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id rAQ7ZLY2030173; Tue, 26 Nov 2013 01:36:10 -0600 From: Sourav Poddar To: , , , Subject: [PATCH 13/17] drivers: mtd: m25p80: Add api to configure master register. Date: Tue, 26 Nov 2013 13:05:09 +0530 Message-ID: <1385451313-1875-14-git-send-email-sourav.poddar@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1385451313-1875-1-git-send-email-sourav.poddar@ti.com> References: <1385451313-1875-1-git-send-email-sourav.poddar@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131126_023636_150795_08EEC15B X-CRM114-Status: GOOD ( 10.29 ) X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.153 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: devicetree@vger.kernel.org, Sourav Poddar , linux-omap@vger.kernel.org, bcousson@baylibre.com, balbi@ti.com 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: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org These can be used to fill information needed to configure master controller registers. Signed-off-by: Sourav Poddar --- drivers/mtd/devices/m25p80.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 7dc2c14..6a27677 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -490,6 +490,23 @@ static inline int m25p80_dummy_cycles_read(struct m25p *flash) } /* + * This API can be used to transfer flash information to + * SPI controller which needs some of its registers to get + * configured on flash. + */ +static void m25p80_fill_flash_information(struct m25p *flash) +{ + struct spi_master *master = flash->spi->master; + u8 info[4]; + info[0] = flash->read_opcode; + info[1] = flash->program_opcode; + info[2] = flash->addr_width; + info[3] = m25p80_dummy_cycles_read(flash); + + master->configure_from_slave(flash->spi, info); +} + +/* * Read an address range from the flash chip. The address range * may be any size provided it is within the physical boundaries. */