Received: by 10.213.65.68 with SMTP id h4csp30501imn; Mon, 19 Mar 2018 18:30:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELt0/jjFZxpIV6tby4zbBIUCDkRGYYBneUIWpdu6rV52yma4WdxdeYBPoU3no4NTYtlurUa/ X-Received: by 10.98.141.65 with SMTP id z62mr12073078pfd.129.1521509447760; Mon, 19 Mar 2018 18:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521509447; cv=none; d=google.com; s=arc-20160816; b=IPMy7rrZ1LqYHEtpcKkSC71ofUdLBwJVNpzf0FP9BuZbLuoaJbyUuFxJas3s/sh9Vw F+cKs8YMBqYj+tFUCDMK+0uufnyC9InuayNH56ZnX6f7q3athXGrs79sI+62MJFP4w0J G7OrqzLWLNgmYiGCjnWxhjOXPY3WpMVKGRHwdG/7FknbcKW0wEBiqV+A7krRdJOU39Pe Ad9p8GGaup3MaxHy+C189zXGVBEZp4dyV3poBck4nMV5dVdbmUo7an+Ti7a8KPK+5Ax9 E02jDYPJnM2nuavmBqN3di1i2fk2j4ETA1GHImvmsTr+Ghw8j3FcPFOOby6yL0hMJpBj UmYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=BrLlYtXOMcWYd4E0X4uqmbyIz90cmvoYledCMBRlJa0=; b=AeuTH/GNriFOd1VmWBwCebNlIRTKaNAV/CJU+eMtqSdJaKAhIuOAA8oEDZj4iJMJbx 0utgkMh4+sC6l4H2k1jwCkveDnlDeOlttS6ZJYl2z+k/p8s0gW2vMit6i2zBbDfUJUMb eag7lsQxMPzOCdOh7g9jErO+xQBkMjH5GwMlNQWYU4FFcfYHc+4x1IRzYLcAT7j+OaKJ aDBnZpUmy9eRt20BAyqcdXa5cKZaqA0h/iHuxs6afzNcKaFyrvJlPR5cAzY+SNKe7ciw yH6fwlAacmsIJYNuvCBmHtmgeNkiutdWWnp78ah4infygI3+bhjCJsn7z3amT6IavZNg rmlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=I41VxjmZ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g66si417953pfa.331.2018.03.19.18.30.34; Mon, 19 Mar 2018 18:30: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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=I41VxjmZ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934274AbeCSPye (ORCPT + 99 others); Mon, 19 Mar 2018 11:54:34 -0400 Received: from mail-bl2nam02on0123.outbound.protection.outlook.com ([104.47.38.123]:41056 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934047AbeCSPuH (ORCPT ); Mon, 19 Mar 2018 11:50:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BrLlYtXOMcWYd4E0X4uqmbyIz90cmvoYledCMBRlJa0=; b=I41VxjmZpDeb/zBEYhHsj5DyqWq07saHzCG7EmBM27HpxhX2TN6RflxAvTC6vY4tnS4uPu58NWtsM2Qt90+70nF1UyYC84J7u62AD7I5VyVMcXXVkITtLSWTr5cEAFozy/YaGWwcfz0TmHh+jm4THTE2C6zEmTYPFTD8Qw2KwGE= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1109.namprd21.prod.outlook.com (52.132.130.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:49:58 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:49:58 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Andy Shevchenko , Ulf Hansson , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 111/124] sdhci: Advertise 2.0v supply on SDIO host controller Thread-Topic: [PATCH AUTOSEL for 4.15 111/124] sdhci: Advertise 2.0v supply on SDIO host controller Thread-Index: AQHTv5nP3B10rPwBckmns8pOprJYAg== Date: Mon, 19 Mar 2018 15:49:05 +0000 Message-ID: <20180319154645.11350-111-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1109;7:fEHhl+F4tWsyJlDOd+p/B7ZZKx7seg7CUPEDjEpM4QGX7cZ48bukvpq9WRtpzHViuDOMuDB8bVzGB/awkoiXLMv5QvRExpvdn/UwmixIto0LYB0q3ydiQm7K2EMHbIav3mrweepcvLceHwlCVToB/abgeLUn9rr8bLA78qeUMfULkgO3idMlYVBd720lg6EOPKUTJlW0v4J2XvrEUuNrYP4ZP2d8Smmx3DP+q13ZaOixBro8+b5lqINtpuNV9Oo/;20:sjX16C1fMBEB3LYpwG0eLQ/7d+kkOI9s/aJxLv1ParzWQ5HUhk8fLM3yVkvT0+IhAcOeQA4COw1F0hJqsOvpfpXjKaqKeK6hrXaouhWVh+/QcA+cJ5MAxpB2B7b2gPIjh0AFYF6bqfZ/YvCxy1hgAnNERUXz+U2ZmihoiI6XRcw= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: ed542f3a-5cab-4c91-e30c-08d58db11181 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1109; x-ms-traffictypediagnostic: DM5PR2101MB1109: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1109;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1109; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(39380400002)(376002)(346002)(199004)(189003)(81166006)(10290500003)(107886003)(81156014)(106356001)(6506007)(8676002)(3846002)(36756003)(8936002)(97736004)(6116002)(1076002)(102836004)(68736007)(6666003)(3280700002)(2950100002)(3660700001)(478600001)(72206003)(2906002)(14454004)(76176011)(66066001)(6512007)(5250100002)(10090500001)(2501003)(53936002)(6486002)(6436002)(26005)(316002)(22452003)(305945005)(7736002)(4326008)(25786009)(86362001)(575784001)(86612001)(5660300001)(2900100001)(99286004)(54906003)(186003)(105586002)(110136005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1109;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: J/ddDjkSZCtsA4MYCVXajGjg3iZDA5ErcHl1yN8QWDmLUyGH8sfbmIrWxFaU9jEeBTlDQck3P2xvjTe9LdWJszg3A536KTFivPOeuB0DR8Wrn48VcYu30mVxDOkiMH4CA1bmKj9w6//kxubI+k0FKy5dlyOUnwA1QAYx5yhGihGCmEcmr7MM8oyU9rlVVsZEjAW/lMqtXvLxVjFCDWknQQk0uqNG5XiBBkqWGWlYJnUcBSQrruYnCZgO54Ye/QwwQv642OCztoI1HOP1rMl84cpXzSmMlF8S1AlEZGCYPHoi2GCzSMwcQ1x+rbTGrQdrXf83mLrA1sJjHw2nH3c25w== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: ed542f3a-5cab-4c91-e30c-08d58db11181 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:49:05.3584 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1109 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/mmc/host/sdhci-pci-core.c | 2 ++ drivers/mmc/host/sdhci.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci= -core.c index bf93e8b0b191..b8fa17a759dd 100644 --- 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(struct sdhci_pci_= slot *slot) slot->host->quirks2 |=3D 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 =3D MMC_VDD_20_21 | MMC_VDD_165_195; slot->host->mmc->caps |=3D MMC_CAP_NONREMOVABLE | MMC_CAP_POWER_OFF_CARD; break; diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index d24306b2b839..3a5f305fd442 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1470,6 +1470,13 @@ void sdhci_set_power_noreg(struct sdhci_host *host, = unsigned char mode, if (mode !=3D 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 =3D SDHCI_POWER_180; break; case MMC_VDD_29_30: --=20 2.14.1