From patchwork Thu Oct 18 11:02:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Heiko_St=C3=BCbner?= X-Patchwork-Id: 1609881 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 4E98DDFB34 for ; Thu, 18 Oct 2012 11:02:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932595Ab2JRLCe (ORCPT ); Thu, 18 Oct 2012 07:02:34 -0400 Received: from gloria.sntech.de ([95.129.55.99]:36784 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932594Ab2JRLCe (ORCPT ); Thu, 18 Oct 2012 07:02:34 -0400 Received: from 146-52-52-252-dynip.superkabel.de ([146.52.52.252] helo=marty.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1TOns0-0007NO-6Z; Thu, 18 Oct 2012 13:02:32 +0200 From: Heiko =?utf-8?q?St=C3=BCbner?= To: Seungwon Jeon Subject: [PATCH v2] mmc: sdhci-s3c: fix the card detection in runtime-pm Date: Thu, 18 Oct 2012 13:02:30 +0200 User-Agent: KMail/1.13.7 (Linux/3.2.0-3-686-pae; KDE/4.8.4; i686; ; ) Cc: linux-mmc@vger.kernel.org, "'Chander Kashyap'" , "'Chris Ball'" References: <004801cdad17$498d9140$dca8b3c0$%jun@samsung.com> In-Reply-To: <004801cdad17$498d9140$dca8b3c0$%jun@samsung.com> MIME-Version: 1.0 Message-Id: <201210181302.30843.heiko@sntech.de> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org If host clock is disabled, host cannot detect a card in case of using the internal or gpio card-detect for detection. Signed-off-by: Seungwon Jeon Tested-by: Heiko Stuebner --- I've added the SDHCI_CD_GPIO to the conditional. With this change it works on my machine. But I'm not sure if this would also be necessary for the external card detect. drivers/mmc/host/sdhci-s3c.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 0cabf18..649dc32 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -750,7 +750,9 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev) sdhci_s3c_setup_card_detect_gpio(sc); #ifdef CONFIG_PM_RUNTIME - clk_disable(sc->clk_io); + if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL && + pdata->cd_type != S3C_SDHCI_CD_GPIO) + clk_disable(sc->clk_io); #endif return 0; @@ -797,7 +799,9 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev) gpio_free(sc->ext_cd_gpio); #ifdef CONFIG_PM_RUNTIME - clk_enable(sc->clk_io); + if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL && + pdata->cd_type != S3C_SDHCI_CD_GPIO) + clk_enable(sc->clk_io); #endif sdhci_remove_host(host, 1);