From patchwork Tue Nov 10 05:29:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vignesh Raghavendra X-Patchwork-Id: 7588241 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B0580C05C6 for ; Tue, 10 Nov 2015 05:32:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB83B20639 for ; Tue, 10 Nov 2015 05:32:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EFCB020395 for ; Tue, 10 Nov 2015 05:32:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751469AbbKJFaw (ORCPT ); Tue, 10 Nov 2015 00:30:52 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:54972 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750893AbbKJFau (ORCPT ); Tue, 10 Nov 2015 00:30:50 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id tAA5UKRO007642; Mon, 9 Nov 2015 23:30:20 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAA5UKo7015559; Mon, 9 Nov 2015 23:30:20 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Mon, 9 Nov 2015 23:30:21 -0600 Received: from uda0132425.apr.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id tAA5U5vD023652; Mon, 9 Nov 2015 23:30:17 -0600 From: Vignesh R To: Mark Brown , Tony Lindgren CC: Rob Herring , Michal Suchanek , Russell King , Vignesh R , , , , , , Subject: [PATCH v3 3/5] mtd: devices: m25p80: add support for mmap read request Date: Tue, 10 Nov 2015 10:59:57 +0530 Message-ID: <1447133399-25658-4-git-send-email-vigneshr@ti.com> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1447133399-25658-1-git-send-email-vigneshr@ti.com> References: <1447133399-25658-1-git-send-email-vigneshr@ti.com> MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Certain spi controllers may support memory mapped interface to read from m25p80 type flash devices. This interface provides better read performance than regular SPI interface. Call spi_mtd_mmap_read() interface, if supported, to make use of memory-mapped interface. Signed-off-by: Vignesh R --- drivers/mtd/devices/m25p80.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index fe9ceb7b5405..7ef0c5009ead 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -131,6 +131,11 @@ static int m25p80_read(struct spi_nor *nor, loff_t from, size_t len, /* convert the dummy cycles to the number of bytes */ dummy /= 8; + if (spi_mmap_read_supported(spi)) + return spi_mtd_mmap_read(spi, from, len, retlen, buf, + nor->read_opcode, + nor->addr_width, dummy); + spi_message_init(&m); memset(t, 0, (sizeof t));