Skip to contentSkip to conversation

spi_bitbang: Add more lowlevel function documentation

PATCH In review Michael Buesch 2 participants 2 messages Feb 19, 2009 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi_bitbang: Add more lowlevel function documentation

This adds more documentation of the lowlevel API to avoid future bugs.

---

include/linux/spi/spi_bitbang.h +7 -0
Index: linux-2.6/include/linux/spi/spi_bitbang.h
===================================================================
@@ -83,6 +83,13 @@ extern int spi_bitbang_stop(struct spi_b
  *  int getmiso(struct spi_device *);
  *  void spidelay(unsigned);
  *
+ * setsck()'s is_on parameter is a zero/nonzero boolean.
+ *
+ * setmosi()'s is_on parameter is a zero/nonzero boolean.
+ *
+ * getmiso() is required to return 0 or 1 only. Any other value is invalid
+ * and will result in improper operation.
+ *
  * A non-inlined routine would call bitbang_txrx_*() routines.  The
  * main loop could easily compile down to a handful of instructions,
  * especially if the delay is a NOP (to run at peak speed).
Signature · 1 line
Greetings, Michael.
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Michael Buesch

This adds more documentation of the lowlevel API to avoid future bugs.

... thanks.

Quoted 25 lines

---

Index: linux-2.6/include/linux/spi/spi_bitbang.h
===================================================================

include/linux/spi/spi_bitbang.h +7 -0
@@ -83,6 +83,13 @@ extern int spi_bitbang_stop(struct spi_b
  *  int getmiso(struct spi_device *);
  *  void spidelay(unsigned);
  *
+ * setsck()'s is_on parameter is a zero/nonzero boolean.
+ *
+ * setmosi()'s is_on parameter is a zero/nonzero boolean.
+ *
+ * getmiso() is required to return 0 or 1 only. Any other value is invalid
+ * and will result in improper operation.
+ *
  * A non-inlined routine would call bitbang_txrx_*() routines.  The
  * main loop could easily compile down to a handful of instructions,
  * especially if the delay is a NOP (to run at peak speed).
Signature · 2 lines
-- 
Greetings, Michael.