From patchwork Tue Dec 4 15:51:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 1839031 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id DEA3B3FC64 for ; Tue, 4 Dec 2012 15:54:37 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tfun2-0003Bb-Dh; Tue, 04 Dec 2012 15:52:08 +0000 Received: from moutng.kundenserver.de ([212.227.17.9]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tfumj-000375-99 for linux-arm-kernel@lists.infradead.org; Tue, 04 Dec 2012 15:51:50 +0000 Received: from axis700.grange (dslb-094-221-109-052.pools.arcor-ip.net [94.221.109.52]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MIPfz-1TcKXv37Kp-003m3H; Tue, 04 Dec 2012 16:51:37 +0100 Received: by axis700.grange (Postfix, from userid 1000) id 59B4440B99; Tue, 4 Dec 2012 16:51:36 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 55D4F40B98; Tue, 4 Dec 2012 16:51:36 +0100 (CET) Date: Tue, 4 Dec 2012 16:51:36 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: linux-mmc@vger.kernel.org Subject: [PATCH 2/3] mmc: extend the slot-gpio card-detection to use host's .card_event() method In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Provags-ID: V02:K0:eBMAMTCmOlAKqaRTT3nv/jz/NLcH35vuDCB5khcTQkt 9Q4tszu9CoiuZ62Zua2dLB1FNfxnl0NQWP4HJdDql201EkuT4O cqDvI1E4J5xfwQs8sA4xVI2T6jIWWx15tNxiuyz0NCCXzZnPvC ve4e4wlbQZxpCQKDgnk6PysniCZ0+Fs+0HX8RF+hl8lxVFYtgZ u9l95i4DrIyTfogcl/4yIvCD+Zd0oQWmNej1JV89nwpyX5BTCy GoJei6ruWZdAK8VSclb3Y9d+NvaftjSgTjuX7uI2uXMv1Is7+e uD918zTf4mKL0Vai/LhrYdIY3kU0qk9gzPPvEofOwwm5q1NyNQ JvxZzS2xSMYAVwtD9UzZEY33HjOSNO5IhF90yve2OmSQXS1oZb K5U98p4AhNMrw== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121204_105149_631984_616301EB X-CRM114-Status: GOOD ( 12.50 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.17.9 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (g.liakhovetski[at]gmx.de) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Chris Ball , Russell King - ARM Linux , Sebastian Hesselbarth , Mike Rapoport , Shawn Guo , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The slot-gpio API provides a generic card-detection handler. To support a wider range of hosts it has to call the host's card-event callback, if implemented. Also increase the debounce interval to 200ms to match the SDHCI driver. Signed-off-by: Guennadi Liakhovetski --- drivers/mmc/core/slot-gpio.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/core/slot-gpio.c b/drivers/mmc/core/slot-gpio.c index 08c6b3d..16a1c0b 100644 --- a/drivers/mmc/core/slot-gpio.c +++ b/drivers/mmc/core/slot-gpio.c @@ -27,7 +27,13 @@ struct mmc_gpio { static irqreturn_t mmc_gpio_cd_irqt(int irq, void *dev_id) { /* Schedule a card detection after a debounce timeout */ - mmc_detect_change(dev_id, msecs_to_jiffies(100)); + struct mmc_host *host = dev_id; + + if (host->ops->card_event) + host->ops->card_event(host); + + mmc_detect_change(host, msecs_to_jiffies(200)); + return IRQ_HANDLED; }