From patchwork Fri Dec 6 14:24:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Poddar, Sourav" X-Patchwork-Id: 298030 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 CE1ED2C0095 for ; Sat, 7 Dec 2013 01:26:56 +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 1VowMD-0005Ss-Mr; Fri, 06 Dec 2013 14:26:18 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VowM0-0007Ru-2X; Fri, 06 Dec 2013 14:26:04 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VowLq-0007KY-NA for linux-mtd@lists.infradead.org; Fri, 06 Dec 2013 14:25:56 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id rB6EPQHH004191; Fri, 6 Dec 2013 08:25:26 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id rB6EPQfS015754; Fri, 6 Dec 2013 08:25:26 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Fri, 6 Dec 2013 08:25:25 -0600 Received: from a0131647.apr.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id rB6EOqhC000982; Fri, 6 Dec 2013 08:25:23 -0600 From: Sourav Poddar To: , , , Subject: [PATCHv2 06/10] drivers: mtd: m25p80: Add api to configure master register. Date: Fri, 6 Dec 2013 19:54:47 +0530 Message-ID: <1386339891-32717-7-git-send-email-sourav.poddar@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1386339891-32717-1-git-send-email-sourav.poddar@ti.com> References: <1386339891-32717-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-20131206_092555_000074_BFE5B1FA X-CRM114-Status: UNSURE ( 9.83 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.1 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.152 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.2 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, balbi@ti.com, linux-mtd@lists.infradead.org, bcousson@baylibre.com, Sourav Poddar , linux-omap@vger.kernel.org, dwmw2@infradead.org 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 --- v1->v2: instead of a u8 *val, use a struct (slave_info) already defined in the first patch of the series. This will allow us to add more parameters into the struct. drivers/mtd/devices/m25p80.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 7dc2c14..b90c7e5 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -490,6 +490,24 @@ 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 information. + */ +static void m25p80_fill_flash_information(struct m25p *flash) +{ + struct spi_device *spi = flash->spi; + struct spi_master *master = spi->master; + + spi->info.read_opcode = flash->read_opcode; + spi->info.program_opcode = flash->program_opcode; + spi->info.addr_width = flash->addr_width; + spi->info.dummy_cycles = m25p80_dummy_cycles_read(flash); + + master->configure_from_slave(flash->spi); +} + +/* * Read an address range from the flash chip. The address range * may be any size provided it is within the physical boundaries. */