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

spi_driver Struct Reference

A driver is capable of handling one or more physical devices present on SPI adapters. This information is used to inform the driver of adapter events. More...

#include <spi.h>

Collaboration diagram for spi_driver:

Collaboration graph
[legend]
List of all members.

Public Attributes

char name [32]
unsigned int flags
int(* attach_adapter )(struct spi_adapter *)
void(* detach_client )(struct spi_client *)
int(* command )(struct spi_client *client, unsigned int cmd, void *arg)
spi_ops * ops
module * owner
list_head drivers
void(* inc_use )(struct spi_client *client)
void(* dec_use )(struct spi_client *client)

Detailed Description

A driver is capable of handling one or more physical devices present on SPI adapters. This information is used to inform the driver of adapter events.

struct spi_driver


Member Data Documentation

int(* spi_driver::attach_adapter)(struct spi_adapter *)
 

Notifies the driver that a new bus has appeared. This routine can be used by the driver to test if the bus meets its conditions & seek for the presence of the chip(s) it supports. If found, it registers the client(s) that are on the bus to the spi admin. via spi_attach_client.

int(* spi_driver::command)(struct spi_client *client,unsigned int cmd, void *arg)
 

a ioctl like command that can be used to perform specific functions with the device.

void(* spi_driver::detach_client)(struct spi_client *)
 

Notifies the driver that the client has finished with its services, and any memory that it allocated for this client should be cleaned up. In addition the chip should be shut down.

void(* spi_driver::inc_use)(struct spi_client *client)
 

These two are mainly used for bookkeeping & dynamic unloading of kernel modules. inc_use tells the driver that a client is being used by another module & that it should increase its ref. counter. dec_use is the inverse operation. NB: Make sure you have no circular dependencies, or else you get a deadlock when trying to unload the modules. You should use the i2c_{inc,dec}_use_client functions instead of calling this function directly.

char spi_driver::name[32]
 

This name is used to uniquely identify the driver. It should be the same as the module name.

struct spi_ops* spi_driver::ops
 

Possible operations on the driver.

struct module* spi_driver::owner
 

Module structure, if any.


The documentation for this struct was generated from the following file:
Generated on Sun Oct 24 20:23:21 2004 for Linux SPI subsystem by doxygen 1.3.6