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

spi-algo-mpc5200psc.c File Reference

SPI algorithm driver for MPC5200. More...

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/string.h>
#include <asm/io.h>
#include <asm/mpc5xxx.h>
#include <linux/spi.h>
#include "spi-algo-mpc5200psc.h"

Include dependency graph for spi-algo-mpc5200psc.c:

Include dependency graph

Defines

#define MPC5xxx_SCAN   1
#define MPC5xxx_TIMEOUT   100
#define MPC5xxx_RETRIES   3

Functions

 MODULE_PARM (speed,"i")
int mpc5xxx_get_fdr (void)
 Calculate best fit frequency divisin ratio.

void mpc5200psc_spi_init (struct spi_algo_mpc5xxx_data *algo_data)
 Initialize PSC as SPI At the moment, hard wired to PSC3. In future it will be at any PSC.

int mpc5xxx_xferbytes (struct spi_adapter *adap, char *buf, int count, int flags)
 transfer bytes via SPI bus. Send data out via MOSI and inputs data from MISO

int mpc5xxx_xfer (struct spi_adapter *adap, struct spi_msg msgs[], int num)
int spi_mpc5xxx_add_bus (struct spi_adapter *adap)
 registers spi bus adapter with our algorithm to spi subsystem

int spi_mpc5xxx_del_bus (struct spi_adapter *adap)
 EXPORT_SYMBOL (spi_mpc5xxx_add_bus)
 EXPORT_SYMBOL (spi_mpc5xxx_del_bus)
 MODULE_LICENSE ("GPL")
 MODULE_AUTHOR ("Kate Alhola kate(at) katix.org")
 MODULE_DESCRIPTION ("SPI-Bus MPC5200 psc spi algorithm module")

Variables

int speed = 100
spi_algorithm mpc5xxx_algo

Detailed Description

SPI algorithm driver for MPC5200.


Function Documentation

void mpc5200psc_spi_init struct spi_algo_mpc5xxx_data *  algo_data  )  [static]
 

Initialize PSC as SPI At the moment, hard wired to PSC3. In future it will be at any PSC.

mpc5200psc_spi_init

Parameters:
algo_data 

int mpc5xxx_get_fdr void   )  [static]
 

Calculate best fit frequency divisin ratio.

mpc5xxx_get_fdr

Returns:
divisor

int mpc5xxx_xferbytes struct spi_adapter adap,
char *  buf,
int  count,
int  flags
[static]
 

transfer bytes via SPI bus. Send data out via MOSI and inputs data from MISO

mpc5xxx_xferbytes

Parameters:
adap spi adapter structure
buf message buffer
count number of bytes to transfer
flafs read / write mode flag
Returns:
number of bytes transfereg

Here is the call graph for this function:

int spi_mpc5xxx_add_bus struct spi_adapter adap  ) 
 

registers spi bus adapter with our algorithm to spi subsystem

spi_mpc5xxx_add_bus

Parameters:
adap spi adapter structure
Returns:
0 in sucess -1 in error

Here is the call graph for this function:


Variable Documentation

struct spi_algorithm mpc5xxx_algo [static]
 

Initial value:

 {
        "MPC5xxx algorithm",
        mpc5xxx_xfer
}


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