From patchwork Thu May 15 09:37:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 4180451 Return-Path: X-Original-To: patchwork-linux-mmc@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 F17B0BFF02 for ; Thu, 15 May 2014 09:39:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D1B220306 for ; Thu, 15 May 2014 09:39:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACA2520383 for ; Thu, 15 May 2014 09:39:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754794AbaEOJhu (ORCPT ); Thu, 15 May 2014 05:37:50 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:46251 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754426AbaEOJhq (ORCPT ); Thu, 15 May 2014 05:37:46 -0400 Received: by mail-wi0-f178.google.com with SMTP id hm4so3838057wib.11 for ; Thu, 15 May 2014 02:37:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O5oy/yPmxlDEqu+8hSLRm+Y0bFY1e2byzDAsLyfO0O4=; b=Gz6qHYixiK9S/UJQk64Dio9aCTRSns5sWWIKVj5bloQNTK9SF9/F53m2a6PDGCnk8T lZ7na3iqsa2yz1hyVeGlQawCVdyia0BsJUg4fivSs4/BmRzKZP/fiyy7lhCneF05+fjD Qv3QMJ6oS2c4BSssZePNundTwtyhWAjz/JqnzKQJopNnc8HD8Aqj6Z0dOdtgJ7EIaiPW rUlZjN0YnL36zZ966cLGUZdsf4Pj4zCEEW7AM9V7RDTDvPFQ0Q39TZ7NLnssPKqDm/vR X9xDdVHc6y7LIJ1fNbVRD0OkuaOhb77VN/m2wTGGi6waVEh3Eza/Ry1YClnpeqYYWkhv ajyg== X-Gm-Message-State: ALoCoQm5MGWsV9JOswOUotYq9e7w6K2cQbPE2hN6kc1QXlUVefwcHX9ZrROczRxt6TzeULBW9Vxj X-Received: by 10.180.77.165 with SMTP id t5mr7891762wiw.38.1400146665214; Thu, 15 May 2014 02:37:45 -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 qq5sm8864035wic.10.2014.05.15.02.37.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 May 2014 02:37:42 -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 11/14] mmc: mmci: Add support to data commands via variant structure. Date: Thu, 15 May 2014 10:37:40 +0100 Message-Id: <1400146660-30261-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-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.5 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 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 0a0fc22..05ae654 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. @@ -81,6 +82,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; @@ -188,6 +190,7 @@ static struct variant_data variant_qcom = { .clkreg_enable = MCI_QCOM_CLK_FLOWENA, .clkreg_8bit_bus_enable = MCI_QCOM_CLK_WIDEBUS_8, .datactrl_mask_ddrmode = MCI_QCOM_CLK_DDR_MODE, + .data_cmd_enable = MCI_QCOM_CSPM_DATCMD, .blksz_datactrl4 = true, .datalength_bits = 24, .blksz_datactrl4 = true, @@ -874,6 +877,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; mmci_writel(host, cmd->arg, MMCIARGUMENT);