From patchwork Wed Oct 19 11:06:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 5266 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp275363wrs; Wed, 19 Oct 2022 04:47:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5xzyTzX//PsWf532H1D5/U30rUOufO+R62DIfrQbgonam8khS7Pi45m3mCeeqXXZFLPMl8 X-Received: by 2002:a63:86c7:0:b0:459:437c:ca90 with SMTP id x190-20020a6386c7000000b00459437cca90mr6982836pgd.33.1666180032311; Wed, 19 Oct 2022 04:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666180032; cv=none; d=google.com; s=arc-20160816; b=xcrKe7u/+0/YKmJyI5BrmjLXDYDkhutkZjvRGYOaZm3RwBKZYeKoJnBF+8epkC4VDp vkjIisXS4YlTspjvFj0JrZuLAXhcVwV6jsu1gIQrrpHfqOCRzCnxlTqOU6+lEj7j/GW/ ypE8MXyzGT/JmCVLsESpzgYFcDlBOknGimXSrcIjYr/nRCtYNThGq4nMGJkWDuy/9/mf zxb3eK94J/UErk2G8perCHESZxSDgjRndz1ox7M7MB81w2hwpguEw8xNoSaWycge+VwA D/vpsdqY6Rz7uItBndLYkCuW6o/Utbj3U0QQ52EWgpka7VQgQe3YSfXTEK8p3yAtRf3V B/5Q== 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=sxU0Pte3GePSANg5TU3silLJgxesK1rl/+ZzUZDDvz0=; b=LvvS57dpB9hkBZQmkd2NAvIEopOvBA79JwQEpI65KD9eqKDGFcGM1zi7fV6UMN/LRg xbOxqx5g0/L7U9/6CcCQYOtRZa4Z86xiBqSHWW2XfULiTZdd5idp0gDYjNUirWppsKop maw0H+7VhatF7+cH/UbpQKhK4YK9bb2bp+jeRv6rzUGGfFQSB3pgqWLOBX+ph0n1mKd7 KtngEHo437X40X8ewfGNgtkAUK2itJ+KoJTxCt7linCbGSaFaSKD0BA/hZjdrGGtzW6s 6MHoh+P8BgPDBWdNm2yW5qyXAcW7mYVBP89fZ3rJ+FPwqc6lUIvBNhn0S3zPtRtf22lX 59/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=p5txpMdf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cm9-20020a056a00338900b00563aff386fdsi14566701pfb.284.2022.10.19.04.46.58; Wed, 19 Oct 2022 04:47:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=p5txpMdf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231566AbiJSLnp (ORCPT + 99 others); Wed, 19 Oct 2022 07:43:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231709AbiJSLn3 (ORCPT ); Wed, 19 Oct 2022 07:43:29 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4F41EF5A8; Wed, 19 Oct 2022 04:22:53 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id g13so9002916ile.0; Wed, 19 Oct 2022 04:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=sxU0Pte3GePSANg5TU3silLJgxesK1rl/+ZzUZDDvz0=; b=p5txpMdfiH3pG8rWpVewgAwDfUIrxNY2QTotH2LxTawh1Dfl4FDKHJfTSWj+y0JXsE NQ7aTgtz+d2vEoESFKOSfZaUMsWAG1gPD4Uoi4xRnN7/iVPT+sIHi5TS2Yga4Iosluc/ iAcIkoDMngCEBKL6pu45co+PRDIkyB/vCiZVFGxfVjeH+sU/BR306pLgWIucLw7PFIUL 2u/jDHUYIoEu/jQicjpOzYPWksBk6lADXy0dFuMuGQG3AqK175YsLrhmkge6jDuKBDiR 8zjvxAWLrNj+sk4eRka5JKOtlqahmiYoucnj2H4ombGAsbus83pHw50rGYaz9vogQRjy +NSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=sxU0Pte3GePSANg5TU3silLJgxesK1rl/+ZzUZDDvz0=; b=4yVQKXCpjYCkhdYSkf4jktJXjnuZceK5dxtZGV26leSgGW2TmxSYq6mzpQC4NWleW5 ChPpuXG01VxBCRSLUoBAYE1BIdfiNM52FXHeTrOqGhYPDV3AUyoElPddPN+2sQqdiRE9 aDVXsc/66b8/M3qacNYpxxyMuQ2VyB6grq4n6uDUV2D6oUQ/lHl/HmE9hMYAJjoyKWlB j9O7LTlH6QfAnxXbPlRJ81kvV3/yH+75kh6iPf+Tv/jDrE9sf41avLYUSKOZfD29HTPj B6FI7F9Bm0bIrnGs5pw2RDI712xM7/sr293N+MfZ2AmFdVZELc0YJVqbnh2aVag384sS gZZw== X-Gm-Message-State: ACrzQf1O3J3DVvB+AZiBFaJ40Njd4Pq/J0eaMnSupQrFnha6EOlxIACI gbzFGP/MWeKslqncspgmbdkMnEH4BsY= X-Received: by 2002:a63:1d1:0:b0:43a:348b:63fd with SMTP id 200-20020a6301d1000000b0043a348b63fdmr6907980pgb.52.1666177684377; Wed, 19 Oct 2022 04:08:04 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e258-8c34-821b-9613-557f-bd8d.emome-ip6.hinet.net. [2001:b400:e258:8c34:821b:9613:557f:bd8d]) by smtp.gmail.com with ESMTPSA id cc11-20020a17090af10b00b0020dc318a43esm8696225pjb.25.2022.10.19.04.08.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 04:08:03 -0700 (PDT) From: Victor Shih X-Google-Original-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 V5 22/26] mmc: sdhci-uhs2: add pre-detect_init hook Date: Wed, 19 Oct 2022 19:06:43 +0800 Message-Id: <20221019110647.11076-23-victor.shih@genesyslogic.com.tw> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019110647.11076-1-victor.shih@genesyslogic.com.tw> References: <20221019110647.11076-1-victor.shih@genesyslogic.com.tw> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747116393606668922?= X-GMAIL-MSGID: =?utf-8?q?1747116393606668922?= From: Victor Shih 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 Signed-off-by: Victor Shih --- 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 eb3241bf95a2..212701267d2d 100644 --- a/drivers/mmc/host/sdhci-uhs2.c +++ b/drivers/mmc/host/sdhci-uhs2.c @@ -1542,6 +1542,9 @@ static int sdhci_uhs2_do_detect_init(struct mmc_host *mmc) DBG("%s: begin UHS2 init.\n", __func__); + 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 0970fe392d49..97728eee5b25 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -743,6 +743,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