From patchwork Wed Apr 19 13:09:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Hunter X-Patchwork-Id: 9687433 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0C0F060383 for ; Wed, 19 Apr 2017 13:15:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F220428418 for ; Wed, 19 Apr 2017 13:15:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E700B28427; Wed, 19 Apr 2017 13:15:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 959C82841C for ; Wed, 19 Apr 2017 13:15:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763532AbdDSNPI (ORCPT ); Wed, 19 Apr 2017 09:15:08 -0400 Received: from mga03.intel.com ([134.134.136.65]:25803 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763519AbdDSNPI (ORCPT ); Wed, 19 Apr 2017 09:15:08 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2017 06:15:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,221,1488873600"; d="scan'208";a="847621136" Received: from ahunter-desktop.fi.intel.com ([10.237.72.168]) by FMSMGA003.fm.intel.com with ESMTP; 19 Apr 2017 06:15:06 -0700 From: Adrian Hunter To: Ulf Hansson Cc: linux-mmc Subject: [PATCH 2/2] mmc: sdhci-pci: Enable card detect wake for Intel BYT-related SD card host controllers Date: Wed, 19 Apr 2017 16:09:23 +0300 Message-Id: <1492607363-5346-3-git-send-email-adrian.hunter@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1492607363-5346-1-git-send-email-adrian.hunter@intel.com> References: <1492607363-5346-1-git-send-email-adrian.hunter@intel.com> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Enable card detect wake for Intel BYT-related SD card host controllers. Signed-off-by: Adrian Hunter --- drivers/mmc/host/sdhci-pci-core.c | 3 +++ drivers/mmc/host/sdhci-pci.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index 833072b8453e..57d6f50b73dc 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -634,6 +634,7 @@ static int byt_sd_probe_slot(struct sdhci_pci_slot *slot) MMC_CAP_AGGRESSIVE_PM; slot->cd_idx = 0; slot->cd_override_level = true; + slot->cd_wake = true; if (slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXT_SD || slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_BXTM_SD || slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_APL_SD || @@ -1989,6 +1990,8 @@ static struct sdhci_pci_slot *sdhci_pci_probe_slot( if (ret) { dev_warn(&pdev->dev, "failed to setup card detect gpio\n"); slot->cd_idx = -1; + } else if (slot->cd_wake) { + mmc_gpio_cd_enable_wake(host->mmc); } } diff --git a/drivers/mmc/host/sdhci-pci.h b/drivers/mmc/host/sdhci-pci.h index 37766d20a600..6029fb314421 100644 --- a/drivers/mmc/host/sdhci-pci.h +++ b/drivers/mmc/host/sdhci-pci.h @@ -91,6 +91,7 @@ struct sdhci_pci_slot { int cd_idx; bool cd_override_level; + bool cd_wake; void (*hw_reset)(struct sdhci_host *host); unsigned long private[0] ____cacheline_aligned;