Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3264066ima; Tue, 23 Oct 2018 03:08:31 -0700 (PDT) X-Google-Smtp-Source: ACcGV63BZabrwFZAYTotZdjZ5D9kZYIEAJ4Sgr2w/F30vtAdbRFY6x42SbKOZrjkaZkAElo58Ep/ X-Received: by 2002:a17:902:b492:: with SMTP id y18-v6mr48467991plr.254.1540289311867; Tue, 23 Oct 2018 03:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540289311; cv=none; d=google.com; s=arc-20160816; b=0HUpBk1o4eXPTnSKSEKcXIITtfpsnsf6z8aqAYAEzmNOG8sQ6o89P8ZSwOXar5Zkin mxAYm3h7SfpTv4CztSYrEBgg7d82bGdKjMyJLWMSC6yHfGUJHlS8hql29n0+HIRq1FXv MkN3AOp4mkoo2q3rrGuSNXpkbkVfXgFY7jaypEuZa97zEW/1BT5IO7U+qJVExpHkquG9 OH6xIaJ2+CX1p68gX8HmouXu3zr/JixL2jzWUDX2ojzRh/uv5lzzBqMXObd29RCtoVPm fARP72qYLDsBrcuTWR+sccvWS8LPvtUmKYPV14nJawDoSbjiBwOSe2UvdsOibpgjaSZ1 rGlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=2lGu63PRc1IiqaG5JjRbZANs5k88cp36wl81f1JLXWE=; b=B+UHpsQ+MVUiEZ3okljKl3FObLNGmuqMXIrVDJ163GOZwfAfLeXR1onptMK+uP6r06 TNsCZDsKCkY9UhtJ98gJnSA5qN1hz0bjkhI+B8n4x6064V900t5jZU7I1av3airSM0Bk s5iDszPgYh1eT94Ff7apBR/J0oGWCEddIT1gtlVOP7tFVKBPw/hcQwe1Q2MLW3tfeLTg ZpRsIn05pSDceYOBKQ0NVLAvDUHAsYXH+2dp4kmpJJ8JjOPY2e19BqAcBPvKO1/2yllz VGKFZjrx3dO0UUFNyXOX9VT9Ovl8FenliF9C5RUZGU9cTEZpvny9Rfen5YYnzl8HcC9Q uKeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@astier-eu.20150623.gappssmtp.com header.s=20150623 header.b=SI+biLT6; 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 h28-v6si896848pgb.106.2018.10.23.03.08.13; Tue, 23 Oct 2018 03:08:31 -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=@astier-eu.20150623.gappssmtp.com header.s=20150623 header.b=SI+biLT6; 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 S1729051AbeJWSab (ORCPT + 99 others); Tue, 23 Oct 2018 14:30:31 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:37398 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729027AbeJWSaa (ORCPT ); Tue, 23 Oct 2018 14:30:30 -0400 Received: by mail-wm1-f67.google.com with SMTP id x19-v6so1124643wmc.2 for ; Tue, 23 Oct 2018 03:07:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=astier-eu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=2lGu63PRc1IiqaG5JjRbZANs5k88cp36wl81f1JLXWE=; b=SI+biLT6x8fnzl8nEcGcGde6OlmtnkUzg8dvnvVksAzdfV3opYNiOD5/9hthmqXyyY G+EJ0mb9WdLN2fK9RMvoPODktJoMj7CnvjicmfLWzm9wlp/2r4QTGc//4TMtrbkUuULO pJslCXCzFO1nQO0ghNBRRU6nrKOOXfXUHy64Dp23ZadLdvHqEZWgr61R6eCJsmxIepWF b6Pyjr5+U+vykepG/Tuz83Ar+6IKtiVbgmgOb8ChloXkjK9bzSHiqm884f8fBHhQvfU/ pElvC271Rrz99X/O7mJlB2XzZ499S9jiZ1Rrfnrx//q84ks7coJiS24xSrHITaCw/xeM E7qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=2lGu63PRc1IiqaG5JjRbZANs5k88cp36wl81f1JLXWE=; b=PHVdN25Hl48qfmz48zvtegAmusmOIKCBxkkO00JDY4oGZRQFZf+v1ID0nekniE/LG6 A2yNYCr6MERJ3b/0/V2hOBFKwpUL/0W6dPusowrwCkGrOq8YF7R9Jjd/gQ/FPwOQvWYK W3YOQ4Y6vGF519XCerSAreqrMKMfTPE9swa5vqqoJM9WVwwOkzdwoYYAhx1mD4u/b8Ui ysGxOCjjVOZPdSrUIR+laUMIrBNEYOfUFatlXH1smpnk3JMFp7p0vIXJCWF8phFJM8vb /u7W+IlU4KOMVmTJn2X3BA/fvmHZuMQhGuCtOi43ub3InPT/X0ypckdsrH7/g94+Hdo3 H3eg== X-Gm-Message-State: AGRZ1gJ6TcFYH/ix+njks5DPNZqYRjMxYFRopwrP8E2U2AG5iU53W2rP VBhzhar4xm9WThThuLPvIzfO+Q== X-Received: by 2002:a1c:f518:: with SMTP id t24-v6mr1840374wmh.82.1540289264902; Tue, 23 Oct 2018 03:07:44 -0700 (PDT) Received: from jaya.substantiel.local ([92.103.140.194]) by smtp.gmail.com with ESMTPSA id i13-v6sm910930wrn.62.2018.10.23.03.07.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Oct 2018 03:07:44 -0700 (PDT) From: Anisse Astier To: Adrian Hunter Cc: Ulf Hansson , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Anisse Astier Subject: [PATCH v2 3/3] mmc: sdhci-pci: only install voltage switch method when useful Date: Tue, 23 Oct 2018 12:07:29 +0200 Message-Id: <20181023100729.28864-4-anisse@astier.eu> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181023100729.28864-1-anisse@astier.eu> References: <20181023100729.28864-1-anisse@astier.eu> In-Reply-To: <20181022134026.GB18413@jaya> References: <20181022134026.GB18413@jaya> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If there's no ACPI DSM for voltage switch, it will just cause a lot of debug info down the line, we only need one at startup. Signed-off-by: Anisse Astier --- drivers/mmc/host/sdhci-pci-core.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c index f2c1fb339d66..95fdbb883c7e 100644 --- a/drivers/mmc/host/sdhci-pci-core.c +++ b/drivers/mmc/host/sdhci-pci-core.c @@ -723,6 +723,7 @@ static const struct dmi_system_id board_no_1_8v[] = { static void byt_probe_slot(struct sdhci_pci_slot *slot) { struct mmc_host_ops *ops = &slot->host->mmc_host_ops; + struct intel_host *intel_host = sdhci_pci_priv(slot); byt_read_dsm(slot); @@ -733,6 +734,16 @@ static void byt_probe_slot(struct sdhci_pci_slot *slot) mmc_hostname(slot->host->mmc)); slot->host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; } + /* Check if we have the appropriate voltage switch DSM methods */ + if (!(intel_host->dsm_fns & (1 << INTEL_DSM_V18_SWITCH)) && + !(intel_host->dsm_fns & (1 << INTEL_DSM_V33_SWITCH))) { + /* No voltage switching supported at all, there's no + * point in installing the callback: return. + */ + pr_debug("%s: No voltage switching ACPI DSM helper\n", + mmc_hostname(slot->host->mmc)); + return; + } ops->start_signal_voltage_switch = intel_start_signal_voltage_switch; } -- 2.17.2