Skip to contentSkip to conversation

spi: documentation improvements

PATCH Superseded Baruch Siach 2 participants 8 messages Jan 24, 2014 4 messages not in the archive SPI

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 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

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 | 12 +++++++++++-
 include/linux/spi/spi.h       |  7 +++++--
 2 files changed, 16 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.1390552232.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org

#2 lore raw

PATCH v2 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
#3 lore raw

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

In reply to a message not in the archive
---
 Documentation/spi/spi-summary | 10 ++++++++++
 1 file changed, 10 insertions(+)
Documentation/spi/spi-summary +10 -0
index f21edb983413..735acbf1ce0c 100644
@@ -545,6 +545,16 @@ 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 message, 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.
+
     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): 1abe062855111800754477d1340635b5a69d5635.1390552232.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org

#5 lore raw

Re: [PATCH v2 2/3] Doc: spi: document the transfer_one spi_master callback

Quoted 4 lines · Baruch Siach

+++ b/Documentation/spi/spi-summary

Documentation/spi/spi-summary +0 -0
@@ -545,6 +545,16 @@ SPI MASTER METHODS
        spi_finalize_current_message() so the subsystem can issue the next
        transfer. This may sleep.

Documentation/spi/spi-summary SPI MASTER METHODS · line 556

Quoted 10 lines
Documentation/spi/spi-summary +9 -0
 
+    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 message, 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.

You still forgot the updates I made in
http://lkml.indiana.edu/hypermail/linux/kernel/1401.2/02465.html

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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): CAMuHMdVrNcs0uWfVNdXGw+HTuGHy2nGXR=tMqdzz236LGFHVoQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#7 lore raw

Re: [PATCH v2 2/3] Doc: spi: document the transfer_one spi_master callback

Hi Geert,

Quoted 6 lines · Geert Uytterhoeven
Quoted 5 lines · Baruch Siach

+++ b/Documentation/spi/spi-summary

Documentation/spi/spi-summary +0 -0
@@ -545,6 +545,16 @@ SPI MASTER METHODS
        spi_finalize_current_message() so the subsystem can issue the next
        transfer. This may sleep.
 
Quoted 12 lines

Documentation/spi/spi-summary SPI MASTER METHODS · line 556

Quoted 9 lines
Documentation/spi/spi-summary +9 -0
+    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 message, 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.

You still forgot the updates I made in
http://lkml.indiana.edu/hypermail/linux/kernel/1401.2/02465.html

AFAICS, your patch touches spi.h, not spi-summary. Am I missing something here?

baruch

Signature · 7 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.2.679.5364, http://www.tkos.co.il -
--
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
#8 lore raw

Re: [PATCH v2 2/3] Doc: spi: document the transfer_one spi_master callback

Quoted 10 lines · Baruch Siach
Quoted 10 lines
Quoted 9 lines
Documentation/spi/spi-summary +9 -0
+    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 message, 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.
Quoted 5 lines
Quoted 2 lines

You still forgot the updates I made in
http://lkml.indiana.edu/hypermail/linux/kernel/1401.2/02465.html

AFAICS, your patch touches spi.h, not spi-summary. Am I missing something here?

I think the description in spi-summary should be updated to match the changes to spi.h.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
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): CAMuHMdVH9XDcVGXt2CcqkABGbz4Kz9bA5M1NPSAyOnwm6u4j2A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#10 lore raw

Re: [PATCH v2 2/3] Doc: spi: document the transfer_one spi_master callback

Hi Geert,

Quoted 11 lines · Geert Uytterhoeven
Quoted 10 lines · Baruch Siach
Quoted 10 lines
Quoted 9 lines
(quoted diff) +9 -0
+    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 message, 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.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

You still forgot the updates I made in
http://lkml.indiana.edu/hypermail/linux/kernel/1401.2/02465.html

AFAICS, your patch touches spi.h, not spi-summary. Am I missing something here?

I think the description in spi-summary should be updated to match the changes to spi.h.

OK. Will do.

baruch

Signature · 7 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - [email protected] - tel: +972.2.679.5364, http://www.tkos.co.il -
--
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
#11 lore raw

PATCH v2 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 735acbf1ce0c..ea2f2da611a6 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