Received: by 10.192.165.156 with SMTP id m28csp61959imm; Tue, 10 Apr 2018 16:25:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+A9RaIqQycPpC3t4/tAAiLXfz5iLi+jN+D4F3tdWQfcMpv0rUhTJNjZL8M1gNBINque8QJ X-Received: by 2002:a17:902:9a82:: with SMTP id w2-v6mr2449952plp.6.1523402747573; Tue, 10 Apr 2018 16:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523402747; cv=none; d=google.com; s=arc-20160816; b=vSA/8v8rU4ebfJ7lN7GvIkw1qXtvRCFMVny6GrsSxpvh+pQeimVQp5cNyhztADOab7 Z/8ZG8YGoOIeP5QMOMsecseHypxfSAtnoS5L3YQ5HvO49I32/Hn7jCWSMKrqoe2vML63 NGe0OrOEEt4zU41ebIkifBxjMl972HnE3k1IorzdGt2iTamzAHffDkHZKSMMJeX4RJQK et8QCdXtk2xfwgwdHIdB0ud7SZYU2e6nW8nqsBRqJgx2kmwAjICW6r7kB61BTCr5RSMc fOf++C4eygOmWuB1yh3SduYeTzbsHUMhkoLq4keWl/os1nTARgBOVZPkZkBXd+ulx0h9 xo2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=7Zzhaj1Z+Xsk2m1hJbC/yVbPYnJzhd/dEhB3y/AUi8U=; b=rSI+30KBcqp6xz0aD6JoXbzSEe3WhTV0Y85tuz8b0Rd5yRAMjzVcvb3p7TFPKpxaGe s+MNOXp35Pi+k6dzcb/S7/G3q4JCpddfjhX1j1Ec9cd0EmzLtOvo/mZMkYRdsXmacvoq wkT81S8LadqSl+auw+uHej+byZCqxqdXazeexFeTCGp4QPspSuuYzQLS1gB/LDwrAKnd fZYrrj2EFP+peLEKs1qp9nMpJhQYWE95WIXHjZODd51GCg8GwguN0tto2t+WlU27TcPz AdohV4/MmK2ObA4kd78eD51LDOrQk02pJkvw+ipwPmQzmdxGuATKDwZiJSudh3195SCD qKhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64-v6si3481398ply.528.2018.04.10.16.25.11; Tue, 10 Apr 2018 16:25:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755299AbeDJXTt (ORCPT + 99 others); Tue, 10 Apr 2018 19:19:49 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40258 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752746AbeDJWbE (ORCPT ); Tue, 10 Apr 2018 18:31:04 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D2A05DF6; Tue, 10 Apr 2018 22:31:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Adrian Hunter , Ulf Hansson , Sasha Levin Subject: [PATCH 4.15 099/168] sdhci: Advertise 2.0v supply on SDIO host controller Date: Wed, 11 Apr 2018 00:24:01 +0200 Message-Id: <20180410212804.467826963@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andy Shevchenko [ Upstream commit 2a609abe71ca59e4bd7139e161eaca2144ae6f2e ] On Intel Edison the Broadcom Wi-Fi card, which is connected to SDIO, requires 2.0v, while the host, according to Intel Merrifield TRM, supports 1.8v supply only. The card announces itself as mmc2: new ultra high speed DDR50 SDIO card at address 0001 Introduce a custom OCR mask for SDIO host controller on Intel Merrifield and add a special case to sdhci_set_power_noreg() to override 2.0v supply by enforcing 1.8v power choice. Signed-off-by: Andy Shevchenko Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci-pci-core.c | 2 ++ drivers/mmc/host/sdhci.c | 7 +++++++ 2 files changed, 9 insertions(+) --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -805,6 +805,8 @@ static int intel_mrfld_mmc_probe_slot(st slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; break; case INTEL_MRFLD_SDIO: + /* Advertise 2.0v for compatibility with the SDIO card's OCR */ + slot->host->ocr_mask = MMC_VDD_20_21 | MMC_VDD_165_195; slot->host->mmc->caps |= MMC_CAP_NONREMOVABLE | MMC_CAP_POWER_OFF_CARD; break; --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1470,6 +1470,13 @@ void sdhci_set_power_noreg(struct sdhci_ if (mode != MMC_POWER_OFF) { switch (1 << vdd) { case MMC_VDD_165_195: + /* + * Without a regulator, SDHCI does not support 2.0v + * so we only get here if the driver deliberately + * added the 2.0v range to ocr_avail. Map it to 1.8v + * for the purpose of turning on the power. + */ + case MMC_VDD_20_21: pwr = SDHCI_POWER_180; break; case MMC_VDD_29_30: