From patchwork Thu Mar 12 16:23:26 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 11406 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2CGNSWM004862 for ; Thu, 12 Mar 2009 16:23:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757436AbZCLQXU (ORCPT ); Thu, 12 Mar 2009 12:23:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757467AbZCLQXU (ORCPT ); Thu, 12 Mar 2009 12:23:20 -0400 Received: from smtp.nokia.com ([192.100.122.230]:25191 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757436AbZCLQXO (ORCPT ); Thu, 12 Mar 2009 12:23:14 -0400 Received: from esebh106.NOE.Nokia.com (esebh106.ntc.nokia.com [172.21.138.213]) by mgw-mx03.nokia.com (Switch-3.2.6/Switch-3.2.6) with ESMTP id n2CGMfXG026980; Thu, 12 Mar 2009 18:23:02 +0200 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by esebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Mar 2009 18:23:02 +0200 Received: from mgw-int02.ntc.nokia.com ([172.21.143.97]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Thu, 12 Mar 2009 18:23:01 +0200 Received: from [127.0.1.1] (esdhcp041224.research.nokia.com [172.21.41.224]) by mgw-int02.ntc.nokia.com (Switch-3.2.5/Switch-3.2.5) with ESMTP id n2CGN08R015288; Thu, 12 Mar 2009 18:23:00 +0200 From: Adrian Hunter To: Pierre Ossman Cc: Jarkko Lavinen , Adrian Hunter , Grazvydas Ignotas , David Brownell , linux-omap Mailing List , Tony Lindgren , lkml Date: Thu, 12 Mar 2009 18:23:26 +0200 Message-Id: <20090312162326.19421.20582.sendpatchset@ahunter-laptop> In-Reply-To: <20090312162252.19421.34019.sendpatchset@ahunter-laptop> References: <20090312162252.19421.34019.sendpatchset@ahunter-laptop> Subject: [PATCH 5/10] OMAP: HSMMC: Allow cover switch to cause rescan X-OriginalArrivalTime: 12 Mar 2009 16:23:01.0873 (UTC) FILETIME=[D0815610:01C9A32E] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From 702faf54a21016777bfedf94ea709b2f05b5aee2 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Mon, 26 Jan 2009 13:17:25 +0200 Subject: [PATCH] OMAP: HSMMC: Allow cover switch to cause rescan Allow a cover switch to be used to cause a rescan of the MMC slot. Signed-off-by: Adrian Hunter --- drivers/mmc/host/omap_hsmmc.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index fd1657a..f3e4e0f 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -571,7 +571,10 @@ static void mmc_omap_detect(struct work_struct *work) mmc_carddetect_work); struct omap_mmc_slot_data *slot = &mmc_slot(host); - host->carddetect = slot->card_detect(slot->card_detect_irq); + if (mmc_slot(host).card_detect) + host->carddetect = slot->card_detect(slot->card_detect_irq); + else + host->carddetect = -ENOSYS; sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); if (host->carddetect) { @@ -1089,7 +1092,7 @@ static int __init omap_mmc_probe(struct platform_device *pdev) } /* Request IRQ for card detect */ - if ((mmc_slot(host).card_detect_irq) && (mmc_slot(host).card_detect)) { + if ((mmc_slot(host).card_detect_irq)) { ret = request_irq(mmc_slot(host).card_detect_irq, omap_mmc_cd_handler, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING @@ -1112,8 +1115,8 @@ static int __init omap_mmc_probe(struct platform_device *pdev) if (ret < 0) goto err_slot_name; } - if (mmc_slot(host).card_detect_irq && mmc_slot(host).card_detect && - host->pdata->slots[host->slot_id].get_cover_state) { + if (mmc_slot(host).card_detect_irq && + host->pdata->slots[host->slot_id].get_cover_state) { ret = device_create_file(&mmc->class_dev, &dev_attr_cover_switch); if (ret < 0)