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: 1839001 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 D455DDF230 for ; Tue, 4 Dec 2012 15:51:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752709Ab2LDPvp (ORCPT ); Tue, 4 Dec 2012 10:51:45 -0500 Received: from moutng.kundenserver.de ([212.227.17.9]:60927 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752316Ab2LDPvp (ORCPT ); Tue, 4 Dec 2012 10:51:45 -0500 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 cc: Russell King - ARM Linux , Shawn Guo , Sebastian Hesselbarth , Mike Rapoport , linux-arm-kernel@lists.infradead.org, Chris Ball 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== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.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; }