From patchwork Tue Nov 26 07:35:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Poddar, Sourav" X-Patchwork-Id: 3237191 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 306B2C045B for ; Tue, 26 Nov 2013 07:36:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C34C20279 for ; Tue, 26 Nov 2013 07:36:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F4AB201CD for ; Tue, 26 Nov 2013 07:36:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754746Ab3KZHgb (ORCPT ); Tue, 26 Nov 2013 02:36:31 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:46189 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754700Ab3KZHga (ORCPT ); Tue, 26 Nov 2013 02:36:30 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id rAQ7a9px001070; Tue, 26 Nov 2013 01:36:09 -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 rAQ7a9iO016879; Tue, 26 Nov 2013 01:36:09 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Tue, 26 Nov 2013 01:36:09 -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 rAQ7ZLY1030173; Tue, 26 Nov 2013 01:36:06 -0600 From: Sourav Poddar To: , , , CC: , , , , Sourav Poddar Subject: [PATCH 12/17] spi/qspi: convert driver to enable/disable memory mapped. Date: Tue, 26 Nov 2013 13:05:08 +0530 Message-ID: <1385451313-1875-13-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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 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 Idea is to enable memory mapped by default at the end of the probe, if the control reaches the "transfer" api, then the operation is not a memory mapped one. Hence, we switch to Normal mode and at the end of the "transfer" function. switch back to memory mapped mode. Signed-off-by: Sourav Poddar --- drivers/spi/spi-ti-qspi.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c index d21d40d..ba95d64 100644 --- a/drivers/spi/spi-ti-qspi.c +++ b/drivers/spi/spi-ti-qspi.c @@ -415,6 +415,8 @@ static int ti_qspi_start_transfer_one(struct spi_master *master, int status = 0, ret; int frame_length; + disable_qspi_memory_mapped(qspi); + /* setup device control reg */ qspi->dc = 0; @@ -460,6 +462,8 @@ static int ti_qspi_start_transfer_one(struct spi_master *master, ti_qspi_write(qspi, qspi->cmd | QSPI_INVAL, QSPI_SPI_CMD_REG); + enable_qspi_memory_mapped(qspi); + return status; } @@ -613,6 +617,8 @@ static int ti_qspi_probe(struct platform_device *pdev) if (ret) goto free_master; + enable_qspi_memory_mapped(qspi); + return 0; free_master: