From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.246.84.56 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795629126; b=2I4dGHNfbkrfnvYVwTp8E+REOs5G/dzVpPNmSlkUa/31a2w+FhTS4lRqLB45wEuzJgfC zmApJhO+q/niXV1dUJq42ZNTEqSiF2bI36eijXUjFQJleClnBfp3ao/D8bZAkfNzpZylJ asMiK6WGWV2cVmYrJ8Uvj7N/KUf/V/1v0Oafy/6ykmn5pFa8Di+AQbLnQWE3fvQg1/p3n iobF+JH6lvtunGWO99x8haOYyH9EnDB3qAJgjsmjfsnUzSGUwcBTMne9ZrLyMenLKqkIC 20W+fCh+Xhrt8UQN+UhdOsJqz8EftIgCiU8kqmq/8nkfEHYf6IhnGN5ElGuDpW2Cl+w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795629126; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Last-TLS-Session-Version; bh=iZxx/bv8sERrldyegt+0p8ETCEh3QBNaziABehRhDAk=; b=mvLHWoPLthOGenDS9gG6GP18n2mfQeS7zlSmCrq9LcqVMhRbTEH3S74SMwzVqPEeZ+V7 Ct3fEo3gbR+oSDi3C/2QEvzxuTDwUw6W1tOamJ+qiLNMOIVVgMmvfI/KENJjvMVtS3qxr kQTiuEXFGJlcOF5qJP+hEiTsR+XVvemqNIKbBh2M5/BfNDAYs2dqiq0QMneZ5zUESvUot 6+m2W/usuPtYmeHVhfIzdJyNroSgD3DGJW77g5O2cqCf44j2ZCPfNwTnJarackdo+ns7P pubDjc4d7ZfWS7sGoXjcVUUH4iFDnpkZVEfaRP0vqtvI1qpOwSqVATkfTaGCQmUcmYg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=yL6AMJxn; arc=none smtp.remote-ip=185.246.84.56 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABE56606A31E for ; Wed, 25 Nov 2026 17:52:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ABE56606A31E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=yL6AMJxn Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 8CE831A17FC; Wed, 25 Nov 2026 17:52:04 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 6114960480; Wed, 25 Nov 2026 17:52:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6417311E6B0D4; Wed, 25 Nov 2026 18:51:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1795629122; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=iZxx/bv8sERrldyegt+0p8ETCEh3QBNaziABehRhDAk=; b=yL6AMJxnVUerS+qMBN95vJA+Y7K3/dhFouRAcBhWhxAyGTqONCU8kzEjNSe7yny1XlTZ2B 1eY+gEOS/9vAcE39SthkjtppvaT8ilNd0zgyRGfqcGEG6Afe9IrA7IgFgscjHhhp+KOQAP DL9AYhtRwBa9ZCQ5d4wJ0Vr7b5xq4Y6tYOcOWHTIiZ7GLPmkjl3RWdSMGGwynH37OOzvFh Ys/b/Q+BEna2T4nbn6uw8wqQSGRDQHFArZ+7lM5OjjkH1sLshzEUsT9VZN05oAzllz9F7n KMKsqdpUq/KO3jvXSrm3Z5EtgyPlyDsfqTSmXRpva+TWp12wUjblVK1kCBET3Q== From: Miquel Raynal Date: Wed, 25 Nov 2026 18:51:18 +0100 Subject: [PATCH RFC 04/16] spi: amlogic-spifc-a1: Consume dummy cycles directly X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261125-macronix-upstreaming-spi-mem-cycles-v1-4-fd036402fd37@bootlin.com> References: <20261125-macronix-upstreaming-spi-mem-cycles-v1-0-fd036402fd37@bootlin.com> In-Reply-To: <20261125-macronix-upstreaming-spi-mem-cycles-v1-0-fd036402fd37@bootlin.com> To: Mark Brown , Liang Yang , Feng Chen , Xianwei Zhao , Han Xu , Conor Dooley , Valentina Fernandez , Daire McNamara , Haibo Chen , Jyan Chou , Yu-Chun Lin , Maxime Coquelin , Alexandre Torgue , Pratyush Yadav , Michael Walle , Takahiro Kuwano , Richard Weinberger , Vignesh Raghavendra Cc: Thomas Petazzoni , Alvin Zhou , Cheng Ming Lin , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, imx@lists.linux.dev, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, Miquel Raynal X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The spi-mem layer is now capable of providing the dummy phase in cycle units rather than bytes, provided that drivers advertize the dummy_cycle capability. Since this controller is consuming cycles and currently converts bytes into cycles, flag it capable to consume cycles directly and drop the extra conversions. Signed-off-by: Miquel Raynal --- drivers/spi/spi-amlogic-spifc-a1.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-amlogic-spifc-a1.c b/drivers/spi/spi-amlogic-spifc-a1.c index 388bd2472dc0..282647cd6b56 100644 --- a/drivers/spi/spi-amlogic-spifc-a1.c +++ b/drivers/spi/spi-amlogic-spifc-a1.c @@ -90,7 +90,7 @@ #define SPIFC_A1_USER_DUMMY(op) ( \ SPIFC_A1_USER_DUMMY_ENABLE | \ FIELD_PREP(SPIFC_A1_USER_DUMMY_MODE, ilog2((op)->dummy.buswidth)) | \ - FIELD_PREP(SPIFC_A1_USER_DUMMY_CLK_SYCLES, (op)->dummy.nbytes << 3)) + FIELD_PREP(SPIFC_A1_USER_DUMMY_CLK_SYCLES, (op)->dummy.ncycles)) #define SPIFC_A1_TSLCH_VAL FIELD_PREP(SPIFC_A1_TSLCH, 1) #define SPIFC_A1_TCLSH_VAL FIELD_PREP(SPIFC_A1_TCLSH, 1) @@ -269,7 +269,7 @@ static int amlogic_spifc_a1_exec_op(struct spi_mem *mem, amlogic_spifc_a1_set_addr(spifc, op->addr.val, SPIFC_A1_USER_ADDR(op)); - if (op->dummy.nbytes) + if (op->dummy.ncycles) amlogic_spifc_a1_set_dummy(spifc, SPIFC_A1_USER_DUMMY(op)); if (data_size) { @@ -321,6 +321,7 @@ static const struct spi_controller_mem_ops amlogic_spifc_a1_mem_ops = { static const struct spi_controller_mem_caps amlogic_spifc_a1_mem_caps = { .per_op_freq = true, + .dummy_cycles = true, }; static int amlogic_spifc_a1_probe(struct platform_device *pdev) -- 2.56.0