From patchwork Wed Sep 2 15:35:47 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Rebmann X-Patchwork-Id: 3144 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mxe881.netcup.net (Postfix) with ESMTPS id 6758E1C14B3 for ; Wed, 2 Sep 2026 17:57:20 +0200 (CEST) Authentication-Results: mxe881; spf=pass (sender IP is 172.234.253.10) smtp.mailfrom=linux-sunxi+bounces-25492-noreply=patchwork.local@lists.linux.dev smtp.helo=sea.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.234.253.10 as permitted sender) client-ip=172.234.253.10; envelope-from=linux-sunxi+bounces-25492-noreply=patchwork.local@lists.linux.dev; helo=sea.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 93908C0CE7 for ; Wed, 2 Sep 2026 15:37:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8A3F4A99D0; Wed, 2 Sep 2026 15:36:27 +0000 (UTC) X-Original-To: linux-sunxi@lists.linux.dev Received: from mx1.white.stw.pengutronix.de (mx1.white.stw.pengutronix.de [185.203.200.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 294C14A92C1 for ; Wed, 2 Sep 2026 15:36:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.200.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788363384; cv=none; b=DZsVDilpGHjVhB4dCG0xlLUWb3AiTEXhwZkIp5IvwiEPilMHBSdmhwV5L7B4DUrdIWJGy8hclVjlguslj0pxDB7Mr2Z2MvENmvXqPYB4EMYZ3WEl1dvPSiYyfrlVNVbHpaw5eKHNLcf3uzGLxxBgDm3xObNQWKFF+EM4DBTEE2c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788363384; c=relaxed/simple; bh=R3ZU8/kS8Pob+4N3MgpaA3ZAKG703jFLtNJQzuFDIEk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VdFtBlwz8NUyQohK421ixct4rF9fFsg9PCbwVGdeCyvJgl9yRECNPf5Kg79MHFIonivYgLNTCmk8fk9ZcSvLXXvm4S4A2xeO7DUX4ozgAzVHsj9/DgiLE3aJItkmqLgWi9Rn/6I2K3y2W85WWZSUkzt6ify2g97CV5cunmJ7Hxc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.200.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de (drehscheibe.grey.stw.pengutronix.de [IPv6:2a0a:edc0:0:c01:1d::a2]) (Authenticated sender: relay-from-drehscheibe.grey.stw.pengutronix.de) by mx1.white.stw.pengutronix.de (Postfix) with ESMTPSA id 48E442058E6; Wed, 02 Sep 2026 17:35:54 +0200 (CEST) Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1x1n0E-004bxm-0Y; Wed, 02 Sep 2026 17:35:54 +0200 From: Jonas Rebmann Date: Wed, 02 Sep 2026 17:35:47 +0200 Subject: [PATCH 5/5] spi: spi-sun4i: sun4i_spi_transfer_one(): report effectively used speed_hz of transfer Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260902-spi-sun4i-fixes-v1-5-19985ef75673@pengutronix.de> References: <20260902-spi-sun4i-fixes-v1-0-19985ef75673@pengutronix.de> In-Reply-To: <20260902-spi-sun4i-fixes-v1-0-19985ef75673@pengutronix.de> To: Mark Brown , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , Alexandru Gagniuc , Olliver Schinagl Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Mark Brown , kernel@pengutronix.de, Marc Kleine-Budde , Jonas Rebmann X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1162; i=jre@pengutronix.de; h=from:subject:message-id; bh=N+Ets8Mcr9PVPdeJK43FhH+k+VNCJ0EXzg70tuLR/+g=; b=owGbwMvMwCV2ZcYT3onnbjcwnlZLYsia4RT5J/Roz9vH3723sjVKP+hi52X4tmJxT9yaVZ+5l 5lNMN2+vKOUhUGMi0FWTJElVk1OQcjY/7pZpV0szBxWJpAhDFycAjCRvdEM/8xnxBe9m9x41/Cw Yf2fkD+m2w3Ylou7exXcu1XM1nuzK4ORYfLE8s2TWJTN968unPXiidzEdGVlVqVN89xDDB2nnJx 4hBUA X-Developer-Key: i=jre@pengutronix.de; a=openpgp; fpr=0B7B750D5D3CD21B3B130DE8B61515E135CD49B5 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Marc Kleine-Budde Report the effectively used speed_hz for the transfer by setting tfr->effective_speed_hz. For more information see commit 5d7e2b5ed585 ("spi: core: allow reporting the effectivly used speed_hz for a transfer"), which adds this feature to the SPI core. Signed-off-by: Marc Kleine-Budde Signed-off-by: Jonas Rebmann --- drivers/spi/spi-sun4i.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c index 18951c1972da..fff0065ce9af 100644 --- a/drivers/spi/spi-sun4i.c +++ b/drivers/spi/spi-sun4i.c @@ -300,9 +300,11 @@ static int sun4i_spi_transfer_one(struct spi_controller *host, div_cdr2 = DIV_ROUND_UP(div_cdr1, 2); if (div_cdr2 <= (SUN4I_CLK_CTL_CDR2_MASK + 1)) { reg = SUN4I_CLK_CTL_CDR2(div_cdr2 - 1) | SUN4I_CLK_CTL_DRS; + tfr->effective_speed_hz = mclk_rate / (2 * div_cdr2); } else { div = min(SUN4I_CLK_CTL_CDR1_MASK, order_base_2(div_cdr1)); reg = SUN4I_CLK_CTL_CDR1(div); + tfr->effective_speed_hz = mclk_rate / (1 << div); } sun4i_spi_write(sspi, SUN4I_CLK_CTL_REG, reg);