From patchwork Fri Nov 10 05:41:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Drew Fustini X-Patchwork-Id: 163942 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp1334738vqs; Fri, 10 Nov 2023 11:26:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IHXog9KZ9FopG23eOGquTGc2dFSuSwLT8BAh5ktm9c9fRSU30N4jeF27h5xhmfzs2kHR7TR X-Received: by 2002:a05:6a00:1916:b0:6b6:e754:9e02 with SMTP id y22-20020a056a00191600b006b6e7549e02mr8718561pfi.12.1699644390451; Fri, 10 Nov 2023 11:26:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699644390; cv=none; d=google.com; s=arc-20160816; b=WKwWP1qqCy9JtHUXVixiO0w35t3XnSHvwnkt4iZPYQmtP3p23vn16lQ/k4gH41c6OR tDP5fPE8RJCgy+BLzUwr3TkemJ6E//bjaLBRGZl/GZM7oDkIMna7TG5FKKL4uHvNDnBO sSD8lbU24NxJmNZZOaYJZE3k/zLzXYeekVaGWZaDKTqs/UbCImHUkEaFpjeHRxOE/jY4 KhLevX+fdyPYIhs47mzfTn8VRsevA5MDGRBrrSb8844VibwtXik3uzzNRUK4PKq0N+4y CIMyixuw5Gff1JEkDXv/8QFKPP+2VP+avI6bhtUHddceHYS6J5gtq8KG75/yIdgu8BhW Sc1w== 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=Uci5Rd8hU8lrREOeKMYxmj/9fXU4uXy75tEQ4ik3o2A=; fh=me++FBgRmiJKsUIJuboqcm7vPctAvwMCvJeBsSS20lM=; b=M4VZyRTQ9W6uAycuj2ABSdSodNz8A0uNQn7s2ofzEGUlEjavxq4EQEcUtz3s7y2c5z atbndZWUcqhKJGA0NBE5YNfUznS1JkMmhITIXJfI430rsG0aXP8T0T9v9lLMHtPlHZJf xut0byOUOYxCZaK0/IGt07O69KHxU+t5i2WdevgqMjh5EnyIh718zqnXDfNyObD8hY09 AUquM2OYNLj3+D++mZSA4LMyQZgdHpuevka5TURXyyc56kcZKYKz1QfdWQ02Q4UBOyFl DIIC1I5sPTGsCsbMQswplRj+8+6Ws0Ubcyj2bEQQYuKu10bdLjCUJg+6VM5iL/3EagYQ FnvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=zC2ePtrN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id q12-20020a056a00084c00b006be30cdc3d8si103097pfk.163.2023.11.10.11.26.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 11:26:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=zC2ePtrN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id A08B6837925E; Fri, 10 Nov 2023 11:26:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346357AbjKJTYf (ORCPT + 29 others); Fri, 10 Nov 2023 14:24:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346299AbjKJTYO (ORCPT ); Fri, 10 Nov 2023 14:24:14 -0500 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 785115BBA for ; Thu, 9 Nov 2023 22:17:06 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1cc3bb4c307so14703795ad.0 for ; Thu, 09 Nov 2023 22:17:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1699597026; x=1700201826; 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=Uci5Rd8hU8lrREOeKMYxmj/9fXU4uXy75tEQ4ik3o2A=; b=zC2ePtrNROS6IduQwHyv7oCVL1j6xPmltA9Pzyel+xJBhedhZ4kFvPFDf602v+B7oZ eaulyiecSttyWt5XIHWjYi/UN6/nK1GGtKd1HyrONx9Rj3YMWfm64mRCyRvmqk8YcWvE p7JDn+StUbJf7hXVF43UF1Y87a3TkItPjMV7YGRmXAhbnWpHHLgM21VEo7ImljSoIJhH YUyziDMy5Orx9Oahh+aQ5uSYzdWNwnI3IADmQ6ipcjjwSOILZzEUt47SN1rWoOq/WJXR FbVQVrhbR2pLmEHBWaWzbFvmADRfJs05enecp759XTuHy6DeBz6ArwQwkKVPAaLoCc3j OE8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699597026; x=1700201826; 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=Uci5Rd8hU8lrREOeKMYxmj/9fXU4uXy75tEQ4ik3o2A=; b=vU7dEHS/46uxbsWXHsOZ/BHSRDXfqjevro+AjICgbF8UaHVfVRy7ucB5hTHmU1AK+3 bqZH/SDBETc05OAd+Xi1Cb8x2RNv2tJY+mA8W2pA+l4Z5Bb0NWd0PWjrm1qGLjRo43bB YseNIvbQaAo1d7X3yIg3SFj9SVVCnVL6zTP9ADWSCjyL4VAAo9Qrx9Ra9/O3Zt3omLm9 u9O4mQIVMzGQ9az8dV9CYDbRUygQv79sa/fE4QIPQAZRVzBhCXIz8jCmcphTU2NSuyYM ejDEFe/rWrx+cTdQ04lHqkIctXcKDvhgLItiEqcAnD5vkW4vaI+kE6XPFG/Ksvxs0EPM cCWA== X-Gm-Message-State: AOJu0YxHgrXy8YryKqiuVXY5bYSDWsSWvBayc5d/xXrimbI0fTTUhPPm xJIl5LWkM5jsrNYwhKgxzGZtdajL49fAGU+8nqzKSg== X-Received: by 2002:a17:902:d506:b0:1cc:3825:7ba2 with SMTP id b6-20020a170902d50600b001cc38257ba2mr8168039plg.4.1699594949041; Thu, 09 Nov 2023 21:42:29 -0800 (PST) Received: from [127.0.1.1] ([2601:1c2:1800:f680:2071:4479:98b8:cc69]) by smtp.gmail.com with ESMTPSA id ix22-20020a170902f81600b001b8a00d4f7asm4498845plb.9.2023.11.09.21.42.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 21:42:28 -0800 (PST) From: Drew Fustini Date: Thu, 09 Nov 2023 21:41:12 -0800 Subject: [PATCH v5 2/7] mmc: sdhci: add __sdhci_execute_tuning() to header MIME-Version: 1.0 Message-Id: <20231109-th1520-mmc-v5-2-018bd039cf17@baylibre.com> References: <20231109-th1520-mmc-v5-0-018bd039cf17@baylibre.com> In-Reply-To: <20231109-th1520-mmc-v5-0-018bd039cf17@baylibre.com> To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jisheng Zhang , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Fu Wei , Conor Dooley Cc: 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=1699594943; l=2108; i=dfustini@baylibre.com; s=20230430; h=from:subject:message-id; bh=vV7D9g0JyI+aykknduEYFaEeV4K8xwyLfp1qBkgVUvA=; b=wiXFL4D9Q3411BhcGKUB1ePUooVyFCo6lIXJGCjVRVhgVo/MthWkxzFvbNGGV91mDj8tIZhb9 3ad00+5H/oQC96F88xLLDDeHjyQTU7R4MEvXiEmQLL2+zlo1saaRuND 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Fri, 10 Nov 2023 11:26:11 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782206316789131749 X-GMAIL-MSGID: 1782206316789131749 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. Acked-by: Adrian Hunter 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);