~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/spi/spi_bitbang.h

Version: ~ [ linux-5.1-rc5 ] ~ [ linux-5.0.7 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.34 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.111 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.168 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.178 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.138 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.65 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef __SPI_BITBANG_H
  2 #define __SPI_BITBANG_H
  3 
  4 #include <linux/workqueue.h>
  5 
  6 struct spi_bitbang {
  7         struct workqueue_struct *workqueue;
  8         struct work_struct      work;
  9 
 10         spinlock_t              lock;
 11         struct list_head        queue;
 12         u8                      busy;
 13         u8                      use_dma;
 14         u8                      flags;          /* extra spi->mode support */
 15 
 16         struct spi_master       *master;
 17 
 18         /* setup_transfer() changes clock and/or wordsize to match settings
 19          * for this transfer; zeroes restore defaults from spi_device.
 20          */
 21         int     (*setup_transfer)(struct spi_device *spi,
 22                         struct spi_transfer *t);
 23 
 24         void    (*chipselect)(struct spi_device *spi, int is_on);
 25 #define BITBANG_CS_ACTIVE       1       /* normally nCS, active low */
 26 #define BITBANG_CS_INACTIVE     0
 27 
 28         /* txrx_bufs() may handle dma mapping for transfers that don't
 29          * already have one (transfer.{tx,rx}_dma is zero), or use PIO
 30          */
 31         int     (*txrx_bufs)(struct spi_device *spi, struct spi_transfer *t);
 32 
 33         /* txrx_word[SPI_MODE_*]() just looks like a shift register */
 34         u32     (*txrx_word[4])(struct spi_device *spi,
 35                         unsigned nsecs,
 36                         u32 word, u8 bits);
 37 };
 38 
 39 /* you can call these default bitbang->master methods from your custom
 40  * methods, if you like.
 41  */
 42 extern int spi_bitbang_setup(struct spi_device *spi);
 43 extern void spi_bitbang_cleanup(struct spi_device *spi);
 44 extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m);
 45 extern int spi_bitbang_setup_transfer(struct spi_device *spi,
 46                                       struct spi_transfer *t);
 47 
 48 /* start or stop queue processing */
 49 extern int spi_bitbang_start(struct spi_bitbang *spi);
 50 extern int spi_bitbang_stop(struct spi_bitbang *spi);
 51 
 52 #endif  /* __SPI_BITBANG_H */
 53 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp