From patchwork Fri Sep 15 09:43:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 140470 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1087274vqi; Fri, 15 Sep 2023 07:27:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYSRTmmLJQ5sNxmhPDE9VSFBzW/u6jRud3X/9W9VgEUKgM9NoywAH6/sPou33EWiTyxK5v X-Received: by 2002:a17:902:ce8f:b0:1b8:c580:5fb9 with SMTP id f15-20020a170902ce8f00b001b8c5805fb9mr2212361plg.14.1694788046918; Fri, 15 Sep 2023 07:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694788046; cv=none; d=google.com; s=arc-20160816; b=RToaYRn86P/Skl578pzM/AtBM/Yv7rhkijviapuiI5YK0BG/L1A1T4Lzpx6TEtw+k2 nP19VTYY31f/sPJTHWgPnwXz1xVRvvrQespgQmx/4MLfJ60bkpbgp8uWSTH2MZeBQmJb elUvKC9u4Ylb8+aCMKkZxrITCdOJDejND/oPfWZrMFYusU4JPd8kLV9+txOkIYwolAOn xAAkB4hBOQ95Z+7w+Mkujc6HSWqtt8JwSOmRqKPiWbiMyAUAWAXbZq0OkXcUhRio0Vw+ UUQkrOgegiiZsh6e3ecHoqk/f13jbrNoXrN/CARowW7sOl2Tffi40dsUgqPxsvBejHHc AM3Q== 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=I8s+ls8Yw6NMJtaPKq6UHyd+YkBQYdgGHT2EXOl3gig=; fh=BYTnePkxB2rt5d4Qz2+JKkABGjvViCq4AUS9O+RAbtQ=; b=F5KmfJVFwNoHXJPdJYFSVX1fW3P9pAvnBN5LVB3c33rbEqOm+0EprYDi+ECgXLyWyD rMbDCfFoN+UdeyvDgbab//sCMcZJuuklLh3CmdTJd1YMWQbG9/ln9O5/42raaFLC4SRU 5H1GfFv1aNdwitTJNvT5dwcM21BR/zntJuNclsz0X8HJkyWmyEf/pfmcwIOLJPgj1Dg6 7McYBpeJwHLEww+RBJYLdPmv2Mt7QMu49eiFGuRo+FGcxLMq66YAZloX/+Q7J99DXsiR dhPush9LR65no8zHRj+WKmbXqnAd5QQQ9hL+C8eVchmluspSQ4oI54iLFo/7ucz3rDj2 Cplw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FOKspa50; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id l8-20020a170903244800b001bf5c12ea06si3653625pls.404.2023.09.15.07.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 07:27:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FOKspa50; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 6CE218410260; Fri, 15 Sep 2023 02:47:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233868AbjIOJri (ORCPT + 32 others); Fri, 15 Sep 2023 05:47:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233866AbjIOJrh (ORCPT ); Fri, 15 Sep 2023 05:47:37 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B1923AA7; Fri, 15 Sep 2023 02:44:57 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1c0db66af1bso15040415ad.2; Fri, 15 Sep 2023 02:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694771097; x=1695375897; 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=I8s+ls8Yw6NMJtaPKq6UHyd+YkBQYdgGHT2EXOl3gig=; b=FOKspa50HhSoe2yrFF0QK5naXLp/k6uGrVR89+mc1ShxWvvjYFcCgU7oYvFTPmCGM7 /x+5LjlWBvpgKN8Ey2CWeWHtHj7RnOKt0sC6coQvpu9z2lljIGIb/Wz6IeXTjovIWKNI 3rT6Li6IhRNYbw0mAojWk6dGnXFHW481fnnJNvQIXC783guMK7sTg4u1XTdfY6J0n2zb LcOf/FPyJ3zof28cVXMeEXq/9s/goDNFewmmhIsShutHdQ/AFChDRcRPmazgYkFK830p zcy9KNbRwoZ4X7AzW817yPHVJGS7MVPMmrlpQnbU/WJAlxAEOMJPAHtoRtV8KCdUjV7l ljvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694771097; x=1695375897; 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=I8s+ls8Yw6NMJtaPKq6UHyd+YkBQYdgGHT2EXOl3gig=; b=hcLpsrPm+WNM76D2ZAwsgZzItIU8CoxzSaVoHGpSAldMcrfg/M7RGBPW1PpYahaoBZ F+ZQ3Rui+zkK9il9xcUhLzJV2KCMzfiYOjDwqQzuYLHw2RQfQUl8dFYZhyJTdbFl1ckF 1p0U74Qc3Sax/CIjz9HgUKsI54x8hfVqIb+lbx9jqu2TRqBB0FdOsKep6j7IGFktjNV9 RLR5UYUCM3TbWsY9MUBsWtw1y9MQPSk47bt2N5xlqj+bEeNg0EcQ5187449V4jUEEsUx 7TL3a+MYK+GmrDk0SaaN/1T7bZh8fIqpL7AcRQckxivPW6lGWFDE+kpjx+b8q7uMRI8W 7H3g== X-Gm-Message-State: AOJu0YyegsXLvJI+XwNbFKNIeM41Vgz89S2JcuKa4OFxtZ+bhMcpYR8d SyVP9+I5W5DszafgfuLq5xc= X-Received: by 2002:a17:90b:1e10:b0:268:4314:2dc6 with SMTP id pg16-20020a17090b1e1000b0026843142dc6mr932807pjb.37.1694771096797; Fri, 15 Sep 2023 02:44:56 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e2a6-6d77-d32f-f490-6688-3d32.emome-ip6.hinet.net. [2001:b400:e2a6:6d77:d32f:f490:6688:3d32]) by smtp.gmail.com with ESMTPSA id x4-20020a17090a530400b0025023726fc4sm4432794pjh.26.2023.09.15.02.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 02:44:56 -0700 (PDT) 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 V12 21/23] mmc: sdhci-uhs2: add pre-detect_init hook Date: Fri, 15 Sep 2023 17:43:49 +0800 Message-Id: <20230915094351.11120-22-victorshihgli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230915094351.11120-1-victorshihgli@gmail.com> References: <20230915094351.11120-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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Fri, 15 Sep 2023 02:47:56 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777114071333693269 X-GMAIL-MSGID: 1777114071333693269 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 add0eea55b24..517c497112f4 100644 --- a/drivers/mmc/host/sdhci-uhs2.c +++ b/drivers/mmc/host/sdhci-uhs2.c @@ -1267,6 +1267,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 5235f2da6568..300108cc255d 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