Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
ssp.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/io.h>
#include <mach/hardware.h>
#include <mach/irqs.h>
#include <asm/hardware/ssp.h>

Go to the source code of this file.

Macros

#define TIMEOUT   100000
 

Functions

int ssp_write_word (u16 data)
 
int ssp_read_word (u16 *data)
 
int ssp_flush (void)
 
void ssp_enable (void)
 
void ssp_disable (void)
 
void ssp_save_state (struct ssp_state *ssp)
 
void ssp_restore_state (struct ssp_state *ssp)
 
int ssp_init (void)
 
void ssp_exit (void)
 
 MODULE_AUTHOR ("Russell King")
 
 MODULE_DESCRIPTION ("SA11x0 SSP PIO driver")
 
 MODULE_LICENSE ("GPL")
 
 EXPORT_SYMBOL (ssp_write_word)
 
 EXPORT_SYMBOL (ssp_read_word)
 
 EXPORT_SYMBOL (ssp_flush)
 
 EXPORT_SYMBOL (ssp_enable)
 
 EXPORT_SYMBOL (ssp_disable)
 
 EXPORT_SYMBOL (ssp_save_state)
 
 EXPORT_SYMBOL (ssp_restore_state)
 
 EXPORT_SYMBOL (ssp_init)
 
 EXPORT_SYMBOL (ssp_exit)
 

Macro Definition Documentation

#define TIMEOUT   100000

Definition at line 26 of file ssp.c.

Function Documentation

EXPORT_SYMBOL ( ssp_write_word  )
EXPORT_SYMBOL ( ssp_read_word  )
EXPORT_SYMBOL ( ssp_flush  )
EXPORT_SYMBOL ( ssp_enable  )
EXPORT_SYMBOL ( ssp_disable  )
EXPORT_SYMBOL ( ssp_save_state  )
EXPORT_SYMBOL ( ssp_restore_state  )
EXPORT_SYMBOL ( ssp_init  )
EXPORT_SYMBOL ( ssp_exit  )
MODULE_AUTHOR ( "Russell King"  )
MODULE_DESCRIPTION ( "SA11x0 SSP PIO driver )
MODULE_LICENSE ( "GPL"  )
void ssp_disable ( void  )

ssp_disable - shut down the SSP port

Turn off the SSP port, optionally powering it down.

Definition at line 150 of file ssp.c.

void ssp_enable ( void  )

ssp_enable - enable the SSP port

Turn on the SSP port.

Definition at line 140 of file ssp.c.

void ssp_exit ( void  )

ssp_exit - undo the effects of ssp_init

release and free resources for the SSP port.

Definition at line 223 of file ssp.c.

int ssp_flush ( void  )

ssp_flush - flush the transmit and receive FIFOs

Wait for the SSP to idle, and ensure that the receive FIFO is empty.

The caller is expected to perform the necessary locking.

Returns: %-ETIMEDOUT timeout occurred 0 success

Definition at line 118 of file ssp.c.

int ssp_init ( void  )

ssp_init - setup the SSP port

initialise and claim resources for the SSP port.

Returns: %-ENODEV if the SSP port is unavailable %-EBUSY if the resources are already in use %0 on success

Definition at line 194 of file ssp.c.

int ssp_read_word ( u16 data)

ssp_read_word - read a word from the SSP port

Wait for a data word in the SSP receive FIFO, and return the received data. Data is LSB justified.

Note: Currently, if data is not expected to be received, this function will wait for ever.

The caller is expected to perform the necessary locking.

Returns: %-ETIMEDOUT timeout occurred 16-bit data success

Definition at line 91 of file ssp.c.

void ssp_restore_state ( struct ssp_state ssp)

ssp_restore_state - restore a previously saved SSP configuration : pointer to configuration saved by ssp_save_state

Restore the SSP configuration saved previously by ssp_save_state.

Definition at line 175 of file ssp.c.

void ssp_save_state ( struct ssp_state ssp)

ssp_save_state - save the SSP configuration : pointer to structure to save SSP configuration

Save the configured SSP state for suspend.

Definition at line 161 of file ssp.c.

int ssp_write_word ( u16  data)

ssp_write_word - write a word to the SSP port : 16-bit, MSB justified data to write.

Wait for a free entry in the SSP transmit FIFO, and write a data word to the SSP port. Wait for the SSP port to start sending the data.

The caller is expected to perform the necessary locking.

Returns: %-ETIMEDOUT timeout occurred 0 success

Definition at line 54 of file ssp.c.