From patchwork Tue Jan 28 08:24:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 3545671 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A5397C02DD for ; Tue, 28 Jan 2014 08:24:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9745E2015A for ; Tue, 28 Jan 2014 08:24:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8862B20154 for ; Tue, 28 Jan 2014 08:24:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754471AbaA1IYc (ORCPT ); Tue, 28 Jan 2014 03:24:32 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:61891 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754651AbaA1IY3 (ORCPT ); Tue, 28 Jan 2014 03:24:29 -0500 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N0300LUGRCT6320@mailout2.samsung.com> for linux-mmc@vger.kernel.org; Tue, 28 Jan 2014 17:24:29 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 98.4F.12635.D3967E25; Tue, 28 Jan 2014 17:24:29 +0900 (KST) X-AuditID: cbfee68d-b7fcd6d00000315b-7f-52e7693d3b33 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 5B.8E.28157.C3967E25; Tue, 28 Jan 2014 17:24:28 +0900 (KST) Received: from [10.252.81.186] by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N030014IRCSD620@mmp1.samsung.com>; Tue, 28 Jan 2014 17:24:28 +0900 (KST) Message-id: <52E7695B.2050504@samsung.com> Date: Tue, 28 Jan 2014 17:24:59 +0900 From: Jaehoon Chung User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-version: 1.0 To: "linux-mmc@vger.kernel.org" Cc: Chris Ball , Arnd Bergmann , Ulf Hansson , Seungwon Jeon Subject: [PATCH v2 8/8] mmc: core: use the broken-cd for non-removable card Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFIsWRmVeSWpSXmKPExsWyRsSkRNc283mQQctBVou/k46xW0y4vJ3R 4sj/fkaLD/cvMlscXxvuwOrx+9ckRo871/awedx4tZDJo2/LKkaPz5vkAlijuGxSUnMyy1KL 9O0SuDKaDxQWNPBVNEw5z9bAeJK7i5GTQ0LAROLojmtsELaYxIV764FsLg4hgaWMEj0TX7PD FE2YuYkRIrGIUeLEzb/MEM5rRomzGy8xgVTxCmhJLJjdANbBIqAqsed+PwuIzSagI7H923Gw GlGBMImpJ66yQNQLSvyYfA/I5uAQEbCWaP4tCzKTWaCPUWLHz6+MIDXCAt4SL7c+BzuPGWjO /tZpULa8xOY1b5khrlvGLnG9OwBir4DEt8mHwGZKCMhKbDoAVSIpcXDFDZYJjCKzkGyehWTq LCRTFzAyr2IUTS1ILihOSi8y1CtOzC0uzUvXS87P3cQIjJfT/5717mC8fcD6EGMy0MqJzFKi yfnAeMsriTc0NjOyMDUxNTYytzQjTVhJnDfpYVKQkEB6YklqdmpqQWpRfFFpTmrxIUYmDk6p BsYWO9c7p332/g83zZj0VZRVwXVu3F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ter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Some SoC is used the broken card-detection. And it should be also used the "non-removable". Even if card is "non-removable", it didn't always use the cd-gpio. If it's used only broken-cd, then card-detect interrupt is polling. Signed-off-by: Jaehoon Chung --- drivers/mmc/core/core.c | 4 ++-- drivers/mmc/core/host.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 098374b..df732aa 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2460,8 +2460,8 @@ void mmc_rescan(struct work_struct *work) */ mmc_bus_put(host); - if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->get_cd && - host->ops->get_cd(host) == 0) { + if (host->ops->get_cd && host->ops->get_cd(host) == 0 && + !(host->caps & MMC_CAP_NONREMOVABLE)) { mmc_claim_host(host); mmc_power_off(host); mmc_release_host(host); diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 4b81c93..52a64fe 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -356,6 +356,9 @@ int mmc_of_parse(struct mmc_host *host) * configuration is performed. */ + if (of_find_property(np, "broken-cd", &len)) + host->caps |= MMC_CAP_NEEDS_POLL; + /* Parse Card Detection */ if (of_find_property(np, "non-removable", &len)) { host->caps |= MMC_CAP_NONREMOVABLE; @@ -364,9 +367,6 @@ int mmc_of_parse(struct mmc_host *host) explicit_inv_cd = of_property_read_bool(np, "cd-inverted"); - if (of_find_property(np, "broken-cd", &len)) - host->caps |= MMC_CAP_NEEDS_POLL; - gpio = of_get_named_gpio_flags(np, "cd-gpios", 0, &flags); if (gpio == -EPROBE_DEFER) return gpio;