From patchwork Thu May 15 09:37:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 30235 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 00B9120446 for ; Thu, 15 May 2014 09:37:44 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id lc6sf10575332vcb.11 for ; Thu, 15 May 2014 02:37:44 -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=BYndUoWZSiUBaXal226XXFkO6Ew+E/46p22/xN2F814=; b=Bpafy6hDjWNelzvhN0E9ET7x/uMP+/I7Qs4dGz8GPGHqP2F+QxV3kE15KDnPc9qs0Z lI7lwfTfOcRzmZL0/c7VLbwoHo6hslxLWdiRxKGt8XvwsAaTjZV6iMbKmuDYd1qpaa1x d/cvlpqqniTmVTOiSctoqQjNk67DMOUybgJ5QYkQH1fqcrOp2oiur1m1ibv8ezKrE1F+ /hiqU0rTEfeerE9q3SHv1o/H7UUjWWnuoIw6IoVRsELqQyTUzYyNuxprKKy9lbqvyw/R /0w/Wl0RDnw7WOGmIw+KDjN0hCBFeHlvdVv4YyFRTqYvjLHhHVK6LzkIMLf10wZHSG/u iJdA== X-Gm-Message-State: ALoCoQlPL++2OCX+rOnffRtNLafSu+lq+s5DdHnrbBbcpm6FxR2GhfhX6uAQU5vdqHPh+b3PRY09 X-Received: by 10.224.104.2 with SMTP id m2mr3726483qao.7.1400146664816; Thu, 15 May 2014 02:37:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.24.181 with SMTP id 50ls157693qgr.92.gmail; Thu, 15 May 2014 02:37:44 -0700 (PDT) X-Received: by 10.58.216.34 with SMTP id on2mr7648801vec.22.1400146664715; Thu, 15 May 2014 02:37:44 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id qr10si831394vcb.189.2014.05.15.02.37.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 May 2014 02:37:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id hu19so4011843vcb.34 for ; Thu, 15 May 2014 02:37:44 -0700 (PDT) X-Received: by 10.221.34.7 with SMTP id sq7mr7752209vcb.5.1400146664605; Thu, 15 May 2014 02:37:44 -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 ib8csp307867vcb; Thu, 15 May 2014 02:37:43 -0700 (PDT) X-Received: by 10.68.189.137 with SMTP id gi9mr11161074pbc.79.1400146663455; Thu, 15 May 2014 02:37:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yk1si2403693pbb.56.2014.05.15.02.37.42; Thu, 15 May 2014 02:37:42 -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 S1754699AbaEOJhd (ORCPT + 27 others); Thu, 15 May 2014 05:37:33 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:54642 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754426AbaEOJh2 (ORCPT ); Thu, 15 May 2014 05:37:28 -0400 Received: by mail-wi0-f176.google.com with SMTP id n15so9450744wiw.15 for ; Thu, 15 May 2014 02:37:26 -0700 (PDT) X-Received: by 10.194.88.106 with SMTP id bf10mr7714509wjb.26.1400146646776; Thu, 15 May 2014 02:37:26 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-78-145-240-98.as13285.net. [78.145.240.98]) by mx.google.com with ESMTPSA id em5sm8839141wic.23.2014.05.15.02.37.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 May 2014 02:37:26 -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 v2 09/14] mmc: mmci: add edge support to data and command out in variant data. Date: Thu, 15 May 2014 10:37:23 +0100 Message-Id: <1400146643-30179-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400146447-29803-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1400146447-29803-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.175 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 a81f303..17e7f6a 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) @@ -76,6 +77,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; @@ -148,6 +150,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, .datactrl_mask_ddrmode = MCI_ST_DPSM_DDRMODE, .datalength_bits = 24, .sdio = true, @@ -165,6 +168,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, @@ -348,7 +352,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); }