From patchwork Fri May 30 17:14:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 31208 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 89A7320671 for ; Fri, 30 May 2014 17:14:22 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf9773713obc.5 for ; Fri, 30 May 2014 10:14:22 -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=YnnQn0IN43SwCULPmh30GzOENZqqKzM5SR783leEbedf8zLYhTGOG+LjP3j9TPNRHs Csw3nWrpVMi3ukAi0QwD8CiNDK5keXpV35Z4ZPqBrYva8Fw+88bd8rAZkFzIfD7VBD0X 9otBSaxsAmK6BfBKl3zyJP5OGUxFpT42a/XAEIWHFBC3zT3CZEjwfSaYYOwHbtVnhaca UQ7sojN3PJh7UdysFxQC4cW92HKKEVk/KuA8+7hWHv/snjtm2nPnpier8w1K1WOMbZTg FRnuNVRdV5IVciFVV0dv9KD+Z/uv8akZRf8sUlsqKqryXi3O9Q1y0N2noBQlq1+gTzUW ownw== X-Gm-Message-State: ALoCoQkSOQeZeCT7P4T34q4lXZXkANxOzzgKudfU1XRmZGnaYxflV5nMG0R8jwsUoffQ/uP0XHkD X-Received: by 10.182.109.231 with SMTP id hv7mr6813266obb.2.1401470062105; Fri, 30 May 2014 10:14:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.24.181 with SMTP id 50ls1124676qgr.92.gmail; Fri, 30 May 2014 10:14:21 -0700 (PDT) X-Received: by 10.220.18.134 with SMTP id w6mr15209215vca.5.1401470061925; Fri, 30 May 2014 10:14:21 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id fa6si3588735veb.20.2014.05.30.10.14.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 May 2014 10:14:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.172 as permitted sender) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id oz11so2464169veb.17 for ; Fri, 30 May 2014 10:14:21 -0700 (PDT) X-Received: by 10.58.216.163 with SMTP id or3mr2077303vec.80.1401470061855; Fri, 30 May 2014 10:14:21 -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 ib8csp128263vcb; Fri, 30 May 2014 10:14:21 -0700 (PDT) X-Received: by 10.68.234.2 with SMTP id ua2mr19808568pbc.81.1401470060943; Fri, 30 May 2014 10:14:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wj5si6385750pbc.22.2014.05.30.10.14.19; Fri, 30 May 2014 10:14:19 -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 S1030203AbaE3ROL (ORCPT + 28 others); Fri, 30 May 2014 13:14:11 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:33486 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934422AbaE3ROH (ORCPT ); Fri, 30 May 2014 13:14:07 -0400 Received: by mail-wi0-f171.google.com with SMTP id cc10so1485100wib.16 for ; Fri, 30 May 2014 10:14:06 -0700 (PDT) X-Received: by 10.180.19.201 with SMTP id h9mr8701254wie.17.1401470046415; Fri, 30 May 2014 10:14:06 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-78-149-4-211.as13285.net. [78.149.4.211]) by mx.google.com with ESMTPSA id ln3sm11573022wjc.8.2014.05.30.10.14.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 May 2014 10:14:05 -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 v5 08/13] mmc: mmci: add edge support to data and command out in variant data. Date: Fri, 30 May 2014 18:14:01 +0100 Message-Id: <1401470041-27154-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1401469918-26817-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1401469918-26817-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.128.172 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); }