Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
bbc_i2c.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <asm/bbc.h>
#include <asm/io.h>
#include "bbc_i2c.h"

Go to the source code of this file.

Macros

#define I2C_PCF_PIN   0x80
 
#define I2C_PCF_ESO   0x40
 
#define I2C_PCF_ES1   0x20
 
#define I2C_PCF_ES2   0x10
 
#define I2C_PCF_ENI   0x08
 
#define I2C_PCF_STA   0x04
 
#define I2C_PCF_STO   0x02
 
#define I2C_PCF_ACK   0x01
 
#define I2C_PCF_START   (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ENI | I2C_PCF_STA | I2C_PCF_ACK)
 
#define I2C_PCF_STOP   (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STO | I2C_PCF_ACK)
 
#define I2C_PCF_REPSTART   ( I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
 
#define I2C_PCF_IDLE   (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ACK)
 
#define I2C_PCF_INI   0x40 /* 1 if not initialized */
 
#define I2C_PCF_STS   0x20
 
#define I2C_PCF_BER   0x10
 
#define I2C_PCF_AD0   0x08
 
#define I2C_PCF_LRB   0x08
 
#define I2C_PCF_AAS   0x04
 
#define I2C_PCF_LAB   0x02
 
#define I2C_PCF_BB   0x01
 
#define claim_device(BP, ECHILD)   set_device_claimage(BP,ECHILD,1)
 
#define release_device(BP, ECHILD)   set_device_claimage(BP,ECHILD,0)
 

Functions

struct platform_devicebbc_i2c_getdev (struct bbc_i2c_bus *bp, int index)
 
struct bbc_i2c_clientbbc_i2c_attach (struct bbc_i2c_bus *bp, struct platform_device *op)
 
void bbc_i2c_detach (struct bbc_i2c_client *client)
 
int bbc_i2c_writeb (struct bbc_i2c_client *client, unsigned char val, int off)
 
int bbc_i2c_readb (struct bbc_i2c_client *client, unsigned char *byte, int off)
 
int bbc_i2c_write_buf (struct bbc_i2c_client *client, char *buf, int len, int off)
 
int bbc_i2c_read_buf (struct bbc_i2c_client *client, char *buf, int len, int off)
 
 EXPORT_SYMBOL (bbc_i2c_getdev)
 
 EXPORT_SYMBOL (bbc_i2c_attach)
 
 EXPORT_SYMBOL (bbc_i2c_detach)
 
 EXPORT_SYMBOL (bbc_i2c_writeb)
 
 EXPORT_SYMBOL (bbc_i2c_readb)
 
 EXPORT_SYMBOL (bbc_i2c_write_buf)
 
 EXPORT_SYMBOL (bbc_i2c_read_buf)
 
int bbc_envctrl_init (struct bbc_i2c_bus *bp)
 
void bbc_envctrl_cleanup (struct bbc_i2c_bus *bp)
 
 MODULE_DEVICE_TABLE (of, bbc_i2c_match)
 
 module_platform_driver (bbc_i2c_driver)
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define claim_device (   BP,
  ECHILD 
)    set_device_claimage(BP,ECHILD,1)

Definition at line 66 of file bbc_i2c.c.

#define I2C_PCF_AAS   0x04

Definition at line 43 of file bbc_i2c.c.

#define I2C_PCF_ACK   0x01

Definition at line 31 of file bbc_i2c.c.

#define I2C_PCF_AD0   0x08

Definition at line 41 of file bbc_i2c.c.

#define I2C_PCF_BB   0x01

Definition at line 45 of file bbc_i2c.c.

#define I2C_PCF_BER   0x10

Definition at line 40 of file bbc_i2c.c.

#define I2C_PCF_ENI   0x08

Definition at line 28 of file bbc_i2c.c.

#define I2C_PCF_ES1   0x20

Definition at line 26 of file bbc_i2c.c.

#define I2C_PCF_ES2   0x10

Definition at line 27 of file bbc_i2c.c.

#define I2C_PCF_ESO   0x40

Definition at line 25 of file bbc_i2c.c.

#define I2C_PCF_IDLE   (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ACK)

Definition at line 36 of file bbc_i2c.c.

#define I2C_PCF_INI   0x40 /* 1 if not initialized */

Definition at line 38 of file bbc_i2c.c.

#define I2C_PCF_LAB   0x02

Definition at line 44 of file bbc_i2c.c.

#define I2C_PCF_LRB   0x08

Definition at line 42 of file bbc_i2c.c.

#define I2C_PCF_PIN   0x80

Definition at line 24 of file bbc_i2c.c.

#define I2C_PCF_REPSTART   ( I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)

Definition at line 35 of file bbc_i2c.c.

#define I2C_PCF_STA   0x04

Definition at line 29 of file bbc_i2c.c.

#define I2C_PCF_START   (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ENI | I2C_PCF_STA | I2C_PCF_ACK)

Definition at line 33 of file bbc_i2c.c.

#define I2C_PCF_STO   0x02

Definition at line 30 of file bbc_i2c.c.

#define I2C_PCF_STOP   (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STO | I2C_PCF_ACK)

Definition at line 34 of file bbc_i2c.c.

#define I2C_PCF_STS   0x20

Definition at line 39 of file bbc_i2c.c.

#define release_device (   BP,
  ECHILD 
)    set_device_claimage(BP,ECHILD,0)

Definition at line 67 of file bbc_i2c.c.

Function Documentation

void bbc_envctrl_cleanup ( struct bbc_i2c_bus bp)

Definition at line 588 of file bbc_envctrl.c.

int bbc_envctrl_init ( struct bbc_i2c_bus bp)

Definition at line 560 of file bbc_envctrl.c.

struct bbc_i2c_client* bbc_i2c_attach ( struct bbc_i2c_bus bp,
struct platform_device op 
)
read

Definition at line 89 of file bbc_i2c.c.

void bbc_i2c_detach ( struct bbc_i2c_client client)

Definition at line 114 of file bbc_i2c.c.

struct platform_device* bbc_i2c_getdev ( struct bbc_i2c_bus bp,
int  index 
)
read

Definition at line 69 of file bbc_i2c.c.

int bbc_i2c_read_buf ( struct bbc_i2c_client client,
char buf,
int  len,
int  off 
)

Definition at line 246 of file bbc_i2c.c.

int bbc_i2c_readb ( struct bbc_i2c_client client,
unsigned char byte,
int  off 
)

Definition at line 181 of file bbc_i2c.c.

int bbc_i2c_write_buf ( struct bbc_i2c_client client,
char buf,
int  len,
int  off 
)

Definition at line 230 of file bbc_i2c.c.

int bbc_i2c_writeb ( struct bbc_i2c_client client,
unsigned char  val,
int  off 
)

Definition at line 150 of file bbc_i2c.c.

EXPORT_SYMBOL ( bbc_i2c_getdev  )
EXPORT_SYMBOL ( bbc_i2c_attach  )
EXPORT_SYMBOL ( bbc_i2c_detach  )
EXPORT_SYMBOL ( bbc_i2c_writeb  )
EXPORT_SYMBOL ( bbc_i2c_readb  )
EXPORT_SYMBOL ( bbc_i2c_write_buf  )
EXPORT_SYMBOL ( bbc_i2c_read_buf  )
MODULE_DEVICE_TABLE ( of  ,
bbc_i2c_match   
)
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( bbc_i2c_driver  )