From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH-for-10.1 RESEND RESEND v2 3/3] hw/ssi: Document ssi_transfer() method
Date: Tue, 12 Aug 2025 16:04:15 +0200	[thread overview]
Message-ID: <20250812140415.70153-4-philmd@linaro.org> (raw)
In-Reply-To: <20250812140415.70153-1-philmd@linaro.org>
A SPI transaction consists of shifting bit in sync with the CLK
line, writing on the MOSI (output) line / and reading MISO (input)
line.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/ssi/ssi.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h
index 3cdcbd53904..2ad8033d8f5 100644
--- a/include/hw/ssi/ssi.h
+++ b/include/hw/ssi/ssi.h
@@ -38,6 +38,7 @@ struct SSIPeripheralClass {
 
     /* if you have standard or no CS behaviour, just override transfer.
      * This is called when the device cs is active (true by default).
+     * See ssi_transfer().
      */
     uint32_t (*transfer)(SSIPeripheral *dev, uint32_t val);
     /* called when the CS line changes. Optional, devices only need to implement
@@ -52,6 +53,7 @@ struct SSIPeripheralClass {
      * of the CS behaviour at the device level. transfer, set_cs, and
      * cs_polarity are unused if this is overwritten. Transfer_raw will
      * always be called for the device for every txrx access to the parent bus
+     * See ssi_transfer().
      */
     uint32_t (*transfer_raw)(SSIPeripheral *dev, uint32_t val);
 };
@@ -110,6 +112,18 @@ bool ssi_realize_and_unref(DeviceState *dev, SSIBus *bus, Error **errp);
 /* Master interface.  */
 SSIBus *ssi_create_bus(DeviceState *parent, const char *name);
 
+/**
+ * Transfer a word on a SSI bus
+ * @bus: SSI bus
+ * @val: word to transmit
+ *
+ * At the same time, read a word and write the @val one on the SSI bus.
+ *
+ * SSI words might vary between 8 and 32 bits. The same number of bits
+ * written is received.
+ *
+ * Return: word value received
+ */
 uint32_t ssi_transfer(SSIBus *bus, uint32_t val);
 
 DeviceState *ssi_get_cs(SSIBus *bus, uint8_t cs_index);
-- 
2.49.0
next prev parent reply	other threads:[~2025-08-12 14:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-12 14:04 [PATCH-for-10.1 RESEND RESEND v2 0/3] hw/sd/ssi-sd: Return noise (dummy byte) when no card connected Philippe Mathieu-Daudé
2025-08-12 14:04 ` [PATCH-for-10.1 RESEND RESEND v2 1/3] " Philippe Mathieu-Daudé
2025-08-12 15:57   ` Gustavo Romero
2025-08-12 14:04 ` [PATCH-for-10.1 RESEND RESEND v2 2/3] tests/functional: Test SPI-SD adapter without SD " Philippe Mathieu-Daudé
2025-08-12 15:35   ` Gustavo Romero
2025-08-12 16:38   ` Alex Bennée
2025-08-12 14:04 ` Philippe Mathieu-Daudé [this message]
2025-08-12 15:51   ` [PATCH-for-10.1 RESEND RESEND v2 3/3] hw/ssi: Document ssi_transfer() method Gustavo Romero
2025-08-12 16:38   ` Alex Bennée
2025-08-12 16:55 ` [PATCH-for-10.1 RESEND RESEND v2 0/3] hw/sd/ssi-sd: Return noise (dummy byte) when no card connected Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=20250812140415.70153-4-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).