From patchwork Mon Jun 2 09:09:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 31268 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ED07D203C2 for ; Mon, 2 Jun 2014 09:10:00 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id i7sf25915342oag.4 for ; Mon, 02 Jun 2014 02:10:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=oCts5LAzLHciE+LjXETfH4VjOUelLziwPll/rrStabQ=; b=QF2w8+Cof6Tii8oyXrtKhvth/h2vsG4I0vNXT9EzN1gws+MwJ8FWnchTL30B8moz/F VoIVbhM4P1lJNX8DTNhdTRAAh87yQ+XX5aabFcBJpTFGRBvNMenzq0H7gqkHiXp7E8yE uHwQTh7nICWL5MjsAaa+XjRCfyc0zhmY/jpTMl2sdLv0f9DMFcIlBVRDIiEayORZramZ O5ctRM4beR7VzILFBgB9pCccqeDV4/oGLbiIiq5CS557GEKleGf0FjQvhzmbXWgQx6Jp Rw/bNKdOkxXuCyiPinwh6zD9UubH4BCLn328Bvf/yYH/x8c4bSN6qvfRnDP39vyvFApP SPng== X-Gm-Message-State: ALoCoQluCSBu+SAgm0j1kE2YnITdXQ9M8oj8AxuU/nnSyq5zaHl/KTtujkHhgs4tbTkb0VRyNgM1 X-Received: by 10.51.17.10 with SMTP id ga10mr5937103igd.4.1401700200420; Mon, 02 Jun 2014 02:10:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.145 with SMTP id 17ls1940788qgn.21.gmail; Mon, 02 Jun 2014 02:10:00 -0700 (PDT) X-Received: by 10.52.5.129 with SMTP id s1mr15739793vds.31.1401700200299; Mon, 02 Jun 2014 02:10:00 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id b1si7579237vei.91.2014.06.02.02.10.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Jun 2014 02:10:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id ij19so301860vcb.24 for ; Mon, 02 Jun 2014 02:10:00 -0700 (PDT) X-Received: by 10.58.123.71 with SMTP id ly7mr28529826veb.11.1401700200205; Mon, 02 Jun 2014 02:10:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp82677vcb; Mon, 2 Jun 2014 02:09:59 -0700 (PDT) X-Received: by 10.66.231.40 with SMTP id td8mr39288926pac.103.1401700199167; Mon, 02 Jun 2014 02:09:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ip15si15258553pac.160.2014.06.02.02.09.58; Mon, 02 Jun 2014 02:09:58 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753559AbaFBJJk (ORCPT + 28 others); Mon, 2 Jun 2014 05:09:40 -0400 Received: from mail-wg0-f41.google.com ([74.125.82.41]:65110 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753351AbaFBJJf (ORCPT ); Mon, 2 Jun 2014 05:09:35 -0400 Received: by mail-wg0-f41.google.com with SMTP id z12so4693940wgg.0 for ; Mon, 02 Jun 2014 02:09:34 -0700 (PDT) X-Received: by 10.180.185.244 with SMTP id ff20mr20528756wic.42.1401700174416; Mon, 02 Jun 2014 02:09:34 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-78-149-12-106.as13285.net. [78.149.12.106]) by mx.google.com with ESMTPSA id gd5sm33813672wjb.40.2014.06.02.02.09.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 Jun 2014 02:09:33 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Russell King , Ulf Hansson , linux-mmc@vger.kernel.org Cc: Chris Ball , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linus.walleij@linaro.org, Srinivas Kandagatla Subject: [PATCH v6 07/12] mmc: mmci: add edge support to data and command out in variant data. Date: Mon, 2 Jun 2014 10:09:30 +0100 Message-Id: <1401700170-11711-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1401699818-11329-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1401699818-11329-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Srinivas Kandagatla This patch adds edge support for data and command out to variant structure giving more flexibility to the driver to support more SOCs which have different clock register layout. Without this patch other new SOCs like Qcom will have to add more code to special case them Signed-off-by: Srinivas Kandagatla Reviewed-by: Linus Walleij --- drivers/mmc/host/mmci.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index fa3ad83..4c95a9b 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -53,6 +53,7 @@ static unsigned int fmax = 515633; * @clkreg: default value for MCICLOCK register * @clkreg_enable: enable value for MMCICLOCK register * @clkreg_8bit_bus_enable: enable value for 8 bit bus + * @clkreg_neg_edge_enable: enable value for inverted data/cmd output * @datalength_bits: number of bits in the MMCIDATALENGTH register * @fifosize: number of bytes that can be written when MMCI_TXFIFOEMPTY * is asserted (likewise for RX) @@ -74,6 +75,7 @@ struct variant_data { unsigned int clkreg; unsigned int clkreg_enable; unsigned int clkreg_8bit_bus_enable; + unsigned int clkreg_neg_edge_enable; unsigned int datalength_bits; unsigned int fifosize; unsigned int fifohalfsize; @@ -143,6 +145,7 @@ static struct variant_data variant_ux500 = { .clkreg = MCI_CLK_ENABLE, .clkreg_enable = MCI_ST_UX500_HWFCEN, .clkreg_8bit_bus_enable = MCI_ST_8BIT_BUS, + .clkreg_neg_edge_enable = MCI_ST_UX500_NEG_EDGE, .datalength_bits = 24, .sdio = true, .st_clkdiv = true, @@ -159,6 +162,7 @@ static struct variant_data variant_ux500v2 = { .clkreg = MCI_CLK_ENABLE, .clkreg_enable = MCI_ST_UX500_HWFCEN, .clkreg_8bit_bus_enable = MCI_ST_8BIT_BUS, + .clkreg_neg_edge_enable = MCI_ST_UX500_NEG_EDGE, .datactrl_mask_ddrmode = MCI_ST_DPSM_DDRMODE, .datalength_bits = 24, .sdio = true, @@ -313,7 +317,7 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) clk |= variant->clkreg_8bit_bus_enable; if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50) - clk |= MCI_ST_UX500_NEG_EDGE; + clk |= variant->clkreg_neg_edge_enable; mmci_write_clkreg(host, clk); }