From patchwork Fri Nov 17 11:31:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 166133 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp461600vqn; Fri, 17 Nov 2023 03:36:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZM3aDpuPdVuQ8UvbV2q3Asv3J1CQpMvegxDxjFQYovaWWg8cgwXBeia5E4G1uNjHSAKAg X-Received: by 2002:a17:90a:72c5:b0:280:1d67:16a6 with SMTP id l5-20020a17090a72c500b002801d6716a6mr20896783pjk.34.1700220992656; Fri, 17 Nov 2023 03:36:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700220992; cv=none; d=google.com; s=arc-20160816; b=BdMauMILpI90IJ9j5JskXYTg+XF91N0rk4stVNfaxz6+wlGGHaaKEtlLmoavBd5lHC Bd4DRgRTmcDl6bB5IUAbelFKSlkWlnlMkEpumnOAENOEep/kp682dU5Z3VaP1o3RmoTS gG72gd1qORQZw0leoLElz0QRg2pq9gCcO0veWZzNatHBQRPbrYZnCNMgn889GAjCRVxv 7sz/f+F90ZH3WGOTc/GFRdR7UJ8SdJL/Y49TtHlFZ+MH0Fu3CtTXXnXa2lhuE2wEICPE 4j5DTVRN4/0YMFwPbfTt8ZW/MDd3NooXXd3ZDnqy6IsLv65OsoBnuxeSW4PSnx0GpxSN nfBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5MEzikBOSI0IzLimKwIxezna9qhfNLGyuWYtUgFehms=; fh=BYTnePkxB2rt5d4Qz2+JKkABGjvViCq4AUS9O+RAbtQ=; b=JgNKKTDl9YDdSpZtbdA/8BPSd2lE8f1yneEdxtW6zC2VN6vU1mkDHcGmwMyyxjV61s ugG3TM1m4NUFDqq0J8FsaryWFKScXZVr58d/CXzeHVS/x8izlpOgtkeajlpMbLSvaNml Y8IEnIJUAvi0LSOQoqBDDaNCx5fr3uRPbU7QjIXE2MnhyODEjqmEoGprpTrhmjU/tNhE 2q8HWfYAmtFK/8aUCfbWBVDK2hmeMAMSTNEsm4ydMl+z58dyYAw1y18VAZMJpEXQGEq8 6PotLNdk1acMStf7dybvgp+Z2P5K+jG6qrkkqYQLnkybZ+W3oPa3LE4oHGFFoxJkm4VJ Umsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HfAyo4rG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id a11-20020a17090a480b00b002741e78e66asi4173806pjh.153.2023.11.17.03.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 03:36:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HfAyo4rG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B729C808285C; Fri, 17 Nov 2023 03:35:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345804AbjKQLeQ (ORCPT + 30 others); Fri, 17 Nov 2023 06:34:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346165AbjKQLdh (ORCPT ); Fri, 17 Nov 2023 06:33:37 -0500 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A997D2126; Fri, 17 Nov 2023 03:32:59 -0800 (PST) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6bd32d1a040so1875461b3a.3; Fri, 17 Nov 2023 03:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700220779; x=1700825579; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5MEzikBOSI0IzLimKwIxezna9qhfNLGyuWYtUgFehms=; b=HfAyo4rGyUqKvsQlUQuijZuEmC3BqHVaYyCaiQRK34fs9HgEInocMuStgMn5mOfPOI FVSGPjoT4rMsDxQQzWOOX1UcHrOvfDpg+TPEBBZPrKOjqHBXsyHc/2SYGi9NmoS3jdoW 66MQjfwflxaFJJ1nSgraBsOU9ldw+8CiV+D9TOWLunHktHNrHhXpB2SmSXibQo4YoKTA O7uBIWNezO3KO/ddYGYWdOgHU3I9+pYp8c5nkhwxh92FmK7wuYPyhozmrSGIAr1NrCow XHAS+AzgqIUCI2JhN4ytlKY8zqTC6Er9cHY1VH7MZyzZwxDXMYgXbSfdApenKUgBSRBF 4iUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700220779; x=1700825579; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5MEzikBOSI0IzLimKwIxezna9qhfNLGyuWYtUgFehms=; b=ThlWim20AFE7t8SJrDGPDJsuQSwBFph8ZETR8uslrzv7QXzgvI5OCDF2FV1uUOlT5Y 53s9CqgRSVd6mUHkvKW7Kw0tDwGryRIjXaOYJcOFPmjFjRwmS2JlLb1jsZgytdAloYgQ i+6e7pU2n6KsYpRrTWd5OOGend64PRDIUeEOu7gHq2bPAhgzUoShSjBnHejsaIMMwanV RRAFs47XA9td8WIMVW51V0pP/ADDuKWjggOE5LOLcaxE6fTFJ4R32eD0HbAdNu2yb1vZ V8MsaVW+coh0o9J29ITDFko7TMouf8vIhMt/7TJ1/NTFmJpTINiwEJ9bqWKDltzOBgpx wIog== X-Gm-Message-State: AOJu0Yw5LrP/aHZsDu1ShazCO6hS8V6/hEY5/ZXPWd/qV60M+VtqNzTW bouv9XPF198tL1ZUizuBV+emYUjYWcI= X-Received: by 2002:a05:6a20:9144:b0:16b:e46e:1246 with SMTP id x4-20020a056a20914400b0016be46e1246mr22488201pzc.30.1700220778716; Fri, 17 Nov 2023 03:32:58 -0800 (PST) Received: from localhost.localdomain (2001-b400-e286-d458-bc89-d4cd-bd42-ffb5.emome-ip6.hinet.net. [2001:b400:e286:d458:bc89:d4cd:bd42:ffb5]) by smtp.gmail.com with ESMTPSA id u2-20020a631402000000b005b4b70738e5sm1229224pgl.8.2023.11.17.03.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 03:32:58 -0800 (PST) From: Victor Shih To: ulf.hansson@linaro.org, adrian.hunter@intel.com Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, benchuanggli@gmail.com, HL.Liu@genesyslogic.com.tw, Greg.tu@genesyslogic.com.tw, takahiro.akashi@linaro.org, dlunev@chromium.org, Victor Shih , Ben Chuang Subject: [PATCH V13 19/21] mmc: sdhci-uhs2: add pre-detect_init hook Date: Fri, 17 Nov 2023 19:31:47 +0800 Message-Id: <20231117113149.9069-20-victorshihgli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231117113149.9069-1-victorshihgli@gmail.com> References: <20231117113149.9069-1-victorshihgli@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 17 Nov 2023 03:35:59 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782810927478725702 X-GMAIL-MSGID: 1782810927478725702 From: Ben Chuang This "pre" hook for detect_init(), uhs2_pre_detect_init, will be required to enable UHS-II support, at least, on GL9755. Signed-off-by: Ben Chuang Signed-off-by: AKASHI Takahiro Acked-by: Adrian Hunter --- 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 45ff0bfedf3c..e187176b79d7 100644 --- a/drivers/mmc/host/sdhci-uhs2.c +++ b/drivers/mmc/host/sdhci-uhs2.c @@ -407,6 +407,9 @@ static int sdhci_uhs2_do_detect_init(struct mmc_host *mmc) DBG("Begin do uhs2 detect init.\n"); + 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)); return -EIO; diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 1085942d47a9..fb10a26dc251 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -724,6 +724,7 @@ struct sdhci_ops { struct mmc_request *mrq); void (*dump_vendor_regs)(struct sdhci_host *host); void (*dump_uhs2_regs)(struct sdhci_host *host); + void (*uhs2_pre_detect_init)(struct sdhci_host *host); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS