Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1483005rda; Mon, 23 Oct 2023 14:08:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzLUwSDusnHqwrfNLGzd4DfIn7CvYzyEygD/g3zklXajLJ+g6VVTsewMJiuX5ci84vdEds X-Received: by 2002:a05:6a21:1506:b0:165:186:1560 with SMTP id nq6-20020a056a21150600b0016501861560mr939499pzb.53.1698095298229; Mon, 23 Oct 2023 14:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698095298; cv=none; d=google.com; s=arc-20160816; b=AZkmN/igHr3+Qx4sMt7GfDlZZmhqW5Dn/7j2rGs5gZXZTltBNXhlpkx58iNHx1fqtb 1XVnkUODTKcbzZ6JWXaNT+1MEmYcGH4MhOhXjC00tpMgFmfBtECKAPuZVHmXM2/nt696 pDaAiQbvxz40n+rZcWXdrSQJEtZshwwwkAVak982nz6AZZB7tI6vh+ZMk/5OG7cibuBw 7QAZTsoYCpnsCo8KAnTRKMNuM9p/F7Nx+VSgCXEXOj4R0UUJsrDbjlAZb3HKcF7bA5Pm Q2mdH2uPBS2daoz1BoDv8SztDH9WfvsPxowf2xOnwLSAEAkfFPNAM/gyw1+qD1u3oB9o R4zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=l++Rbeq1YJ0LFMw4HKx/yirX8siQghzI93qQn3u3z5E=; fh=vHR8U309XOCZR8G4JUyhb/0ihb0aVduZkDFEUxYc3iE=; b=wOd2RNq96WM8P9PMLeA7r7V2osAZSuEzayn08UrKHwTIG13odvZOTgP8zQj1cd2OnS ZAW84gw4CQEWOCkSU37Uua1hZAAZEEFmL+9wuy8+EyJu5urGu0SHcFRDvVS6Rpd5IjEz UP4DZQKseJ91tzSI2zr+KpsBejMrCHHaQRTF40jSa0xtpryOH4kloFn5ZPsuNGpINbSK SItpr8sqtTv9bftbLtGY6BcULB8RSxuw4SAr3ue70SCb32bixX1KPmmjeixJYIXtLxWM rkMXNtRwKvn+DdOn1yLeMswqR2EBFciUp9M/l8z0+QdX+GHxis9kbImWgu8fxaC5ZzBr Fp0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=uFvndL+H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id t8-20020a056a0021c800b006b440b5ace9si7161105pfj.44.2023.10.23.14.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 14:08:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=uFvndL+H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3C395805258E; Mon, 23 Oct 2023 14:08:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231378AbjJWVHW (ORCPT + 99 others); Mon, 23 Oct 2023 17:07:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230197AbjJWVHP (ORCPT ); Mon, 23 Oct 2023 17:07:15 -0400 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 C772810C0 for ; Mon, 23 Oct 2023 14:07:10 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-6ba172c5f3dso3089955b3a.0 for ; Mon, 23 Oct 2023 14:07:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1698095230; x=1698700030; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=l++Rbeq1YJ0LFMw4HKx/yirX8siQghzI93qQn3u3z5E=; b=uFvndL+HtOVx0wazlcdBIIJTUJDU3maM+DndsgPAxABr6pLyBk1GnYdQbo94Femj33 yk3r6M/eZrZn8PBdRF/+AcqoNEXhV7dQfgHQ3cf5qV1sHceVMAFiQcMt2x2uxczMHDTL XRwx3FGMCK5gCM4JHXLeMyL1YderUiaNmiE9KiW8Dz/mgDY1p5yfhZZf1BmlllicduWI pd8mvqqpwfg7TO8JAapZzrDBuYMaotYZjcZ19nz8nYyyV37Ah0ICt3BqU5DYL70W/8KA ARp5GOeAx6SXuhbb8pl9miivCQsbOR5SrQHRElA1RG4FL6GwpVlSjqvUBxCskR8k8jUH 2mQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698095230; x=1698700030; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=l++Rbeq1YJ0LFMw4HKx/yirX8siQghzI93qQn3u3z5E=; b=gjzYkmIVmdSMkjss9wFOPJpaFn0l0ZMc6zL2sYjuRrEgMHuwHotozvOUJTtkPCRhAI xsYx72inNI4i5KF8v/pzuAuljUg3f0mIy7MB/NYsuTJZpkB75s/lWPSVhFLCHuaZWu3A tUbWJLYHwAnLEAayAhkcD/lu9D3+oyBGvmm67rwOF6spiDf2zgvxsctnyzhxGMuf3S7M j4L0UC27f6nKbLwC4ykYQtifbdfj3ZJQn2oyOmRnsK+12C2uatiS8C3188XynnB/i1oV 7JxKrJND3sp/v7d4ykDbCDFBf1Vy4k/oMrITOgLQhxyUEj1UGk0uLxLmU/5VJ3JnTxJF sKyA== X-Gm-Message-State: AOJu0YxCxxtuvd+dswk2/QwDR0HjYYqA5jwreXcjM6WUu8kMIzeVuK4y RS1ew/1N9TzkvY66e2nVH+b+Qg== X-Received: by 2002:a05:6a00:134b:b0:690:422f:4f17 with SMTP id k11-20020a056a00134b00b00690422f4f17mr9329657pfu.4.1698095230237; Mon, 23 Oct 2023 14:07:10 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1800:f680:b9a0:8714:407c:4146]) by smtp.gmail.com with ESMTPSA id k28-20020aa79d1c000000b006bde2480806sm6573066pfp.47.2023.10.23.14.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 14:07:10 -0700 (PDT) From: Drew Fustini Date: Mon, 23 Oct 2023 14:07:03 -0700 Subject: [PATCH v3 2/7] mmc: sdhci: add __sdhci_execute_tuning() to header MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231023-th1520-mmc-v3-2-abc5e7491166@baylibre.com> References: <20231023-th1520-mmc-v3-0-abc5e7491166@baylibre.com> In-Reply-To: <20231023-th1520-mmc-v3-0-abc5e7491166@baylibre.com> To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jisheng Zhang , Adrian Hunter , Guo Ren , Fu Wei , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley Cc: Robert Nelson , Jason Kridner , Xi Ruoyao , Han Gao , Icenowy Zheng , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Drew Fustini X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1698095224; l=2057; i=dfustini@baylibre.com; s=20230430; h=from:subject:message-id; bh=O0pl7kPWnknxTc+1ciCix3vi2PmSyK8UTzQqhv8rZP0=; b=2M/0RlZn/69xiXATrzBfiSFScyxwOg2KlSuXzWRniQ5zD9O5bgp0P38TJusbwZ8FFlU4Swp9/ 0oC2SozqlS+D21SOjAte8vQCnRMpvZqWnzDIIfnnaSe57pXae58DgD5 X-Developer-Key: i=dfustini@baylibre.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 howler.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 (howler.vger.email [0.0.0.0]); Mon, 23 Oct 2023 14:08:03 -0700 (PDT) Expose __sdhci_execute_tuning() so that it can be called from the mmc host controller drivers. In the sdhci-of-dwcmshc driver, sdhci_dwcmshc_th1520_ops sets platform_execute_tuning to th1520_execute_tuning(). That function has to manipulate phy registers before tuning can be performed. To avoid copying the code verbatim from __sdhci_execute_tuning() into th1520_execute_tuning(), make it possible for __sdhci_execute_tuning() to be called from sdhci-of-dwcmshc. Signed-off-by: Drew Fustini --- drivers/mmc/host/sdhci.c | 3 ++- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index ff41aa56564e..c79f73459915 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2841,7 +2841,7 @@ void sdhci_send_tuning(struct sdhci_host *host, u32 opcode) } EXPORT_SYMBOL_GPL(sdhci_send_tuning); -static int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode) +int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode) { int i; @@ -2879,6 +2879,7 @@ static int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode) sdhci_reset_tuning(host); return -EAGAIN; } +EXPORT_SYMBOL_GPL(__sdhci_execute_tuning); int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) { diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index f219bdea8f28..a20864fc0641 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -793,6 +793,7 @@ void sdhci_set_bus_width(struct sdhci_host *host, int width); void sdhci_reset(struct sdhci_host *host, u8 mask); void sdhci_set_uhs_signaling(struct sdhci_host *host, unsigned timing); int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode); +int __sdhci_execute_tuning(struct sdhci_host *host, u32 opcode); void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios); int sdhci_start_signal_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios); -- 2.34.1