From patchwork Tue Jan 13 04:57:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5617641 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2B3CDC058D for ; Tue, 13 Jan 2015 04:57:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 382B3205F7 for ; Tue, 13 Jan 2015 04:57:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2F37A205E8 for ; Tue, 13 Jan 2015 04:57:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752107AbbAME5r (ORCPT ); Mon, 12 Jan 2015 23:57:47 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:35610 "EHLO relmlie1.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750971AbbAME5q (ORCPT ); Mon, 12 Jan 2015 23:57:46 -0500 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie1.idc.renesas.com with ESMTP; 13 Jan 2015 13:57:45 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id BF7FF3E38A; Tue, 13 Jan 2015 13:57:45 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id 93F288002E; Tue, 13 Jan 2015 13:57:45 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 8E8E88002D; Tue, 13 Jan 2015 13:57:45 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id PAA07537; Tue, 13 Jan 2015 13:57:45 +0900 X-IronPort-AV: E=Sophos;i="5.07,747,1413212400"; d="scan'208";a="178567389" Received: from mail-sg1lp0092.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.92]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 13 Jan 2015 13:57:44 +0900 Received: from remon.renesas.com (211.11.155.132) by HKNPR06MB162.apcprd06.prod.outlook.com (10.242.104.19) with Microsoft SMTP Server (TLS) id 15.1.53.17; Tue, 13 Jan 2015 04:57:42 +0000 Message-ID: <87ppajuvip.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 03/17] mmc: tmio: tmio_mmc_host has .write16_hook User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Ulf Hansson CC: Arnd Bergmann , Chris Ball , Simon , Linux-SH , linux-mmc In-Reply-To: <87twzvuvl1.wl%kuninori.morimoto.gx@renesas.com> References: <87twzvuvl1.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Date: Tue, 13 Jan 2015 04:57:42 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: SIXPR06CA0057.apcprd06.prod.outlook.com (25.160.171.175) To HKNPR06MB162.apcprd06.prod.outlook.com (10.242.104.19) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; X-DmarcAction-Test: None X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(3005003);SRVR:HKNPR06MB162; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:HKNPR06MB162; X-Forefront-PRVS: 045584D28C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(66066001)(50466002)(101416001)(47776003)(46102003)(77156002)(2950100001)(64706001)(46406003)(68736005)(53416004)(36756003)(69596002)(81156004)(19580395003)(77096005)(92566002)(54356999)(19580405001)(50986999)(40100003)(23726002)(110136001)(105586002)(97736003)(122386002)(42186005)(62966003)(76176999)(106356001)(86362001)(33646002)(229853001)(87976001)(83506001)(142923001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKNPR06MB162; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:HKNPR06MB162; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2015 04:57:42.4202 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKNPR06MB162 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Current .write16_hook is implemented under tmio_mmc_data. It goes to tmio_mmc_host by this patch. Signed-off-by: Kuninori Morimoto Acked-by: Lee Jones --- drivers/mmc/host/sh_mobile_sdhi.c | 2 +- drivers/mmc/host/tmio_mmc.h | 4 +++- drivers/mmc/host/tmio_mmc_pio.c | 2 +- include/linux/mfd/tmio.h | 3 --- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index 288e78d..77ff062 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -214,11 +214,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) } host->dma = dma_priv; + host->write16_hook = sh_mobile_sdhi_write16_hook; mmc_data->clk_enable = sh_mobile_sdhi_clk_enable; mmc_data->clk_disable = sh_mobile_sdhi_clk_disable; mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; - mmc_data->write16_hook = sh_mobile_sdhi_write16_hook; mmc_data->multi_io_quirk = sh_mobile_sdhi_multi_io_quirk; if (p) { mmc_data->flags = p->tmio_flags; diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index 49a2559..3fa96b1 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h @@ -94,6 +94,8 @@ struct tmio_mmc_host { struct mutex ios_lock; /* protect set_ios() context */ bool native_hotplug; bool sdio_irq_enabled; + + int (*write16_hook)(struct tmio_mmc_host *host, int addr); }; struct tmio_mmc_host *tmio_mmc_host_alloc(struct platform_device *pdev); @@ -183,7 +185,7 @@ static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val /* If there is a hook and it returns non-zero then there * is an error and the write should be skipped */ - if (host->pdata->write16_hook && host->pdata->write16_hook(host, addr)) + if (host->write16_hook && host->write16_hook(host, addr)) return; writew(val, host->ctl + (addr << host->pdata->bus_shift)); } diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index 1a9a13f..fe434cc 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -1090,7 +1090,7 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host, tmio_mmc_of_parse(pdev, pdata); if (!(pdata->flags & TMIO_MMC_HAS_IDLE_WAIT)) - pdata->write16_hook = NULL; + _host->write16_hook = NULL; res_ctl = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res_ctl) diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 8d708c7..0872ca1 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h @@ -112,8 +112,6 @@ void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); struct dma_chan; -struct tmio_mmc_host; - /* * data for the MMC controller */ @@ -127,7 +125,6 @@ struct tmio_mmc_data { unsigned int cd_gpio; void (*set_pwr)(struct platform_device *host, int state); void (*set_clk_div)(struct platform_device *host, int state); - int (*write16_hook)(struct tmio_mmc_host *host, int addr); /* clock management callbacks */ int (*clk_enable)(struct platform_device *pdev, unsigned int *f); void (*clk_disable)(struct platform_device *pdev);