From patchwork Wed Jul 6 20:23:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 9217005 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7E65160467 for ; Wed, 6 Jul 2016 20:24:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7170B28454 for ; Wed, 6 Jul 2016 20:24:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6666628457; Wed, 6 Jul 2016 20:24:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E560228454 for ; Wed, 6 Jul 2016 20:24:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755651AbcGFUYA (ORCPT ); Wed, 6 Jul 2016 16:24:00 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:43971 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755452AbcGFUX7 (ORCPT ); Wed, 6 Jul 2016 16:23:59 -0400 Received: from penelope.kanocho.kobe.vergenet.net (dhcp-077-251-078-056.chello.nl [77.251.78.56]) by kirsty.vergenet.net (Postfix) with ESMTPSA id 3EF9B25BEA1; Thu, 7 Jul 2016 06:23:55 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1467836635; bh=j5LqE+18bwbDblJS57AmfY3+9wnM6P63Cr3SgMK3KuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y5OV5tEMm1c4WgEJv90C7jiWlQcdmy8k7zsfIv6nzLNS1bcZzajbIKkL8khKFkGbT zrhiziVN8MkWbPuTqdDx1vMogpWor6A8mNhrOn6OvahmQIdfLs1zU4uqJzh9bQOoY+ NgcBxG5hMM4BG0FC/6x0dClGMmxAWSxM/G6GM0B4= Received: by penelope.kanocho.kobe.vergenet.net (Postfix, from userid 7100) id CD0D6611CE; Wed, 6 Jul 2016 22:23:51 +0200 (CEST) From: Simon Horman To: Wolfram Sang , Ulf Hansson Cc: Magnus Damm , linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH/RFC v3 3/6] mmc: tmio: add max_segs and max_blk_count in tmio_mmc_data Date: Wed, 6 Jul 2016 22:23:27 +0200 Message-Id: <1467836610-18539-4-git-send-email-horms+renesas@verge.net.au> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1467836610-18539-1-git-send-email-horms+renesas@verge.net.au> References: <1467836610-18539-1-git-send-email-horms+renesas@verge.net.au> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yoshihiro Shimoda To change each value from related driver (e.g. sh_mobile_sdhi driver), this patch adds these member in the struct tmio_mmc_data. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Ai Kyuse Signed-off-by: Simon Horman --- v3 * Add missing hunk to set mmc->max_blk_count v2 * First post --- drivers/mmc/host/tmio_mmc_pio.c | 6 +++--- include/linux/mfd/tmio.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index c0020c331595..30d136c72005 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -1124,10 +1124,10 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities; mmc->caps2 |= pdata->capabilities2; - mmc->max_segs = 32; + mmc->max_segs = pdata->max_segs ? pdata->max_segs : 32; mmc->max_blk_size = 512; - mmc->max_blk_count = (PAGE_SIZE / mmc->max_blk_size) * - mmc->max_segs; + mmc->max_blk_count = pdata->max_blk_count ? : + (PAGE_SIZE / mmc->max_blk_size) * mmc->max_segs; mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count; mmc->max_seg_size = mmc->max_req_size; diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 7a26286db895..3b95dc7eb314 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h @@ -125,6 +125,8 @@ struct tmio_mmc_data { unsigned int cd_gpio; int alignment_shift; dma_addr_t dma_rx_offset; + unsigned int max_blk_count; + unsigned short max_segs; void (*set_pwr)(struct platform_device *host, int state); void (*set_clk_div)(struct platform_device *host, int state); };