2 i2c-mcf5282.h - header file for i2c-mcf5282.c
4 Copyright (c) 2005, Derek CL Cheung <derek.cheung@sympatico.ca>
5 <http://www3.sympatico.ca/derek.cheung>
7 Copyright (c) 2006, emlix and Freescale
8 Sebastian Hess <sh@emlix.com>
9 Yaroslav Vinogradov <yaroslav.vinogradov@freescale.com>
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 Initial Release - developed on uClinux with 2.6.9 kernel
29 Modified to be more generic and added support for
34 #ifndef __I2C_MCF5282_H__
35 #define __I2C_MCF5282_H__
37 enum I2C_START_TYPE
{ FIRST_START
, REPEAT_START
};
38 enum I2C_ACK_TYPE
{ ACK
, NACK
};
40 /* Function prototypes */
41 static u32
coldfire_func(struct i2c_adapter
*adapter
);
42 static s32
coldfire_i2c_access(struct i2c_adapter
*adap
, u16 address
,
43 unsigned short flags
, char read_write
,
44 u8 command
, int size
, union i2c_smbus_data
*data
);
45 static int coldfire_write_data(const u8 data
);
46 static int coldfire_i2c_start(const char read_write
, const u16 target_address
, const enum I2C_START_TYPE i2c_start
);
47 static int coldfire_read_data(u8
* const rxData
, const enum I2C_ACK_TYPE ackType
);
48 static int coldfire_i2c_master(struct i2c_adapter
*adap
,struct i2c_msg
*msgs
, int num
);
49 void dumpReg(char *, u16 addr
, u8 data
);
51 /********************************************************************/
52 #endif /* __I2C_MCF5282_H__ */