From patchwork Tue Apr 29 08:19:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 29305 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 21278202FE for ; Tue, 29 Apr 2014 08:19:48 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id vb8sf46586541obc.3 for ; Tue, 29 Apr 2014 01:19:47 -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=fMCxLHobGT7zrHWK9BH5EffEXVfanDvQFz0JVgQRrSs=; b=M8kNI1KSAcxwQQig0E9y9eDOTUNR2iX2CKZXj3dInTuykHfQKudMAMjHTJLI9h/QMn k06qRUM+LcOSaMUbdNIU1EFZudd4qi5T215N7y3Fy+azbWHgnwpX7vtxa8hXpuunaNvm lJWfWiPyhxW/bckf2wlGmg1bsLJ3pGlI9Cg/ltajVNhamA3uoNHk796xo3jAbRgGudJc cUUabZvzQNi8PV42mczNRKE+9EL4DU8ziStPL+uC4OEjs5/vK3U/PQtZqHSeRBUuFT6l RKlhK7tAnoSiednqTEikrXu9KAzEr9oFCqDaooMediktDFNtSEUROfQH4JFb3W+jB23m Lxjw== X-Gm-Message-State: ALoCoQkMtCALnfe8/8Kf8DmoJ8hM9pyIJkDIiSCPvfvL/lLvo55N6avgk0pMwJWZ54Gr1/U2/7ir X-Received: by 10.182.158.135 with SMTP id wu7mr15314202obb.19.1398759587704; Tue, 29 Apr 2014 01:19:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.72 with SMTP id s66ls3033984qgs.85.gmail; Tue, 29 Apr 2014 01:19:47 -0700 (PDT) X-Received: by 10.58.219.233 with SMTP id pr9mr29266647vec.10.1398759587591; Tue, 29 Apr 2014 01:19:47 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id q1si4336549ves.171.2014.04.29.01.19.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Apr 2014 01:19:47 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id sa20so9255482veb.8 for ; Tue, 29 Apr 2014 01:19:47 -0700 (PDT) X-Received: by 10.58.31.136 with SMTP id a8mr29306900vei.20.1398759587519; Tue, 29 Apr 2014 01:19:47 -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 ib8csp178115vcb; Tue, 29 Apr 2014 01:19:47 -0700 (PDT) X-Received: by 10.68.197.66 with SMTP id is2mr34761443pbc.96.1398759586786; Tue, 29 Apr 2014 01:19:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ud10si12175725pbc.73.2014.04.29.01.19.46; Tue, 29 Apr 2014 01:19:46 -0700 (PDT) Received-SPF: none (google.com: linux-mmc-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 S1756402AbaD2ITm (ORCPT + 7 others); Tue, 29 Apr 2014 04:19:42 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:58523 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755863AbaD2ITk (ORCPT ); Tue, 29 Apr 2014 04:19:40 -0400 Received: by mail-we0-f178.google.com with SMTP id q59so1909798wes.37 for ; Tue, 29 Apr 2014 01:19:39 -0700 (PDT) X-Received: by 10.180.91.197 with SMTP id cg5mr19052423wib.35.1398759578974; Tue, 29 Apr 2014 01:19:38 -0700 (PDT) Received: from srinivas-Inspiron-N5050.dlink.com (host-78-147-6-229.as13285.net. [78.147.6.229]) by mx.google.com with ESMTPSA id vp5sm29946813wjc.31.2014.04.29.01.19.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 29 Apr 2014 01:19:38 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Russell King , linux-mmc@vger.kernel.org Cc: Chris Ball , Ulf Hansson , linux-kernel@vger.kernel.org, agross@quicinc.com, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v1 03/11] mmc: mmci: Add Qcom datactrl register variant Date: Tue, 29 Apr 2014 09:19:31 +0100 Message-Id: <1398759571-13095-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398759492-12970-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1398759492-12970-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-mmc@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=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 Instance of this IP on Qualcomm's SOCs has bit different layout for datactrl register. Bit postion datactrl[16:4] hold the true block size instead of power of 2. 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 391e8d4..19d6b6f 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -58,6 +58,8 @@ static unsigned int fmax = 515633; * @sdio: variant supports SDIO * @st_clkdiv: true if using a ST-specific clock divider algorithm * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register + * @blksz_datactrl4: true if Block size is at b4..b16 position in datactrl + * register * @pwrreg_powerup: power up value for MMCIPOWER register * @signal_direction: input/out direction of bus signals can be indicated * @pwrreg_clkgate: MMCIPOWER register must be used to gate the clock @@ -73,6 +75,7 @@ struct variant_data { bool sdio; bool st_clkdiv; bool blksz_datactrl16; + bool blksz_datactrl4; u32 pwrreg_powerup; bool signal_direction; bool pwrreg_clkgate; @@ -162,6 +165,7 @@ static struct variant_data variant_qcom = { .fifosize = 16 * 4, .fifohalfsize = 8 * 4, .clkreg = MCI_CLK_ENABLE, + .blksz_datactrl4 = true, .datalength_bits = 24, .blksz_datactrl4 = true, .pwrreg_powerup = MCI_PWR_UP, @@ -760,6 +764,8 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) if (variant->blksz_datactrl16) datactrl = MCI_DPSM_ENABLE | (data->blksz << 16); + else if (variant->blksz_datactrl4) + datactrl = MCI_DPSM_ENABLE | (data->blksz << 4); else datactrl = MCI_DPSM_ENABLE | blksz_bits << 4;