Skip to contentSkip to conversation

spi: documentation improvements

PATCH Applied Baruch Siach 2 participants 7 messages Jan 25, 2014 – Jan 27, 2014 4 messages not in the archive SPI

lore
Share & tools
lore
#0 lore raw

v3 cover spi: documentation improvements

This series improves spi documentation as follows:

* Add explicit note that transfer_one and transfer_one_message are mtually exclusive

* Add transfer_one documentation to spi-summary

* s/transfer/message/ in the transfer_one_message description

v3:
* Add transfer_one return values to spi-summary (Geert Uytterhoe)

* s/message/transfer/ in transfer_one description (Gerhard Sittig)

v2:
* Rebase over Mark's fix/core branch (Geert Uytterhoe)

* Correct the description of code behaviour when transfer_one and transfer_one_message are both implemented (Geert Uytterhoe)

Baruch Siach (3):
spi: spi.h: clarify the documentation of transfer_one
Doc: spi: document the transfer_one spi_master callback
spi: correct the transfer_one_message documentation wording

 Documentation/spi/spi-summary | 17 ++++++++++++++++-
 include/linux/spi/spi.h       |  7 +++++--
 2 files changed, 21 insertions(+), 3 deletions(-)
Signature · 6 lines
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): cover.1390681463.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org

#2 lore raw

PATCH v3 1/3 spi: spi.h: clarify the documentation of transfer_one

Explicitly note the transfer_one and transfer_one_message are mutually exclusive, to make the text a little more newcomers friendly.

---
 include/linux/spi/spi.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
include/linux/spi/spi.h +4 -1
index 9f5242df9311..f5a08c3f3e60 100644
@@ -287,7 +287,10 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
  *                  - return 1 if the transfer is still in progress. When
  *                    the driver is finished with this transfer it must
  *                    call spi_finalize_current_transfer() so the subsystem
- *                    can issue the next transfer
+ *                    can issue the next transfer. Note: transfer_one and
+ *                    transfer_one_message are mutually exclusive; when both
+ *                    are set, the generic subsystem does not call your
+ *                    transfer_one callback.
  * @unprepare_message: undo any work done by prepare_message().
  * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS
  *	number. Any individual value may be -ENOENT for CS lines that
Signature · 6 lines
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 598dd86dc07d794d7cd19a3259ea71618ba150bd.1390681463.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org

Applied
#4 lore raw

Re: [PATCH v3 1/3] spi: spi.h: clarify the documentation of transfer_one

Quoted 2 lines · Baruch Siach

Explicitly note the transfer_one and transfer_one_message are mutually exclusive, to make the text a little more newcomers friendly.

Applied, thanks. Still surprised this is confusing but hey ho.

#5 lore raw

PATCH v3 2/3 Doc: spi: document the transfer_one spi_master callback

In reply to a message not in the archive
---
 Documentation/spi/spi-summary | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Documentation/spi/spi-summary +15 -0
index f21edb983413..7192c0b6dd54 100644
@@ -545,6 +545,21 @@ SPI MASTER METHODS
 	spi_finalize_current_message() so the subsystem can issue the next
 	transfer. This may sleep.
 
+    master->transfer_one(struct spi_master *master, struct spi_device *spi,
+			 struct spi_transfer *transfer)
+	The subsystem calls the driver to transfer a single transfer while
+	queuing transfers that arrive in the meantime. When the driver is
+	finished with this transfer, it must call
+	spi_finalize_current_transfer() so the subsystem can issue the next
+	transfer. This may sleep. Note: transfer_one and transfer_one_message
+	are mutually exclusive; when both are set, the generic subsystem does
+	not call your transfer_one callback.
+
+	Return values:
+	negative errno: error
+	0: transfer is finished
+	1: transfer is still in progress
+
     DEPRECATED METHODS
 
     master->transfer(struct spi_device *spi, struct spi_message *message)
Signature · 6 lines
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 22346e0270dfd9b7892ff313654a6a2001654ea2.1390681463.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org

#8 lore raw

PATCH v3 3/3 spi: correct the transfer_one_message documentation wording

In reply to a message not in the archive

The transfer_one_message callback handles messages, not transfers.

---
 Documentation/spi/spi-summary | 2 +-
 include/linux/spi/spi.h       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/spi/spi-summary +1 -1
index 7192c0b6dd54..cb00a6cc0cf1 100644
@@ -543,7 +543,7 @@ SPI MASTER METHODS
 	queuing transfers that arrive in the meantime. When the driver is
 	finished with this message, it must call
 	spi_finalize_current_message() so the subsystem can issue the next
-	transfer. This may sleep.
+	message. This may sleep.
 
     master->transfer_one(struct spi_master *master, struct spi_device *spi,
 			 struct spi_transfer *transfer)
include/linux/spi/spi.h +1 -1
index f5a08c3f3e60..60b787ad4ed1 100644
@@ -273,7 +273,7 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
  *	message while queuing transfers that arrive in the meantime. When the
  *	driver is finished with this message, it must call
  *	spi_finalize_current_message() so the subsystem can issue the next
- *	transfer
+ *	message
  * @unprepare_transfer_hardware: there are currently no more messages on the
  *	queue so the subsystem notifies the driver that it may relax the
  *	hardware by issuing this call
Signature · 6 lines
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): c3cea38bd5e725eda84a72e5c9af9d0e66b48a5c.1390681463.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org

Applied
#10 lore raw

Re: [PATCH v3 3/3] spi: correct the transfer_one_message documentation wording

Quoted 1 line · Baruch Siach

The transfer_one_message callback handles messages, not transfers.

Applied, thanks.