blob: 5388326fbbff41dc9c003dca6cbe2bd4f71723ad [file] [log] [blame]
Vitaly Wool41561f22006-12-10 21:21:29 +01001/*
2 * Header file for I2C support on PNX010x/4008.
3 *
4 * Author: Dennis Kovalev <dkovalev@ru.mvista.com>
5 *
6 * 2004-2006 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12#ifndef __I2C_PNX_H__
13#define __I2C_PNX_H__
14
Russell King2727f222008-08-08 15:13:27 +010015struct platform_device;
Russell King0321cb82009-11-20 11:12:26 +000016struct clk;
Vitaly Wool41561f22006-12-10 21:21:29 +010017
18struct i2c_pnx_mif {
19 int ret; /* Return value */
20 int mode; /* Interface mode */
21 struct completion complete; /* I/O completion */
22 struct timer_list timer; /* Timeout */
Kevin Wells4ced24c2009-11-12 00:23:00 +010023 u8 * buf; /* Data buffer */
Vitaly Wool41561f22006-12-10 21:21:29 +010024 int len; /* Length of data buffer */
Roland Stiggec076ada42012-08-08 09:42:32 +020025 int order; /* RX Bytes to order via TX */
Vitaly Wool41561f22006-12-10 21:21:29 +010026};
27
28struct i2c_pnx_algo_data {
Russell King88d968b2009-11-21 11:58:36 +000029 void __iomem *ioaddr;
Vitaly Wool41561f22006-12-10 21:21:29 +010030 struct i2c_pnx_mif mif;
31 int last;
Russell King0321cb82009-11-20 11:12:26 +000032 struct clk *clk;
Russell King9d7f7362009-11-21 12:25:27 +000033 struct i2c_adapter adapter;
Roland Stigge1451ba32012-04-22 11:59:47 +020034 int irq;
Roland Stiggeb41a2162012-04-22 11:59:47 +020035 u32 timeout;
Vitaly Wool41561f22006-12-10 21:21:29 +010036};
37
38#endif /* __I2C_PNX_H__ */