From patchwork Wed Sep 1 09:47:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Zhu X-Patchwork-Id: 177712 Return-path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on void.printf.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.9 tests=RCVD_IN_DNSWL_LOW autolearn=disabled version=3.2.5 Envelope-to: chris@printf.net Delivery-date: Wed, 01 Sep 2010 11:01:13 +0100 Received: from lists.laptop.org ([18.85.2.145] helo=mail.laptop.org) by void.printf.net with esmtp (Exim 4.69) (envelope-from ) id 1Oqk80-00073L-R7 for chris@printf.net; Wed, 01 Sep 2010 11:01:13 +0100 Received: by mail.laptop.org (Postfix) id 095CD24574; Wed, 1 Sep 2010 06:00:48 -0400 (EDT) Delivered-To: cjb@laptop.org Received: from spam.laptop.org (spam.laptop.org [18.85.46.23]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.laptop.org (Postfix) with ESMTPS id 639CD24592 for ; Wed, 1 Sep 2010 06:00:27 -0400 (EDT) X-ASG-Debug-ID: 1283335243-0b74ca3c0001-zHW3sV Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by spam.laptop.org with ESMTP id 0g3sj9IxOjkSHBiw for ; Wed, 01 Sep 2010 06:00:43 -0400 (EDT) X-Barracuda-Envelope-From: linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754049Ab0IAKAm (ORCPT ); Wed, 1 Sep 2010 06:00:42 -0400 Received: from db3ehsobe001.messaging.microsoft.com ([213.199.154.139]:34129 "EHLO DB3EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870Ab0IAKAm (ORCPT ); Wed, 1 Sep 2010 06:00:42 -0400 Received: from mail75-db3-R.bigfish.com (10.3.81.251) by DB3EHSOBE001.bigfish.com (10.3.84.21) with Microsoft SMTP Server id 8.1.436.0; Wed, 1 Sep 2010 09:45:36 +0000 Received: from mail75-db3 (localhost.localdomain [127.0.0.1]) by mail75-db3-R.bigfish.com (Postfix) with ESMTP id 08297A88998 for ; Wed, 1 Sep 2010 09:45:36 +0000 (UTC) X-SpamScore: -2 X-BigFish: VS-2(zzbb2cKzz1202hzz8275bh1497iz2dh2a8h87h63h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail75-db3 (localhost.localdomain [127.0.0.1]) by mail75-db3 (MessageSwitch) id 1283334334204966_31598; Wed, 1 Sep 2010 09:45:34 +0000 (UTC) Received: from DB3EHSMHS008.bigfish.com (unknown [10.3.81.253]) by mail75-db3.bigfish.com (Postfix) with ESMTP id A7F51F400E7 for ; Wed, 1 Sep 2010 09:45:25 +0000 (UTC) Received: from az33egw02.freescale.net (192.88.158.103) by DB3EHSMHS008.bigfish.com (10.3.87.108) with Microsoft SMTP Server (TLS) id 14.0.482.44; Wed, 1 Sep 2010 09:45:24 +0000 Received: from de01smr02.am.mot.com (de01smr02.freescale.net [10.208.0.151]) by az33egw02.freescale.net (8.14.3/8.14.3) with ESMTP id o819jMev002388 for ; Wed, 1 Sep 2010 02:45:22 -0700 (MST) Received: from shlinux1.ap.freescale.net ([10.192.225.216]) by de01smr02.am.mot.com (8.13.1/8.13.0) with ESMTP id o81A02i2004046 for ; Wed, 1 Sep 2010 05:00:03 -0500 (CDT) Received: by shlinux1.ap.freescale.net (Postfix, from userid 1003) id CB3074D6001; Wed, 1 Sep 2010 17:47:59 +0800 (CST) From: Richard Zhu To: linux-mmc@vger.kernel.org CC: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, Richard Zhu X-ASG-Orig-Subj: [PATCH 4/9] sdhci-4:add make_blksz api to support FSl eSDHC Subject: [PATCH 4/9] sdhci-4:add make_blksz api to support FSl eSDHC Date: Wed, 1 Sep 2010 17:47:59 +0800 Message-ID: <1283334479-12643-1-git-send-email-r65037@freescale.com> X-Mailer: git-send-email 1.6.3.3 MIME-Version: 1.0 X-Reverse-DNS: az33egw02.freescale.net Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Barracuda-Connect: vger.kernel.org[209.132.180.67] X-Barracuda-Start-Time: 1283335243 X-Barracuda-URL: http://18.85.46.23:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at laptop.org X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.5 tests=MAILTO_TO_SPAM_ADDR X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.39600 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MAILTO_TO_SPAM_ADDR URI: Includes a link to a likely spammer email diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 2bfe738..e58939a 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -650,6 +650,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data) { u8 count; u8 ctrl; + u16 blk_sz; int ret; WARN_ON(host->data); @@ -809,7 +810,13 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data) sdhci_set_transfer_irqs(host); /* We do not handle DMA boundaries, so set it to max (512 KiB) */ - sdhci_writew(host, SDHCI_MAKE_BLKSZ(7, data->blksz), SDHCI_BLOCK_SIZE); + if (host->ops->make_blksz) + blk_sz = host->ops->make_blksz(data->blksz); + else + blk_sz = SDHCI_MAKE_BLKSZ(7, data->blksz); + + sdhci_writew(host, blk_sz, SDHCI_BLOCK_SIZE); + sdhci_writew(host, data->blocks, SDHCI_BLOCK_COUNT); } diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 029ab0e..37e9e3e 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -326,6 +326,7 @@ struct sdhci_ops { unsigned int (*get_min_clock)(struct sdhci_host *host); unsigned int (*get_timeout_clock)(struct sdhci_host *host); unsigned int (*get_ro)(struct sdhci_host *host); + u16 (*make_blksz)(u16 blk_sz); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS