Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sead3-pic32-i2c-drv.c File Reference
#include <linux/delay.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/slab.h>

Go to the source code of this file.

Data Structures

struct  i2c_platform_data
 

Macros

#define PIC32_I2CxCON   0x0000
 
#define PIC32_I2CxCONCLR   0x0004
 
#define PIC32_I2CxCONSET   0x0008
 
#define PIC32_I2CxCONINV   0x000C
 
#define I2CCON_ON   (1<<15)
 
#define I2CCON_FRZ   (1<<14)
 
#define I2CCON_SIDL   (1<<13)
 
#define I2CCON_SCLREL   (1<<12)
 
#define I2CCON_STRICT   (1<<11)
 
#define I2CCON_A10M   (1<<10)
 
#define I2CCON_DISSLW   (1<<9)
 
#define I2CCON_SMEN   (1<<8)
 
#define I2CCON_GCEN   (1<<7)
 
#define I2CCON_STREN   (1<<6)
 
#define I2CCON_ACKDT   (1<<5)
 
#define I2CCON_ACKEN   (1<<4)
 
#define I2CCON_RCEN   (1<<3)
 
#define I2CCON_PEN   (1<<2)
 
#define I2CCON_RSEN   (1<<1)
 
#define I2CCON_SEN   (1<<0)
 
#define PIC32_I2CxSTAT   0x0010
 
#define PIC32_I2CxSTATCLR   0x0014
 
#define PIC32_I2CxSTATSET   0x0018
 
#define PIC32_I2CxSTATINV   0x001C
 
#define I2CSTAT_ACKSTAT   (1<<15)
 
#define I2CSTAT_TRSTAT   (1<<14)
 
#define I2CSTAT_BCL   (1<<10)
 
#define I2CSTAT_GCSTAT   (1<<9)
 
#define I2CSTAT_ADD10   (1<<8)
 
#define I2CSTAT_IWCOL   (1<<7)
 
#define I2CSTAT_I2COV   (1<<6)
 
#define I2CSTAT_DA   (1<<5)
 
#define I2CSTAT_P   (1<<4)
 
#define I2CSTAT_S   (1<<3)
 
#define I2CSTAT_RW   (1<<2)
 
#define I2CSTAT_RBF   (1<<1)
 
#define I2CSTAT_TBF   (1<<0)
 
#define PIC32_I2CxADD   0x0020
 
#define PIC32_I2CxADDCLR   0x0024
 
#define PIC32_I2CxADDSET   0x0028
 
#define PIC32_I2CxADDINV   0x002C
 
#define PIC32_I2CxMSK   0x0030
 
#define PIC32_I2CxMSKCLR   0x0034
 
#define PIC32_I2CxMSKSET   0x0038
 
#define PIC32_I2CxMSKINV   0x003C
 
#define PIC32_I2CxBRG   0x0040
 
#define PIC32_I2CxBRGCLR   0x0044
 
#define PIC32_I2CxBRGSET   0x0048
 
#define PIC32_I2CxBRGINV   0x004C
 
#define PIC32_I2CxTRN   0x0050
 
#define PIC32_I2CxTRNCLR   0x0054
 
#define PIC32_I2CxTRNSET   0x0058
 
#define PIC32_I2CxTRNINV   0x005C
 
#define PIC32_I2CxRCV   0x0060
 
#define __BUFSIZE   80
 
#define i2c_platform_suspend   NULL
 
#define i2c_platform_resume   NULL
 

Functions

u32 pic32_bus_readl (u32 reg)
 
void pic32_bus_writel (u32 val, u32 reg)
 
 MODULE_AUTHOR ("Chris Dearman, MIPS Technologies INC.")
 
 MODULE_DESCRIPTION ("PIC32 I2C driver")
 
 MODULE_LICENSE ("GPL")
 
 module_init (i2c_platform_init)
 
 module_exit (i2c_platform_exit)
 

Macro Definition Documentation

#define __BUFSIZE   80
#define i2c_platform_resume   NULL

Definition at line 402 of file sead3-pic32-i2c-drv.c.

#define i2c_platform_suspend   NULL

Definition at line 401 of file sead3-pic32-i2c-drv.c.

#define I2CCON_A10M   (1<<10)

Definition at line 27 of file sead3-pic32-i2c-drv.c.

#define I2CCON_ACKDT   (1<<5)

Definition at line 32 of file sead3-pic32-i2c-drv.c.

