Main Page | Class List | File List | Class Members | File Members

spi-dev.c File Reference

spi bus character device /dev/spi-x access interface More...

#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/version.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <asm/uaccess.h>
#include <linux/spi.h>

Include dependency graph for spi-dev.c:

Include dependency graph

Defines

#define DEBUG
#define SPI_MAX_MSG_SIZE   8192
#define SPI_MAX_MSGS   42
#define SPI_ADAP_MAX   4
#define SPIDEV_ADAPS_MAX   SPI_ADAP_MAX

Functions

ssize_t spidev_read (struct file *file, char *buf, size_t count, loff_t *offset)
ssize_t spidev_write (struct file *file, const char *buf, size_t count, loff_t *offset)
int spidev_open (struct inode *inode, struct file *file)
int spidev_release (struct inode *inode, struct file *file)
int spidev_attach_adapter (struct spi_adapter *adap)
 notify that new adapter has been attached. Build new minor device entry for this new adapter

int spidev_detach_client (struct spi_client *client)
int spidev_command (struct spi_client *client, unsigned int cmd, void *arg)
int spidev_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
int __init spi_dev_init (void)
void spidev_cleanup (void)
 MODULE_AUTHOR ("Kate Alhola< kate(at) katix.org > Jamey Hicks< jamey.hicks @compaq.com > Frodo Looijaard< frodol @dds.nl > and Simon G.Vogl< simon @tk.uni-linz.ac.at >")
 MODULE_DESCRIPTION ("SPI/dev entries driver")
 MODULE_LICENSE ("GPL")
 module_init (spi_dev_init)
 module_exit (spidev_cleanup)

Variables

file_operations spidev_fops
spi_adapterspidev_adaps [SPIDEV_ADAPS_MAX]
spi_driver spidev_driver
 spidev_driver struct to register us as a spi driver to spi-core

spi_client spidev_client_template
int spidev_initialized
 EXPORT_NO_SYMBOLS

Detailed Description

spi bus character device /dev/spi-x access interface


Function Documentation

int __init spi_dev_init void   )  [static]
 

spi_dev_init(void) module init function

Here is the call graph for this function:

int spidev_attach_adapter struct spi_adapter adap  )  [static]
 

notify that new adapter has been attached. Build new minor device entry for this new adapter

spidev_attach_adapter - notify that new adapter has been attached

Parameters:
adap: spi_adapter structure of new adapter

Here is the call graph for this function:

int spidev_ioctl struct inode *  inode,
struct file *  file,
unsigned int  cmd,
unsigned long  arg
[static]
 

spidev_ioctl - read() hook for kernel

Parameters:
inode: kernel inode structure
file: kernel file structure
cmd: ioctl command code
arg: ioctl command argument

Here is the call graph for this function:

int spidev_open struct inode *  inode,
struct file *  file
[static]
 

spidev_open - open() hook for kernel

Parameters:
inode: kernel inode structure
file: kernel file structure

ssize_t spidev_read struct file *  file,
char *  buf,
size_t  count,
loff_t *  offset
[static]
 

spidev_read - read() hook for kernel

Parameters:
file: kernel file structure
buf: buffer for bytes to send
count: number of bytes to send
offset: not used

Here is the call graph for this function:

int spidev_release struct inode *  inode,
struct file *  file
[static]
 

spidev_release - close() hook for kernel

Parameters:
inode: kernel inode structure
file: kernel file structure

ssize_t spidev_write struct file *  file,
const char *  buf,
size_t  count,
loff_t *  offset
[static]
 

spidev_write - write() hook for kernel

Parameters:
file: kernel file structure
buf: buffer for bytes to send
count: number of bytes to send
offset: not used

Here is the call graph for this function:


Variable Documentation

struct spi_client spidev_client_template [static]
 

Initial value:

 {
        name:           "SPI /dev entry",
        adapter:        NULL,
        driver:         &spidev_driver,
        addr:           0,
}

struct spi_driver spidev_driver [static]
 

Initial value:

 {
        name:           "spi-dev dummy driver",
        flags:          SPI_DF_DUMMY,
        attach_adapter: spidev_attach_adapter,
        detach_client:  spidev_detach_client,
        command:        spidev_command,
        inc_use:        NULL,
        dec_use:        NULL,
}
spidev_driver struct to register us as a spi driver to spi-core

struct file_operations spidev_fops [static]
 

Initial value:

 {

        owner:          THIS_MODULE,




        llseek:         no_llseek,

        read:           spidev_read,
        write:          spidev_write,
        ioctl:          spidev_ioctl,
        open:           spidev_open,
        release:        spidev_release,
}


Generated on Sun Oct 24 20:23:14 2004 for Linux SPI subsystem by doxygen 1.3.6