Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3405075rdg; Tue, 17 Oct 2023 13:46:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEkKdNx6716SGCPE/bRQ42OyOOkDY1Jj2EH7o3/kK9VhZjtGFKQP29MeEVMWgD7//7rv76g X-Received: by 2002:a05:6a20:da87:b0:163:a3ce:a699 with SMTP id iy7-20020a056a20da8700b00163a3cea699mr3770226pzb.57.1697575609548; Tue, 17 Oct 2023 13:46:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697575609; cv=none; d=google.com; s=arc-20160816; b=bD+3oiBagMxGSdlNd+nNoYjyaIXHzTCLAJnqewrLYZcUL+PPxKMPsrWbPZn+wKyjhC 1devQ5TAHKUUWr5m+LN/8eWbVb+s38FLBT9ffEkqUwXRZB8LpvSxVSbtqsM48ezAcZLl EEYDxrLnFZxaoCWxJpX1qI7f5c+QvbzLKcJPQ9w2qbLFNTKm6x03pXp9z7fr2ayFXEKm ny/HFJohhJFoDaDno2adRFrzwYM3oqP+T95Y0XKMw7KZI5Ip0qiz3800wfoNi97yMewL Ued8Tmgn58RasQxNKW0blTuP/52cfD0Mxbd70CEPl44mZD+8Kw7dbzJrIvbuqxWT7SmB Kajw== 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=pYcuHIQWD4Q7ZQC+QeRE+hA7eDomc0/Tpe+sVAV/K/6zLZjaPvh7IZVuz4KNM4UzRj 5s9xxJ8QtTE1CXIswdu8iMlZC7pO3ioZciefA73M2xSJc5glL7Gp++B5bT8jbT00nTS0 myofuyMjbmAMtpZtXqtKA3vPBDlwS3H0QvyxT25VBJdZgbCxlP0EmtNbzs3avD8zME+q JQuV6MuGbZi1CpL1udQiY3JWY+1Ri6zbY8T7DYSz1ASaCEcqfwJDtqc2Vl5T77GlfnbQ tTF8SaIqHrQDes2sAPkz0LrxpX086bSDXpCNWWBGpm3u4WV1R+a8p3NwDBZaSu3w6Jft 0YMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=O41QGRQr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id w10-20020a65410a000000b00578ed63fdacsi535338pgp.878.2023.10.17.13.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 13:46:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=O41QGRQr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 113F98073292; Tue, 17 Oct 2023 13:45:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235117AbjJQUpb (ORCPT + 99 others); Tue, 17 Oct 2023 16:45:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234143AbjJQUpY (ORCPT ); Tue, 17 Oct 2023 16:45:24 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5E90C6 for ; Tue, 17 Oct 2023 13:45:22 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-27cfb8442f9so3868141a91.2 for ; Tue, 17 Oct 2023 13:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1697575522; x=1698180322; 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=O41QGRQrrEn5Bz/20z5yWLS8Tz2bNmcoxrp5BHoDLhilCumn/bet7OaIN/Ys/EGpqk ntEKFlTRlc4vri3sgiw8XTMtYHUl9EqhwrvIaDzgRkJXmSKEq4GlkMffsmuC/Zc9vA7K IJrzJ38FJZGtALlJFB7ZAcADQ2etVXHNw64UzJgPn3tcGGuJ2D85V7YGoPqgxnFDgl9e nkATW6F4erlkVou4XITC//ycyl+1dPMB4RsB42giBgX3RoKTM+rV/pjx1bpYLamOBlML Hq5n3Bmaiwo4Jz16tEee26lYDgrGSPDuBM2IJNwkeisRNTsFHaeN8aiGwHmWynrwAv9V SSUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697575522; x=1698180322; 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=uWLu76ZPsUSpvK/enB3JtfkdBUlvUfxt0hrG53Mca+WtBX8Y+gpQ7TICWj3cjNnQSc +gCeBEky7LmGlzwkNUht5oiP8CJngpgHqITk8MnQ6Majv9CEJET8D4BLTD0ePgWyaY5+ cK2+aw/UygsBUSbME9Qax+MO+aSeuaEe436frXcH+oFveR7hrbKKDvCtWPXHGmvC/Qwn brLMYftqXlNFJ5ROi+xdyXKTVEPhZnrPVBAMhiHzScOb3WPtX1Eoym421cPG7J3msczS qRDqk55AJSlw5O7nuB46DkHnqMz8Jt0zzFd5kT6m+h37lKZeOMUHn/mM7OvAMTDre66p cw/w== X-Gm-Message-State: AOJu0YzsTwB3RGtMuBsxz/vBtsLUPgEQ20LY7YeBdhzinZTb4UsqmYpO aqJBY94aZeRVe0QPY5e0mAa00w== X-Received: by 2002:a17:90b:1097:b0:27d:24d6:7343 with SMTP id gj23-20020a17090b109700b0027d24d67343mr3378879pjb.19.1697575522030; Tue, 17 Oct 2023 13:45:22 -0700 (PDT) Received: from [127.0.1.1] ([2601:1c2:1800:f680:51d6:dcd6:63ef:52e9]) by smtp.gmail.com with ESMTPSA id w3-20020a17090a6b8300b0027b168cb011sm1906553pjj.56.2023.10.17.13.45.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 13:45:21 -0700 (PDT) From: Drew Fustini Date: Tue, 17 Oct 2023 13:43:48 -0700 Subject: [PATCH v2 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: <20231017-th1520-mmc-v2-2-4678c8cc4048@baylibre.com> References: <20231017-th1520-mmc-v2-0-4678c8cc4048@baylibre.com> In-Reply-To: <20231017-th1520-mmc-v2-0-4678c8cc4048@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=1697575515; l=2057; i=dfustini@baylibre.com; s=20230430; h=from:subject:message-id; bh=O0pl7kPWnknxTc+1ciCix3vi2PmSyK8UTzQqhv8rZP0=; b=c6MNN19+LVa+YXw8BVIwdqx0H9tnKqK0U5fbdhUSgz7AcvpDWhHyDwOlUig3M0ucf+4RwI6E4 UqlGbcLac7HAbSsrCd3MB60tM6ZE9sf10n3goXEu6+eNFsYQiMZJghN X-Developer-Key: i=dfustini@baylibre.com; a=ed25519; pk=p3GKE9XFmjhwAayAHG4U108yag7V8xQVd4zJLdW0g7g= X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Tue, 17 Oct 2023 13:45:41 -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