From patchwork Wed May 28 13:47:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 31069 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1E63A201F1 for ; Wed, 28 May 2014 13:47:50 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 9sf26620965ykp.9 for ; Wed, 28 May 2014 06:47:49 -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=XxKagXz1kaV54JhJvQ3EJAiL1tIpOpwygpXn2U4piC8=; b=a2Ij6bF9mky5+Xdwh7b298wjfoo9PnqbhiPxsAyd5lLanOdZUz1jeHSwkH6k1D4X5H SdymLnVwJuvv6E7KLQvxVjIV/nSMn3BKY3g2BrJqkzWxATtIBwNRemSaAMZNGiETjKuZ mKdIAPnIDoE0QjFjCIrL6eb2sq/P8uU8ESRtfTIUjT3N/7QLBa4yU/nch7h/uaiNyG8y dm62PmZzjeMFSHZLyyDKbJ26/S4KpGoS5vQIU0k9GPB0tS7jhREDVL06sz1qz7n3wMfv dPmY7Kb/ZIkaqFEPun5WJRAQytmxiEAAg1lrHl5LEFjYkF3fNxoy5KEMYwc/k+L1jRL6 IRjg== X-Gm-Message-State: ALoCoQnLTJcCQ/bqZhcsXdRh/nFC9lqwyvqOZOBlnhySjmoBerzVoJzZgttpqR0gt94E4IShQ4Lq X-Received: by 10.224.61.203 with SMTP id u11mr9068258qah.6.1401284869865; Wed, 28 May 2014 06:47:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.36.148 with SMTP id p20ls117720qgp.80.gmail; Wed, 28 May 2014 06:47:49 -0700 (PDT) X-Received: by 10.52.227.138 with SMTP id sa10mr28914737vdc.25.1401284869738; Wed, 28 May 2014 06:47:49 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id vn1si10580055veb.34.2014.05.28.06.47.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 May 2014 06:47:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id hy4so9026729vcb.12 for ; Wed, 28 May 2014 06:47:49 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr34456791vcb.0.1401284869666; Wed, 28 May 2014 06:47:49 -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 ib8csp204403vcb; Wed, 28 May 2014 06:47:49 -0700 (PDT) X-Received: by 10.68.134.198 with SMTP id pm6mr46672131pbb.9.1401284868584; Wed, 28 May 2014 06:47:48 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ba10si7137147pbd.48.2014.05.28.06.47.48 for ; Wed, 28 May 2014 06:47:48 -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 S1754295AbaE1Nrm (ORCPT + 27 others); Wed, 28 May 2014 09:47:42 -0400 Received: from mail-wg0-f52.google.com ([74.125.82.52]:51938 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754250AbaE1Nrj (ORCPT ); Wed, 28 May 2014 09:47:39 -0400 Received: by mail-wg0-f52.google.com with SMTP id l18so11323370wgh.35 for ; Wed, 28 May 2014 06:47:38 -0700 (PDT) X-Received: by 10.194.174.168 with SMTP id bt8mr50933496wjc.72.1401284857779; Wed, 28 May 2014 06:47:37 -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 fh5sm12049138wic.9.2014.05.28.06.47.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 May 2014 06:47:36 -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 v4 10/13] mmc: mmci: Add support to data commands via variant structure. Date: Wed, 28 May 2014 14:47:33 +0100 Message-Id: <1401284853-16853-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1401284608-16428-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1401284608-16428-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.181 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 On some SOCs like Qcom there are explicit bits in the command register to specify if its a data transfer command or not. So this patch adds support to such bits in variant data, giving more flexibility to the driver. Signed-off-by: Srinivas Kandagatla Reviewed-by: Linus Walleij --- drivers/mmc/host/mmci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index dbcb952..fd40f9a 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -59,6 +59,7 @@ static unsigned int fmax = 515633; * is asserted (likewise for RX) * @fifohalfsize: number of bytes that can be written when MCI_TXFIFOHALFEMPTY * is asserted (likewise for RX) + * @data_cmd_enable: enable value for data commands. * @sdio: variant supports SDIO * @st_clkdiv: true if using a ST-specific clock divider algorithm * @datactrl_mask_ddrmode: ddr mode mask in datactrl register. @@ -79,6 +80,7 @@ struct variant_data { unsigned int datalength_bits; unsigned int fifosize; unsigned int fifohalfsize; + unsigned int data_cmd_enable; unsigned int datactrl_mask_ddrmode; bool sdio; bool st_clkdiv; @@ -183,6 +185,7 @@ static struct variant_data variant_qcom = { MCI_QCOM_CLK_SELECT_IN_FBCLK, .clkreg_8bit_bus_enable = MCI_QCOM_CLK_WIDEBUS_8, .datactrl_mask_ddrmode = MCI_QCOM_CLK_SELECT_IN_DDR_MODE, + .data_cmd_enable = MCI_QCOM_CSPM_DATCMD, .blksz_datactrl4 = true, .datalength_bits = 24, .pwrreg_powerup = MCI_PWR_UP, @@ -852,6 +855,9 @@ mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c) if (/*interrupt*/0) c |= MCI_CPSM_INTERRUPT; + if (mmc_cmd_type(cmd) == MMC_CMD_ADTC) + c |= host->variant->data_cmd_enable; + host->cmd = cmd; writel(cmd->arg, base + MMCIARGUMENT);