Received: by 10.192.165.156 with SMTP id m28csp39563imm; Tue, 10 Apr 2018 15:57:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx495ZccnZG8mBZAahLcIzN842UNX70DvA7WgMH/ILzZAckz5dY5+wuMIPOERnBBUSoj5h3SS X-Received: by 10.167.131.146 with SMTP id u18mr1758140pfm.199.1523401067343; Tue, 10 Apr 2018 15:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523401067; cv=none; d=google.com; s=arc-20160816; b=NFb9XRPmvB7JOG6OJC1QUTtrybR2woerL/xq1xVc6tdJELtWBRDLxKjClu9nlhglQW 3gVt0uKHHSR8LBvectmDYJ9UpMyg1ny5gt7iark7vyCn+Bj95hURmhWC6Xrd5Aej4D9Q a+abufdifw9ArhOlXCxZkwX77/FJiqO6Y5x7NgJXL35gUEchliOYht3rX57fPPFo/kpY UmEdnBEgXcboVwWJ6BzJWM5etYYvcHzxQgIUC6/6gYqQYA8rys9KIa0y8GPA9LVIVhuf /STdso+TZ8iTDstyQ0pL1Uud3NBxIyUameN6xMcXvhM6TutAmpZbHFXNg1imVOIY24K/ DYhg== 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=JXaymgDGUZ3KXmpr416jPo+y+MF/pJ3Fu6eRrS8brYc=; b=NRp7Ntz2YByPNNwET2Q3FQw3FcdusBztBX9qbFfTlWjZMkMKIGfFQdpHzfuW+fgo/W u7cC4Da0xNjQM/sdgYIPaNZ+BDqybFCExOwaOxLR0Pru4L71dCOzv5o0+UGYrdviVWCP jqakPARdjxRIDr96wYs6wWOdfVgTJ7rV8O6FV83KaHRKzgsxPmQ6OaMfXrrChCY22c8F U0nY//CAdaMXHgvguUUt6mZEQEwEU/kTbYBolhoDraYIIFXjwnSa1AbyaYyWQXgkt1E1 7Eopen2Z7bBerEY60+/fLMpAIY9YPhPeewL0WJyNpocMzHuEMNYviJoAiaUF4D9f/VNZ FIcw== 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 g6-v6si3713427plt.580.2018.04.10.15.57.10; Tue, 10 Apr 2018 15:57: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 S1755855AbeDJWhu (ORCPT + 99 others); Tue, 10 Apr 2018 18:37:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43908 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755045AbeDJWhr (ORCPT ); Tue, 10 Apr 2018 18:37:47 -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 5920E408; Tue, 10 Apr 2018 22:37:46 +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.14 075/138] sdhci: Advertise 2.0v supply on SDIO host controller Date: Wed, 11 Apr 2018 00:24:25 +0200 Message-Id: <20180410212910.844252189@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@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.14-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 @@ -806,6 +806,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: