Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1778978ybl; Thu, 9 Jan 2020 01:17:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxsCVZYnBODbrmV9FEMHBfktlu9Q2ozuyi5xVrN715dK3hisvTIg0jXB4m0p5ohrmX8k3kf X-Received: by 2002:a9d:750b:: with SMTP id r11mr7955342otk.209.1578561443522; Thu, 09 Jan 2020 01:17:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578561443; cv=none; d=google.com; s=arc-20160816; b=cpFvkclMSaxr58iBXewNx4+yDnXfOeucbvoClBWrU1TnCpBD0XEevnZNXSbbss8QBi ATeic1BAQut0PQLgbg+Bss2K58Lo76nCnotJYIuDs/KMR0O5sWXLmtv3/5UFG9qIzdK1 BJH9Zes5e6oxlnOr0CWQ/Wkz2OORJNR6Sysi8Jie0qwykBVmE3qU+99R1KpEB6HJx2jf Nzs0prXO+1WkRknOKTL0mbHUOjHL6ehaopLijDV0zzxNZnRTOqC2JUZJVVmB6FXy7Di8 jEnlTYg++Bb/EHueWKpq3kmAJGjaLNIErs+jEYTQxmPoWw5fwY4VTbi3UUWpKtfC60EX Xijw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8Rg+d621Q/DEet6hos9ceAjmVBZFRndyzgA44fX7sKI=; b=Rty+dQ7XtA9PcvxqJoiRi+8dCHNJwM184lTmfRQ45wJLmnMszjtbBbngDFXSqw/1fI XSpSyG6OA/lnjm98MZK/16knmBd+xP6+6oQYmG7vbKf5ukOhISJlNfUrDyIxISY/COVC oQf801fvyvRHFYNDZRiLKXMSi5HV08/casHgO9jkyGQLfuSKY+YeSKI5WnQ1LsUP9oJi 8Pell6ouITsG2DwDD6WttwOB8bSEWfFMp/SJfaH4A/dXXDOoIo1HTzHY7199WFPsx2Qy c884/edp6xXdQFXuKlTmvpsQxuT0Ixnquv+T6EJT5l6J9Q9yld4VHfP2IO3Qk8ibB5N5 DBug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OpQlpHWD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si3703053otk.221.2020.01.09.01.17.12; Thu, 09 Jan 2020 01:17:23 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=OpQlpHWD; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729297AbgAIJOn (ORCPT + 99 others); Thu, 9 Jan 2020 04:14:43 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:35077 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728946AbgAIJOm (ORCPT ); Thu, 9 Jan 2020 04:14:42 -0500 Received: by mail-pf1-f195.google.com with SMTP id i23so3094906pfo.2; Thu, 09 Jan 2020 01:14:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8Rg+d621Q/DEet6hos9ceAjmVBZFRndyzgA44fX7sKI=; b=OpQlpHWDrQ3NowQTMT/QoXrY3uIcc7RTD1EZW8f+XFj8/fmX2zLuOzcNqFRwiISeXv HC0WoVXt8Y3Xa/j7bKs8253Y9BAk9TjRb9U4j28DA5XIZcrL8i3WFQH6wu5YxSyMXyr+ c7FgYVZWTxtxZlzt7mCYoP5k6JObo68X1T+gIXDiHLYs/4Shc5QfF1DW1MVRHekqP//d lMlDssGiLYv9bZOOFcaGw4aulmS0Pmc/PDLUUj5rGb+BelLR8/uCXvnp+Xq3ZxQ0V8Lg 5LRbWCzZaxR0K3IVXpIy1ZjEDzbQwF3sew3rUQzbiZqIiYUTXUbw3e9DYTBSKJgNFZNM +M5Q== 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:mime-version:content-transfer-encoding; bh=8Rg+d621Q/DEet6hos9ceAjmVBZFRndyzgA44fX7sKI=; b=qWUwHLDSmc6gL0eIKRzNIGVq/p35a4Qbh5GGgvnUuEaTazjupKjQniNQuZGU/JFu10 sfFHPkAIlUV1Wh/PARhBfJhrKF2DAZKb438XzuqaAU1N/0KdjDCMiBNSorZ95V8bAard 2sjPr5J9P8a0n5Zo7Od40No1+vkDLidwRBS17YRIWiY3CocfpdIJ5mhAjnNQPrjyOxpP hQinqZ8Anbmc+bQCeVE6L6BFOcuz6NTxZgdxucAIZ9OyQVmC5tqIf8Rk6C7izH427uZh j3qDex0O++y2Ux8RhI/DZ04XqroYw2sgaQ6h0Va6FfsxlI1zbwT2YugKZ9MQvW3mm6sS q8+Q== X-Gm-Message-State: APjAAAWfLG0bzr3vqOTAbA3t1jC6pKK93GHQvIED4zFhTcj/yMG5cYIa gTxL4CsaygES31M1RNr5BdxhNIvh X-Received: by 2002:a62:78c1:: with SMTP id t184mr9908265pfc.222.1578561282121; Thu, 09 Jan 2020 01:14:42 -0800 (PST) Received: from gli-arch.genesyslogic.com.tw (60-251-58-169.HINET-IP.hinet.net. [60.251.58.169]) by smtp.gmail.com with ESMTPSA id x65sm7380180pfb.171.2020.01.09.01.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2020 01:14:41 -0800 (PST) From: Ben Chuang To: adrian.hunter@intel.com, ulf.hansson@linaro.org Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, greg.tu@genesyslogic.com.tw, ben.chuang@genesyslogic.com.tw, Ben Chuang Subject: [RFC PATCH v2 5/6] mmc: sdhci-uhs2: Introduce a uhs2_pre_detect_init function Date: Thu, 9 Jan 2020 17:15:05 +0800 Message-Id: X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ben Chuang Introduce a uhs2_pre_detect_init function before detect uhs2 interface. Signed-off-by: Ben Chuang --- drivers/mmc/host/sdhci-uhs2.c | 3 +++ drivers/mmc/host/sdhci.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c index e9c42894185a..9f53b7b938b9 100644 --- a/drivers/mmc/host/sdhci-uhs2.c +++ b/drivers/mmc/host/sdhci-uhs2.c @@ -506,6 +506,9 @@ int sdhci_uhs2_do_detect_init(struct sdhci_host *host) DBG("%s: begin UHS2 init.\n", __func__); spin_lock_irqsave(&host->lock, flags); + if (host->ops && host->ops->uhs2_pre_detect_init) + host->ops->uhs2_pre_detect_init(host); + if (sdhci_uhs2_interface_detect(host)) { pr_warn("%s: cannot detect UHS2 interface.\n", mmc_hostname(host->mmc)); diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 7f779ac81931..08ee4c805474 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -906,6 +906,7 @@ struct sdhci_ops { void (*voltage_switch)(struct sdhci_host *host); void (*adma_write_desc)(struct sdhci_host *host, void **desc, dma_addr_t addr, int len, unsigned int cmd); + void (*uhs2_pre_detect_init)(struct sdhci_host *host); void (*uhs2_post_attach_sd)(struct sdhci_host *host); }; -- 2.24.1