From patchwork Fri May 23 12:52:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 4232471 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 68711BF90B for ; Fri, 23 May 2014 12:54:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 96E6C202C8 for ; Fri, 23 May 2014 12:54:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C20C920108 for ; Fri, 23 May 2014 12:54:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753076AbaEWMw5 (ORCPT ); Fri, 23 May 2014 08:52:57 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:57000 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753015AbaEWMwx (ORCPT ); Fri, 23 May 2014 08:52:53 -0400 Received: by mail-wg0-f47.google.com with SMTP id x12so4675566wgg.18 for ; Fri, 23 May 2014 05:52:52 -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=1WoVmDVt6ofg8qb0G8tSjUAaeWsohtrmO5v6Fc+6dmY=; b=APwoqf95sXPzYh+lJztKRmwnIkgCvwo4wqeUmXHLd/6nhzLWle/BODQevnUUo5ahJU gQuq2M1ZVxBq5EQwwWB9LnnRjAT8C4QnS2Xxn1Y6zqV3IFe8yI9iWLZMBsHfHY/kP4jx 34ggZk95KTijh3ZBnlV0Gi0c7Yt73C1JCuYG25bsOZHRLWI0DjeZbU23KzAJTmhsn4aD VHkD2FzkikdrrjdSJaFW4eIOFerwgttVFumO4ImUJZ6rk6AabZYpP3+1Gqs+KNYP7VtH 0Pk8JYpmaW/Ug/ff7dlF9unzXljwu9g239FR7iKBZzRlGSncTBW6SueGp1Ujmk40ce6Z Ft1g== X-Gm-Message-State: ALoCoQnQfdaM6NulkOo7pOV4t0J8AxGDpiiWqkrk/IIEteHOlDZlj1dG0pOh9KLfEAccq3WeOm33 X-Received: by 10.194.119.34 with SMTP id kr2mr4216312wjb.34.1400849572111; Fri, 23 May 2014 05:52:52 -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 l9sm2797833wic.21.2014.05.23.05.52.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 May 2014 05:52:51 -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 v3 11/13] mmc: mmci: Add support to data commands via variant structure. Date: Fri, 23 May 2014 13:52:48 +0100 Message-Id: <1400849568-7543-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400849362-7007-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1400849362-7007-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 6434f5b1..5cbf644 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; @@ -189,6 +191,7 @@ static struct variant_data variant_qcom = { MCI_QCOM_CLK_FEEDBACK_CLK, .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, @@ -875,6 +878,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);