Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
spi-bitbang.c File Reference
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi_bitbang.h>

Go to the source code of this file.

Data Structures

struct  spi_bitbang_cs
 

Functions

int spi_bitbang_setup_transfer (struct spi_device *spi, struct spi_transfer *t)
 
 EXPORT_SYMBOL_GPL (spi_bitbang_setup_transfer)
 
int spi_bitbang_setup (struct spi_device *spi)
 
 EXPORT_SYMBOL_GPL (spi_bitbang_setup)
 
void spi_bitbang_cleanup (struct spi_device *spi)
 
 EXPORT_SYMBOL_GPL (spi_bitbang_cleanup)
 
int spi_bitbang_transfer (struct spi_device *spi, struct spi_message *m)
 
 EXPORT_SYMBOL_GPL (spi_bitbang_transfer)
 
int spi_bitbang_start (struct spi_bitbang *bitbang)
 
 EXPORT_SYMBOL_GPL (spi_bitbang_start)
 
int spi_bitbang_stop (struct spi_bitbang *bitbang)
 
 EXPORT_SYMBOL_GPL (spi_bitbang_stop)
 
 MODULE_LICENSE ("GPL")
 

Function Documentation

EXPORT_SYMBOL_GPL ( spi_bitbang_setup_transfer  )
EXPORT_SYMBOL_GPL ( spi_bitbang_setup  )
EXPORT_SYMBOL_GPL ( spi_bitbang_cleanup  )
EXPORT_SYMBOL_GPL ( spi_bitbang_transfer  )
EXPORT_SYMBOL_GPL ( spi_bitbang_start  )
EXPORT_SYMBOL_GPL ( spi_bitbang_stop  )
MODULE_LICENSE ( "GPL"  )
void spi_bitbang_cleanup ( struct spi_device spi)

spi_bitbang_cleanup - default cleanup for per-word I/O loops

Definition at line 231 of file spi-bitbang.c.

int spi_bitbang_setup ( struct spi_device spi)

spi_bitbang_setup - default setup for per-word I/O loops

Definition at line 184 of file spi-bitbang.c.

int spi_bitbang_setup_transfer ( struct spi_device spi,
struct spi_transfer t 
)

Definition at line 142 of file spi-bitbang.c.

int spi_bitbang_start ( struct spi_bitbang bitbang)

spi_bitbang_start - start up a polled/bitbanging SPI master driver : driver handle

Caller should have zero-initialized all parts of the structure, and then provided callbacks for chip selection and I/O loops. If the master has a transfer method, its final step should call spi_bitbang_transfer; or, that's the default if the transfer routine is not initialized. It should also set up the bus number and number of chipselects.

For i/o loops, provide callbacks either per-word (for bitbanging, or for hardware that basically exposes a shift register) or per-spi_transfer (which takes better advantage of hardware like fifos or DMA engines).

Drivers using per-word I/O loops should use (or call) spi_bitbang_setup, spi_bitbang_cleanup and spi_bitbang_setup_transfer to handle those spi master methods. Those methods are the defaults if the bitbang->txrx_bufs routine isn't initialized.

This routine registers the spi_master, which will process requests in a dedicated task, keeping IRQs unblocked most of the time. To stop processing those requests, call spi_bitbang_stop().

Definition at line 433 of file spi-bitbang.c.

int spi_bitbang_stop ( struct spi_bitbang bitbang)

spi_bitbang_stop - stops the task providing spi communication

Definition at line 493 of file spi-bitbang.c.

int spi_bitbang_transfer ( struct spi_device spi,
struct spi_message m 
)

spi_bitbang_transfer - default submit to transfer queue

Definition at line 384 of file spi-bitbang.c.