From patchwork Fri May 30 17:13:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 31207 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f198.google.com (mail-pd0-f198.google.com [209.85.192.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9684E20671 for ; Fri, 30 May 2014 17:14:08 +0000 (UTC) Received: by mail-pd0-f198.google.com with SMTP id w10sf4659416pde.9 for ; Fri, 30 May 2014 10:14:07 -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=Drqy4Sx1vNmI/6vqphLgzw8izByBUgSCYX0YGKpUzEQ=; b=SfYzdd6nHkMB7vPRCjrpJ0eqpKcyRLGrvdAos5pW0KiQM8Sus+dkG9ME5foozsKBts lY3TkKS+kIaz3+tU1VmlkwDPGwdpvWgcf8Z0KgrwQWq2ctJRNRqOq4IGQJVKtiqG70nt oEGunQpa9tHDWb2hqX+aF52SRmigF4YoEk6XPttiRC9P3a7xhiDbrWimb0GrOCffHXUP aLwTFyo7j559xlX0mLIHxFEqC1nvkSh23q50X+PoSbLAnMpoOfH3bxdoENaEOuubyGip 1DvSMZ+EzDUlTva/mRBMNOASI9Fl1xMvdlsqEEkikmz2GCl+/UCb+ii4EtxnziJ7QMMZ FuBg== X-Gm-Message-State: ALoCoQkAMLLDZZW2bgsKqWxW2ZspP6ORi0+3AO42aV/uqUeuFZIZnHqv8SxJHuhnn6sOOmBwtqwY X-Received: by 10.66.236.136 with SMTP id uu8mr6609280pac.13.1401470047607; Fri, 30 May 2014 10:14:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.108.229 with SMTP id j92ls1111537qgf.14.gmail; Fri, 30 May 2014 10:14:07 -0700 (PDT) X-Received: by 10.58.243.72 with SMTP id ww8mr3438051vec.49.1401470047385; Fri, 30 May 2014 10:14:07 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id ve5si3575165vcb.76.2014.05.30.10.14.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 30 May 2014 10:14:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.169 as permitted sender) client-ip=209.85.220.169; Received: by mail-vc0-f169.google.com with SMTP id ij19so2438951vcb.14 for ; Fri, 30 May 2014 10:14:07 -0700 (PDT) X-Received: by 10.58.2.74 with SMTP id 10mr2643097ves.61.1401470047305; Fri, 30 May 2014 10:14:07 -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 ib8csp128250vcb; Fri, 30 May 2014 10:14:06 -0700 (PDT) X-Received: by 10.66.119.172 with SMTP id kv12mr20443579pab.34.1401470046213; Fri, 30 May 2014 10:14:06 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fn1si6358526pbb.74.2014.05.30.10.14.05; Fri, 30 May 2014 10:14:05 -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 S934419AbaE3RN5 (ORCPT + 28 others); Fri, 30 May 2014 13:13:57 -0400 Received: from mail-we0-f171.google.com ([74.125.82.171]:54764 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934112AbaE3RNz (ORCPT ); Fri, 30 May 2014 13:13:55 -0400 Received: by mail-we0-f171.google.com with SMTP id w62so2343168wes.16 for ; Fri, 30 May 2014 10:13:54 -0700 (PDT) X-Received: by 10.180.206.205 with SMTP id lq13mr8720093wic.11.1401470034428; Fri, 30 May 2014 10:13:54 -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 o2sm7480359wiy.19.2014.05.30.10.13.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 30 May 2014 10:13:53 -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 07/13] mmc: mmci: add 8bit bus support in variant data Date: Fri, 30 May 2014 18:13:49 +0100 Message-Id: <1401470029-27113-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.220.169 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 8bit bus enable 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index ad7e538..fa3ad83 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -52,6 +52,7 @@ static unsigned int fmax = 515633; * struct variant_data - MMCI variant-specific quirks * @clkreg: default value for MCICLOCK register * @clkreg_enable: enable value for MMCICLOCK register + * @clkreg_8bit_bus_enable: enable value for 8 bit bus * @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) @@ -72,6 +73,7 @@ static unsigned int fmax = 515633; struct variant_data { unsigned int clkreg; unsigned int clkreg_enable; + unsigned int clkreg_8bit_bus_enable; unsigned int datalength_bits; unsigned int fifosize; unsigned int fifohalfsize; @@ -113,6 +115,7 @@ static struct variant_data variant_u300 = { .fifosize = 16 * 4, .fifohalfsize = 8 * 4, .clkreg_enable = MCI_ST_U300_HWFCEN, + .clkreg_8bit_bus_enable = MCI_ST_8BIT_BUS, .datalength_bits = 16, .sdio = true, .pwrreg_powerup = MCI_PWR_ON, @@ -139,6 +142,7 @@ static struct variant_data variant_ux500 = { .fifohalfsize = 8 * 4, .clkreg = MCI_CLK_ENABLE, .clkreg_enable = MCI_ST_UX500_HWFCEN, + .clkreg_8bit_bus_enable = MCI_ST_8BIT_BUS, .datalength_bits = 24, .sdio = true, .st_clkdiv = true, @@ -154,6 +158,7 @@ static struct variant_data variant_ux500v2 = { .fifohalfsize = 8 * 4, .clkreg = MCI_CLK_ENABLE, .clkreg_enable = MCI_ST_UX500_HWFCEN, + .clkreg_8bit_bus_enable = MCI_ST_8BIT_BUS, .datactrl_mask_ddrmode = MCI_ST_DPSM_DDRMODE, .datalength_bits = 24, .sdio = true, @@ -305,7 +310,7 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_4) clk |= MCI_4BIT_BUS; if (host->mmc->ios.bus_width == MMC_BUS_WIDTH_8) - clk |= MCI_ST_8BIT_BUS; + clk |= variant->clkreg_8bit_bus_enable; if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50) clk |= MCI_ST_UX500_NEG_EDGE;