From patchwork Thu May 19 13:25:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 9127623 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 DCCEF607D8 for ; Thu, 19 May 2016 13:39:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16BAE281E8 for ; Thu, 19 May 2016 13:26:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B9D6281EA; Thu, 19 May 2016 13:26:00 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 8E44B281E8 for ; Thu, 19 May 2016 13:25:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754338AbcESNZ5 (ORCPT ); Thu, 19 May 2016 09:25:57 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:36464 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754679AbcESNZ4 (ORCPT ); Thu, 19 May 2016 09:25:56 -0400 Received: by mail-lb0-f170.google.com with SMTP id h1so24525411lbj.3 for ; Thu, 19 May 2016 06:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=S2vOOBfobYTpwYXHio0DNfq6537v18/zeWtw/f+mkhc=; b=hr2kjAoj2KUEG6Tir21Cp9FFXEpHvxIbSLS+xMfeJtZSA3DLOg4kC/0Gdu7J9nFrLg PHo7VR3po4VA/3/9EtuwdIb6AWH/6QJWQ6nhHydQ7+2ng1lrb6hgG2GfqBNRn8U75vpB /lNEPFgP4ztj2nmC0kiidTm3HXpmAzKxfOJLU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=S2vOOBfobYTpwYXHio0DNfq6537v18/zeWtw/f+mkhc=; b=l5LO2TX/X9uZSyHn2p58Hoa+zSrWt6zoHi4f1fY/NreJFpaW4fBhoPhKgrMk4LiNwz ymhm20rCCevsoIBDLkMDApodPyEiJnvVn/ppil+r1ZQqvq760qF5AFjbRR2u71mSCEYG +/OQTkvHAjpVexTrdOb5cH/OedjKM/6lD6qlYFNM56zcLBD8WGd8azwzRtdXZ9tlxHHq TvKwnvQTaLCU2UkEvwFwUJwwlBT9PIVN1ZoL1WY27MYAWyPNcrjtlnMCO6xOpvyoVcmG 63h2nIMdA3emdB+e+VwhYXda6QeDLUq1kv17Dg0nmQB0CsJr/14gYvC76Mjy4/LYgOfz v47g== X-Gm-Message-State: AOPr4FU7J4cz7bgW92l9ncsUD0VCPXxuhtAq3mL9a9kIkYeGGZPCPYg7j//jr/VbZZGYsMIM X-Received: by 10.112.95.114 with SMTP id dj18mr4687967lbb.136.1463664354647; Thu, 19 May 2016 06:25:54 -0700 (PDT) Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n37sm2435480lfg.46.2016.05.19.06.25.52 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 May 2016 06:25:53 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , "Rafael J. Wysocki" , Len Brown Cc: linux-acpi@vger.kernel.org, Laszlo Fiat , Nicholas Krause , Subject: [PATCH 2/2] mmc: sdhci-acpi: Ensure connected devices are powered when probing Date: Thu, 19 May 2016 15:25:42 +0200 Message-Id: <1463664342-19209-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1463664342-19209-1-git-send-email-ulf.hansson@linaro.org> References: <1463664342-19209-1-git-send-email-ulf.hansson@linaro.org> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Adrian Hunter Some devices connected to the SDHCI controller may have separate enabling lines that are controlled through GPIO. These devices need to be powered on and enabled before probing. This is to ensure all devices connected can be seen by the controller. Signed-off-by: Adrian Hunter Tested-by: Laszlo Fiat Cc: # 4.5+ Signed-off-by: Ulf Hansson Reported-by: Laszlo Fiat --- drivers/mmc/host/sdhci-acpi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index b2d70ba..2d1c4870 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -378,7 +378,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; acpi_handle handle = ACPI_HANDLE(dev); - struct acpi_device *device; + struct acpi_device *device, *child; struct sdhci_acpi_host *c; struct sdhci_host *host; struct resource *iomem; @@ -390,6 +390,11 @@ static int sdhci_acpi_probe(struct platform_device *pdev) if (acpi_bus_get_device(handle, &device)) return -ENODEV; + /* Power on the SDHCI controller and its children */ + acpi_device_fix_up_power(device); + list_for_each_entry(child, &device->children, node) + acpi_device_fix_up_power(child); + if (acpi_bus_get_status(device) || !device->status.present) return -ENODEV;