From patchwork Tue Jan 23 06:28:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 190745 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp153417dyi; Mon, 22 Jan 2024 22:36:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHq1K7CDlL7ntMmXfdYRBOJq80nbZ9hGmE15HqTTCbejBS39q78c/qGmw9bKjfT/lVTsL7f X-Received: by 2002:a17:903:2452:b0:1d7:37e5:a565 with SMTP id l18-20020a170903245200b001d737e5a565mr2538622pls.34.1705991781157; Mon, 22 Jan 2024 22:36:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705991781; cv=pass; d=google.com; s=arc-20160816; b=VIgDyVsDOv1cHhCSD1R4dqXhpIQKkvgmkWmYF0saH6wk0oJmJ3eCiRabOwz+RrJ9wx fVAQdsJIRhoa1KCAAw6dhoSmb0ZT9uEBLJgcN26DOhctq6JbSU04Q1o3wwEmAswp2mK2 uMD4C+hV17XOof8qyQrKZAeaYILGL1wSGHU3zUncc2aotBQ9sKHXgXMMtL4cyYVdbMGx GCfldM0yWOJqXx3E7XvjjSNZy/sxa8+tvDxIYxHZz8i4yOrFgdNkeumLqkh/MnT//kmY EA6H6L/7Re5WsebStE7otfv/PHSkvZcJkr+zCIiuFpasHIcMbNTEmUm0CZe41ODXDv1W QQ4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=zfmMQ6q+Rk7UQCSUv/GdFILmuXL5VoDA33Tjpgxnrs0=; fh=BYTnePkxB2rt5d4Qz2+JKkABGjvViCq4AUS9O+RAbtQ=; b=BLrtSHlUf4XgoEFoD6UMyVMrEZWB11CRFG9LhW7Yjp6ilQGjh16KjIM1aC9TXoT4nb ZeFvW+K372kFBLho2N74Dj/bhfo0y1lxJLYQEkDFeEDFaXPEzB5YAouFnThHNAlE3Bdk aEm9URgJVP1dZ2S0ZB0zCucYajaRWUDFvU9eIWA1RgSCElM2L48KUlD85KKIs1GxBWSc WvZmnwKjzeQ57CoWuua5LCZB/0ljQSrSI01X4IoP80jSl4FHNW1Ytqivs/nWOmEvtLfJ 9+wds3ccGfFg6S1MJktO/fFtu/S6Ij3HkAotADWIFTX1Mz8Bm25uGLf6n4r9lhzfNO4e Yf8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CR7cpByZ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-34789-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34789-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g5-20020a170902740500b001d706584f5csi8925405pll.574.2024.01.22.22.36.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 22:36:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34789-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CR7cpByZ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-34789-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34789-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 9B5CD281B57 for ; Tue, 23 Jan 2024 06:34:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5EBEE59B71; Tue, 23 Jan 2024 06:29:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CR7cpByZ" Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A9D559154; Tue, 23 Jan 2024 06:29:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705991385; cv=none; b=UeZJ9ONuRUiWGMXYcEL/VqEFpvcMAodYUyOsjiGnZ0lD7H1LqD1fMAz9K+wR2BC2hgFDdSLvEDSxyrOOnAqFZTdjafc9WP3IEBfYYp7U1tXEkINtnMe/5HE53wryp9o55HWN8mgVrK+YZJKZjTPfMuMYi3olXTzJc/K0w7LVv1I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705991385; c=relaxed/simple; bh=IiUyY278CqVxfhgKrqP9nTOWuIkaA6ZM+n4Y0G/wGAw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YZ+tawNg+uLBvyU9OtTCitCrx6Tl0Ybn5TEEw/HwvLHeEdKpirtKMfbJuHvcYjQbKMzoQiv3V7fJI1W2H7C23FDHBfypzmJJbWk9ebkFos+bCWvMI3MJOOWJNBlLy9OWOxE2ZguPueJeIWNk8QLNbvLlBLoac0KX35ggqJiIbhA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CR7cpByZ; arc=none smtp.client-ip=209.85.161.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-59502aa878aso1771772eaf.1; Mon, 22 Jan 2024 22:29:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705991383; x=1706596183; 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=zfmMQ6q+Rk7UQCSUv/GdFILmuXL5VoDA33Tjpgxnrs0=; b=CR7cpByZ99k5pjRO9CarcL4cC8YLurUvPKp1byy1poviOIPghKcuu+2gyXdxJTFLg9 BBuRQwyPHoeiZFs7GPtK0lUnRlsmuvdq/0a56zJGt3brIJTX6oM8v4L/t9rhIR+Xv26s iWWJasRw7ZJK0KQVOXgBFPDEWLBs+WO1+TOKoJ8PCJH1gP+4OcbssZIn3o/um3mECEuq NImjx9ppJ7c3pDLZM6x/vdJNmKvBdCYKQPi+XCOg4ndzPWYOE+luU3aXoKfo0rgoyROq 9PRS9YttOyf5MHDS2JywH/Cf2ZunNHo3kKu95ct+eSUSL/gvg3/oRC/+FPCgvlSCAn7y Ie3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705991383; x=1706596183; 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=zfmMQ6q+Rk7UQCSUv/GdFILmuXL5VoDA33Tjpgxnrs0=; b=oufdt2HY4G3uEnIYmqwqkFiURplb9+OgwVCc+OzjnABhV1VBb1xYTZMldXBlK1gR88 l3WDhugPBpWVlfczJjG4pdMgwevphjD/T6fl+c36eP3W2SveGjVvLtpbmtxUPRGRDv9R bWlSVCtipK6oP9wxYAaHOKm8g2aEEccQ1ocoVMWhu7DvCg2hDBnACpio5w4SgSdv9f6C EEPYf0uequ5H0UBO2ISZWe+LeuFD2CKIfujuVPR10+pefgBEFPe9LGyR4ru1bDlK4Rbd vLxa4czHmhSYWNRVfwBl48tVywzZAK+sx2OT9/6C5IlQ2YSK8yKsCoGw0NJ5l6X9WCna fV+Q== X-Gm-Message-State: AOJu0Yz+w4ddfpfPmOdH/2UEeFB6l8C6UOSkfABO8V6IUWaxcHb7rEM4 CgPH66O6fTlnZryiRUnp0k4+vTP5lo5xQctkfIhFGwlREC1PxynM X-Received: by 2002:a05:6358:d59b:b0:176:2d73:64c2 with SMTP id ms27-20020a056358d59b00b001762d7364c2mr3479548rwb.16.1705991383314; Mon, 22 Jan 2024 22:29:43 -0800 (PST) Received: from localhost.localdomain (2001-b400-e2ac-a4c6-7d2b-d8b3-ed27-1f50.emome-ip6.hinet.net. [2001:b400:e2ac:a4c6:7d2b:d8b3:ed27:1f50]) by smtp.gmail.com with ESMTPSA id l10-20020a056a00140a00b006d9b2694b0csm10595188pfu.200.2024.01.22.22.29.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 22:29:43 -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 V14 19/21] mmc: sdhci-uhs2: add pre-detect_init hook Date: Tue, 23 Jan 2024 14:28:25 +0800 Message-Id: <20240123062827.8525-20-victorshihgli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240123062827.8525-1-victorshihgli@gmail.com> References: <20240123062827.8525-1-victorshihgli@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788862038103029367 X-GMAIL-MSGID: 1788862038103029367 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 9f82dda93733..872ce3b767bf 100644 --- a/drivers/mmc/host/sdhci-uhs2.c +++ b/drivers/mmc/host/sdhci-uhs2.c @@ -399,6 +399,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