From patchwork Wed May 11 16:51:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 777262 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4BGpNvW009416 for ; Wed, 11 May 2011 16:51:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757738Ab1EKQvW (ORCPT ); Wed, 11 May 2011 12:51:22 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:63993 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755409Ab1EKQvV (ORCPT ); Wed, 11 May 2011 12:51:21 -0400 Received: from axis700.grange (dslb-088-076-031-249.pools.arcor-ip.net [88.76.31.249]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MEJOW-1QV8s01XNg-00FTI6; Wed, 11 May 2011 18:51:16 +0200 Received: by axis700.grange (Postfix, from userid 1000) id 0884C189B8B; Wed, 11 May 2011 18:51:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 05A6B189B89; Wed, 11 May 2011 18:51:16 +0200 (CEST) Date: Wed, 11 May 2011 18:51:15 +0200 (CEST) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-sh@vger.kernel.org cc: linux-mmc@vger.kernel.org, Simon Horman , Magnus Damm , Ian Molton Subject: [PATCH 2/3] mmc: sdhi: allow platforms to power down the controller with no card inserted In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:mzWCtEbFCfGtjXIstsBkaZ0n7CC0TVB5FL353yHYdw+ kKah8afEPBcoJG510R8/rrabNBhxiE0R5zxpgQBklSgrZIqhSX sXiWg5mNzznlivDdocThqMUgk/BebfqicQ60asy3rSz/FHKCCs DIuPCLHIeJ1HpN5xg3lNLhFpYKPNOTE6M/GuoASBvoZlLxkrdz 5LkxvtNll5ZIo619ToYvZG85tUqHus37wZDUkWg+vc= Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 11 May 2011 16:51:23 +0000 (UTC) Supply a link to TMIO private data for platforms to implement own card detection. Signed-off-by: Guennadi Liakhovetski --- drivers/mmc/host/sh_mobile_sdhi.c | 6 ++++++ include/linux/mmc/sh_mobile_sdhi.h | 4 ++++ 2 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index d264bbe..b365429 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -71,6 +71,7 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev) } mmc_data = &priv->mmc_data; + p->pdata = mmc_data; snprintf(clk_name, sizeof(clk_name), "sdhi%d", pdev->id); priv->clk = clk_get(&pdev->dev, clk_name); @@ -159,8 +160,11 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev) struct mmc_host *mmc = platform_get_drvdata(pdev); struct tmio_mmc_host *host = mmc_priv(mmc); struct sh_mobile_sdhi *priv = container_of(host->pdata, struct sh_mobile_sdhi, mmc_data); + struct sh_mobile_sdhi_info *p = pdev->dev.platform_data; int i, irq; + p->pdata = NULL; + for (i = 0; i < 3; i++) { irq = platform_get_irq(pdev, i); if (irq >= 0) @@ -178,6 +182,8 @@ static int sh_mobile_sdhi_remove(struct platform_device *pdev) static const struct dev_pm_ops tmio_mmc_dev_pm_ops = { .suspend = tmio_mmc_host_suspend, .resume = tmio_mmc_host_resume, + .runtime_suspend = tmio_mmc_host_runtime_suspend, + .runtime_resume = tmio_mmc_host_runtime_resume, }; static struct platform_driver sh_mobile_sdhi_driver = { diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index c981b95..faf32b6 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h @@ -3,12 +3,16 @@ #include +struct platform_device; +struct tmio_mmc_data; + struct sh_mobile_sdhi_info { int dma_slave_tx; int dma_slave_rx; unsigned long tmio_flags; unsigned long tmio_caps; u32 tmio_ocr_mask; /* available MMC voltages */ + struct tmio_mmc_data *pdata; void (*set_pwr)(struct platform_device *pdev, int state); int (*get_cd)(struct platform_device *pdev); };