From patchwork Thu Jul 15 12:50:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Pietrek, Markus" X-Patchwork-Id: 112230 X-Patchwork-Delegate: lethal@linux-sh.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6FCp5wq005621 for ; Thu, 15 Jul 2010 12:51:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933172Ab0GOMvF (ORCPT ); Thu, 15 Jul 2010 08:51:05 -0400 Received: from mail3.emtrion.de ([80.150.99.69]:7670 "EHLO mail3.emtrion.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933158Ab0GOMvE convert rfc822-to-8bit (ORCPT ); Thu, 15 Jul 2010 08:51:04 -0400 Received: from [192.168.2.11] (192.168.2.11) by BMK019S01.emtrion.local (172.26.48.1) with Microsoft SMTP Server id 8.2.176.0; Thu, 15 Jul 2010 14:51:00 +0200 Message-ID: <4C3F0433.8010005@emtrion.de> Date: Thu, 15 Jul 2010 14:50:59 +0200 From: Markus Pietrek User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: CC: Subject: [PATCH] drivers/mfd/sh_mobile_sdhi.c: uses optimized block transfer settings for improved performance X-TM-AS-Product-Ver: SMEX-8.0.0.1307-6.000.1038-17380.005 X-TM-AS-Result: No--12.785800-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 15 Jul 2010 12:51:06 +0000 (UTC) diff --git a/drivers/mfd/sh_mobile_sdhi.c b/drivers/mfd/sh_mobile_sdhi.c index cd16459..0bd80a3 100644 --- a/drivers/mfd/sh_mobile_sdhi.c +++ b/drivers/mfd/sh_mobile_sdhi.c @@ -107,6 +107,15 @@ static int __init sh_mobile_sdhi_probe(struct platform_device *pdev) mmc_data->hclk = clk_get_rate(priv->clk); mmc_data->set_pwr = sh_mobile_sdhi_set_pwr; mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; + + /* values are taken from the firmware based sh_sdhi.c driver */ + mmc_data->max_hw_segs = 32; + mmc_data->max_phys_segs = 32; + mmc_data->max_blk_count = 65535; /* actually it's 65536, but the value 65536 is handled differently and we want to keep the code simple */ + mmc_data->max_req_size = 131072; + mmc_data->max_seg_size = mmc_data->max_req_size; + mmc_data->max_blk_size = mmc_data->max_blk_size; + if (p) { mmc_data->flags = p->tmio_flags; mmc_data->ocr_mask = p->tmio_ocr_mask; diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index ee7d0a5..cdb3a6a 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -847,6 +847,20 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev) mmc->caps |= pdata->capabilities; mmc->f_max = pdata->hclk; mmc->f_min = mmc->f_max / 512; + + if (pdata->max_hw_segs) + mmc->max_hw_segs = pdata->max_hw_segs; + if (pdata->max_phys_segs) + mmc->max_phys_segs = pdata->max_phys_segs; + if (pdata->max_seg_size) + mmc->max_seg_size = pdata->max_seg_size; + if (pdata->max_req_size) + mmc->max_req_size = pdata->max_req_size; + if (pdata->max_blk_size) + mmc->max_blk_size = pdata->max_blk_size; + if (pdata->max_blk_count) + mmc->max_blk_count = pdata->max_blk_count; + if (pdata->ocr_mask) mmc->ocr_avail = pdata->ocr_mask; else diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index f07425b..4eb7358 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h @@ -71,6 +71,15 @@ struct tmio_mmc_data { unsigned long capabilities; unsigned long flags; u32 ocr_mask; /* available voltages */ + + /* overrides for "struct mmc_host" variables */ + unsigned int max_seg_size; + unsigned short max_hw_segs; + unsigned short max_phys_segs; + unsigned int max_req_size; + unsigned int max_blk_size; + unsigned int max_blk_count; + struct tmio_mmc_dma *dma; void (*set_pwr)(struct platform_device *host, int state); void (*set_clk_div)(struct platform_device *host, int state);