From patchwork Fri Aug 18 10:02:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Shih X-Patchwork-Id: 136140 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp2049614vqi; Sat, 19 Aug 2023 07:27:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGulKbF3wzb476T8OsQEuCDEf2mSKoaEyybasF1IdcHmmYaSwaoxNDh19eRIq1/jQUlTi2R X-Received: by 2002:a05:6a00:24c7:b0:666:c1ab:d6e5 with SMTP id d7-20020a056a0024c700b00666c1abd6e5mr3106779pfv.16.1692455220823; Sat, 19 Aug 2023 07:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692455220; cv=none; d=google.com; s=arc-20160816; b=U20/SoEdpRvEscyCeXkGXGzb7JOqRORT/KMI47RURbWgThNM/ZWdG3MBDpcFkoMC35 XsHGZgRXsTayCHdsdbm+UjMWF7/wW9GWLPQ5uCeQyIXq4/DP78seimVrfPas7KGn1qBo mcP6JCm1ZbRyUL0wU357i0aUP3ROMY0C2Pch0J5TZN/vaUpTlHLk4eVli9lv5uroNVDT IM+FTJMqLtJQbVPBSkR7Im9hKgOIWYtGOUIw8SItxQ7EK31g6U/J387a70W1ljL/lelj RlsStnZXaOH7hWA9KuL1IpzotHXIkkTkEDV/6ANIB81nvqPEwkxFtO1xfq9807tiYnux QO2w== 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=Ei7XNMDznm4gQAPUvGl27pd9IQStOyHk63FGnzmJMW8=; fh=fI4q009785iZEQbMo9mPiCtk2O+O6Kfjq5womanK3eI=; b=Gsgv8wF6mLEYVrqrXshMm8gw16kQzPvKa5xzoYRfSouolnI485jQjI7B2E0B76GWIq TMVcLmKA0ERZmfUtv6lQ/1oLDOHXBhGE72qs/HP/Qbgu243j1deY3Oyxgc/zxWA6mdud w/y8MkfU2W3OeZBjtOAiSVEWg5qmAX9uFh+Ol64nzdKu3ZUJcld2p93KAVg/a8u7rIXc lEie09JDwV7bFLSiaC2Q24bIW7mZzXTMzA4bPnGDGYC0fCIXX+TQTIxxhomdCTWxkDzr 6dfcyJW4zfwbjZ3YkflGRXqU1X0bWMptdr1Lw3bb7BLDlQaJDHkA5msP5A81E9sYmhhP 41MA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="XrM/qJGk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o4-20020a056a001bc400b0066a4fe6ad99si3563695pfw.148.2023.08.19.07.27.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 07:27:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="XrM/qJGk"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F189DC3B7C; Sat, 19 Aug 2023 01:43:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359696AbjHRKFD (ORCPT + 99 others); Fri, 18 Aug 2023 06:05:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359687AbjHRKE2 (ORCPT ); Fri, 18 Aug 2023 06:04:28 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BE50420B; Fri, 18 Aug 2023 03:04:06 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-689f4fb1c29so528968b3a.0; Fri, 18 Aug 2023 03:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692352985; x=1692957785; 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=Ei7XNMDznm4gQAPUvGl27pd9IQStOyHk63FGnzmJMW8=; b=XrM/qJGkbel1RCG3De4AztvK9DE7zha1o1KJx9YjloI0houUgkDZJUznZhvuQaLr5p WcUkPn+pJfafmAxC/2TjZQ+z6iTzQfXFtl+CS6doRLWoQRO50AuXTapdr3IQdx6QWonY kkfvLczMoejefRlJDpJK12asuG9lpo2Yh6iRAvbCo5G4zycAdpVsb6QL6/x7qHtQHi+G OmuJNV4NbiAcK5zUNCqqARmKGlgZJWXHOIZOM1amVAPkA22FjdrrqKGlXw2CGQRD7Xsd JE15j0gJIUWnVGRd5tto+RVFwZ7fUZNgecwC3VRFJCxBnkKtJmxt/Ny25RLTK2s4RZFJ y1pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692352985; x=1692957785; 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=Ei7XNMDznm4gQAPUvGl27pd9IQStOyHk63FGnzmJMW8=; b=VzSAM/Uqh/CCdfdq5SO3bHNJhgi+6ECB0OebUv9lQfsPG40rGOhBEyZwK1P0m05OEN xvmUODwwyJS0lEVzdqQVkKbrruzXEu1duBhRu4oQPfmyTEvpWMagZWQDMyCBZteI6197 Ta4gNuI8l2yIFPn2yS/KFrt5Alprtz3NJK6BJbPhR47DECyAX8uTxV7MOSb84d9hb8OL k8NtUud1XysaU3H4a7aSEMGturhhQwK1Ph842fXICydBfIrj9yaBNzrdSw0elQwOQjk0 s6rYNsv6uqfbzlGDv+xHnDGBTUmZa6i9vO8/425ZCkWXP4T+LQZPbBXb2WqOamsE+Mjo aoYA== X-Gm-Message-State: AOJu0Yxziz1Cz0zkYRPIYgQibupg/J+6zMmujsUcZFYOXXENemamT7ie WRnuzpfZnMJXNGhUR6SPEKg= X-Received: by 2002:a05:6a20:72a6:b0:133:38cb:2b93 with SMTP id o38-20020a056a2072a600b0013338cb2b93mr2493649pzk.9.1692352984915; Fri, 18 Aug 2023 03:03:04 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e25c-55ec-ad14-f925-5202-a39b.emome-ip6.hinet.net. [2001:b400:e25c:55ec:ad14:f925:5202:a39b]) by smtp.gmail.com with ESMTPSA id n22-20020a62e516000000b006870ccfbb54sm1180649pff.196.2023.08.18.03.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 03:03:04 -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 , Victor Shih Subject: [PATCH V10 12/23] mmc: sdhci-uhs2: skip signal_voltage_switch() Date: Fri, 18 Aug 2023 18:02:06 +0800 Message-Id: <20230818100217.12725-13-victorshihgli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230818100217.12725-1-victorshihgli@gmail.com> References: <20230818100217.12725-1-victorshihgli@gmail.com> 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_BLOCKED,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: INBOX X-GMAIL-THRID: 1774667925691375616 X-GMAIL-MSGID: 1774667925691375616 From: Victor Shih For UHS2, the signal voltage is supplied by vdd2 which is already 1.8v, so no voltage switch required. Signed-off-by: Ben Chuang Signed-off-by: AKASHI Takahiro Signed-off-by: Victor Shih Acked-by: Adrian Hunter --- Updates in V5: - Use sdhci_uhs2_mode() to simplify code in sdhci_uhs2_start_signal_voltage_switch(). --- drivers/mmc/host/sdhci-uhs2.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c index fc37a34629c2..92fb69b7e209 100644 --- a/drivers/mmc/host/sdhci-uhs2.c +++ b/drivers/mmc/host/sdhci-uhs2.c @@ -142,6 +142,27 @@ static void sdhci_uhs2_set_power(struct sdhci_host *host, unsigned char mode, un } } +/*****************************************************************************\ + * * + * MMC callbacks * + * * +\*****************************************************************************/ + +static int sdhci_uhs2_start_signal_voltage_switch(struct mmc_host *mmc, + struct mmc_ios *ios) +{ + struct sdhci_host *host = mmc_priv(mmc); + + /* + * For UHS2, the signal voltage is supplied by vdd2 which is + * already 1.8v so no voltage switch required. + */ + if (sdhci_uhs2_mode(host)) + return 0; + + return sdhci_start_signal_voltage_switch(mmc, ios); +} + /*****************************************************************************\ * * * Driver init/exit * @@ -150,6 +171,9 @@ static void sdhci_uhs2_set_power(struct sdhci_host *host, unsigned char mode, un static int sdhci_uhs2_host_ops_init(struct sdhci_host *host) { + host->mmc_host_ops.start_signal_voltage_switch = + sdhci_uhs2_start_signal_voltage_switch; + return 0; }