#define I2CCON_ACKEN   (1<<4)

Definition at line 33 of file sead3-pic32-i2c-drv.c.

#define I2CCON_DISSLW   (1<<9)

Definition at line 28 of file sead3-pic32-i2c-drv.c.

#define I2CCON_FRZ   (1<<14)

Definition at line 23 of file sead3-pic32-i2c-drv.c.

#define I2CCON_GCEN   (1<<7)

Definition at line 30 of file sead3-pic32-i2c-drv.c.

#define I2CCON_ON   (1<<15)

Definition at line 22 of file sead3-pic32-i2c-drv.c.

#define I2CCON_PEN   (1<<2)

Definition at line 35 of file sead3-pic32-i2c-drv.c.

#define I2CCON_RCEN   (1<<3)

Definition at line 34 of file sead3-pic32-i2c-drv.c.

#define I2CCON_RSEN   (1<<1)

Definition at line 36 of file sead3-pic32-i2c-drv.c.

#define I2CCON_SCLREL   (1<<12)

Definition at line 25 of file sead3-pic32-i2c-drv.c.

#define I2CCON_SEN   (1<<0)

Definition at line 37 of file sead3-pic32-i2c-drv.c.

#define I2CCON_SIDL   (1<<13)

Definition at line 24 of file sead3-pic32-i2c-drv.c.

#define I2CCON_SMEN   (1<<8)

Definition at line 29 of file sead3-pic32-i2c-drv.c.

#define I2CCON_STREN   (1<<6)

Definition at line 31 of file sead3-pic32-i2c-drv.c.

#define I2CCON_STRICT   (1<<11)

Definition at line 26 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_ACKSTAT   (1<<15)

Definition at line 43 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_ADD10   (1<<8)

Definition at line 47 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_BCL   (1<<10)

Definition at line 45 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_DA   (1<<5)

Definition at line 50 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_GCSTAT   (1<<9)

Definition at line 46 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_I2COV   (1<<6)

Definition at line 49 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_IWCOL   (1<<7)

Definition at line 48 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_P   (1<<4)

Definition at line 51 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_RBF   (1<<1)

Definition at line 54 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_RW   (1<<2)

Definition at line 53 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_S   (1<<3)

Definition at line 52 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_TBF   (1<<0)

Definition at line 55 of file sead3-pic32-i2c-drv.c.

#define I2CSTAT_TRSTAT   (1<<14)

Definition at line 44 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxADD   0x0020

Definition at line 57 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxADDCLR   0x0024

Definition at line 58 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxADDINV   0x002C

Definition at line 60 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxADDSET   0x0028

Definition at line 59 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxBRG   0x0040

Definition at line 65 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxBRGCLR   0x0044

Definition at line 66 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxBRGINV   0x004C

Definition at line 68 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxBRGSET   0x0048

Definition at line 67 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxCON   0x0000

Definition at line 18 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxCONCLR   0x0004

Definition at line 19 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxCONINV   0x000C

Definition at line 21 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxCONSET   0x0008

Definition at line 20 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxMSK   0x0030

Definition at line 61 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxMSKCLR   0x0034

Definition at line 62 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxMSKINV   0x003C

Definition at line 64 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxMSKSET   0x0038

Definition at line 63 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxRCV   0x0060

Definition at line 73 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxSTAT   0x0010

Definition at line 39 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxSTATCLR   0x0014

Definition at line 40 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxSTATINV   0x001C

Definition at line 42 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxSTATSET   0x0018

Definition at line 41 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxTRN   0x0050

Definition at line 69 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxTRNCLR   0x0054

Definition at line 70 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxTRNINV   0x005C

Definition at line 72 of file sead3-pic32-i2c-drv.c.

#define PIC32_I2CxTRNSET   0x0058

Definition at line 71 of file sead3-pic32-i2c-drv.c.

Function Documentation

MODULE_AUTHOR ( "Chris  Dearman,
MIPS Technologies INC."   
)
MODULE_DESCRIPTION ( "PIC32 I2C driver )
module_exit ( i2c_platform_exit  )
module_init ( i2c_platform_init  )
MODULE_LICENSE ( "GPL"  )
u32 pic32_bus_readl ( u32  reg)

Definition at line 59 of file sead3-pic32-bus.c.

void pic32_bus_writel ( u32  val,
u32  reg 
)

Definition at line 83 of file sead3-pic32-bus.c.