#include <linux/module.h>
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/string.h>
#include <linux/init.h>
#include <linux/mutex.h>
#include <asm/etraxi2c.h>
#include <asm/io.h>
#include <asm/delay.h>
#include "i2c.h"
Go to the source code of this file.
#define CLOCK_HIGH_TIME 8 |
Definition at line 53 of file i2c.c.
Definition at line 52 of file i2c.c.
! ! FILE NAME : i2c.c ! ! DESCRIPTION: implements an interface for IIC/I2C, both directly from other ! kernel modules (i2c_writereg/readreg) and from userspace using ! ioctl()'s ! ! Nov 30 1998 Torbjorn Eliasson Initial version. ! Bjorn Wesen Elinux kernel version. ! Jan 14 2000 Johan Adolfsson Fixed PB shadow register stuff - ! don't use PB_I2C if DS1302 uses same bits, ! use PB. | June 23 2003 Pieter Grimmerink Added 'i2c_sendnack'. i2c_readreg now | generates nack on last received byte, | instead of ack. | i2c_getack changed data level while clock | was high, causing DS75 to see a stop condition ! ! ------------------------------------------------------------------------— ! ! (C) Copyright 1999-2007 Axis Communications AB, LUND, SWEDEN ! !
Definition at line 46 of file i2c.c.
#define ENABLE_INPUT 0x00 |
Definition at line 57 of file i2c.c.
#define ENABLE_OUTPUT 0x01 |
Definition at line 56 of file i2c.c.
#define i2c_clk |
( |
|
x | ) |
crisv32_io_set(&cris_i2c_clk, x) |
Definition at line 73 of file i2c.c.
Definition at line 58 of file i2c.c.
Definition at line 59 of file i2c.c.
#define i2c_data |
( |
|
x | ) |
crisv32_io_set(&cris_i2c_data, x) |
Definition at line 74 of file i2c.c.
Definition at line 60 of file i2c.c.
Definition at line 61 of file i2c.c.
Definition at line 80 of file i2c.c.
Definition at line 69 of file i2c.c.
Definition at line 68 of file i2c.c.
Definition at line 64 of file i2c.c.
Definition at line 63 of file i2c.c.
#define i2c_getbit |
( |
| ) |
crisv32_io_rd(&cris_i2c_data) |
Definition at line 78 of file i2c.c.
#define I2C_MAJOR 123 /* LOCAL/EXPERIMENTAL */ |
Definition at line 48 of file i2c.c.
#define START_CONDITION_HOLD_TIME 8 |
Definition at line 54 of file i2c.c.
#define STOP_CONDITION_HOLD_TIME 8 |
Definition at line 55 of file i2c.c.
unsigned char i2c_readreg |
( |
unsigned char |
theSlave, |
|
|
unsigned char |
theReg |
|
) |
| |
Definition at line 95 of file i2c.c.
int i2c_writereg |
( |
unsigned char |
theSlave, |
|
|
unsigned char |
theReg, |
|
|
unsigned char |
theValue |
|
) |
| |
module_init |
( |
i2c_register |
| ) |
|