MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / drivers / i2c / busses / i2c-mcf.h
blob5714e7dc71a9b878c2201588d31bbe125248022b
1 /*
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.
25 Changes:
26 v0.1 26 March 2005
27 Initial Release - developed on uClinux with 2.6.9 kernel
28 v0.2 29 May 2006
29 Modified to be more generic and added support for
30 i2c_master_xfer
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__ */