From patchwork Tue Mar 3 12:28:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 5922021 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 44402BF440 for ; Tue, 3 Mar 2015 12:29:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6E6E420148 for ; Tue, 3 Mar 2015 12:29:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80D23202B8 for ; Tue, 3 Mar 2015 12:29:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756127AbbCCM3K (ORCPT ); Tue, 3 Mar 2015 07:29:10 -0500 Received: from mail-we0-f177.google.com ([74.125.82.177]:33186 "EHLO mail-we0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755159AbbCCM3J (ORCPT ); Tue, 3 Mar 2015 07:29:09 -0500 Received: by wevl61 with SMTP id l61so2556073wev.0; Tue, 03 Mar 2015 04:29:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=wncqejcUHeNMYEAjNToHX9iehtxzpRVoA1Dkj3UPzrw=; b=gA9Uq8Ugm8tX8xgJ3Kscx3wFoZEtrQtXC6RuFdAvEbp3ZNVxNOOFASXXF8aZFDSRTO tCCtCcD2Ac/DGuXurS2YksISzT8sbBM3UuEDE0Y8H9daWlN+ZrBtvPt6i0adB1zTKf5T r7QzKChQ1hSOVrjuG6pUbVT+/nHrDcbI6ubjZWh6v6BXZ4KmIbdqbfZE+DKaKp9UubyW +AJvJV20RvHI7PelszbQLftLliWI4IEyqulrxSduYjw9YzcQiTC/TODFE5BOJBE+Wv8a 57dUzwfyd7xaJNA/3OKu8TfxmcLN9GcD+i4FwVZx6fCkULuJOIIKd9RH7lmiApRSzjlJ b0pQ== X-Received: by 10.180.97.106 with SMTP id dz10mr2286846wib.33.1425385747740; Tue, 03 Mar 2015 04:29:07 -0800 (PST) Received: from localhost (ip-94-112-1-170.net.upcbroadband.cz. [94.112.1.170]) by mx.google.com with ESMTPSA id cf12sm1137232wjb.10.2015.03.03.04.29.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 04:29:06 -0800 (PST) From: Andreas Fenkart To: linux-mmc@vger.kernel.org Cc: linux-omap@vger.kernel.org, NeilBrown , Tony Lindgren , Ulf Hansson , Andreas Fenkart Subject: [PATCH 5/6] mmc: omap_hsmmc: simplify card/cover detect isr Date: Tue, 3 Mar 2015 13:28:17 +0100 Message-Id: <1425385698-6588-6-git-send-email-afenkart@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1425385698-6588-1-git-send-email-afenkart@gmail.com> References: <1425385698-6588-1-git-send-email-afenkart@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_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 strip the card dectet logic from cover detect isr and vice versa the generic mmc_gpio_cd_irqt isr, uses 200ms on removal/insertion, hence that should be fine here as well Signed-off-by: Andreas Fenkart --- drivers/mmc/host/omap_hsmmc.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index ed68e55..4f6fbe5 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1239,21 +1239,11 @@ static void omap_hsmmc_protect_card(struct omap_hsmmc_host *host) static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id) { struct omap_hsmmc_host *host = dev_id; - int carddetect; sysfs_notify(&host->mmc->class_dev.kobj, NULL, "cover_switch"); - if (host->card_detect) { - carddetect = host->card_detect(host->dev); - } else { - omap_hsmmc_protect_card(host); - carddetect = -ENOSYS; - } - - if (carddetect) - mmc_detect_change(host->mmc, (HZ * 200) / 1000); - else - mmc_detect_change(host->mmc, (HZ * 50) / 1000); + omap_hsmmc_protect_card(host); + mmc_detect_change(host->mmc, (HZ * 200) / 1000); return IRQ_HANDLED; } @@ -1263,19 +1253,8 @@ static irqreturn_t omap_hsmmc_cover_irq(int irq, void *dev_id) static irqreturn_t omap_hsmmc_detect(int irq, void *dev_id) { struct omap_hsmmc_host *host = dev_id; - int carddetect; - - if (host->card_detect) - carddetect = host->card_detect(host->dev); - else { - omap_hsmmc_protect_card(host); - carddetect = -ENOSYS; - } - if (carddetect) - mmc_detect_change(host->mmc, (HZ * 200) / 1000); - else - mmc_detect_change(host->mmc, (HZ * 50) / 1000); + mmc_detect_change(host->mmc, (HZ * 200) / 1000); return IRQ_HANDLED; }