Vitaly Wool | 41561f2 | 2006-12-10 21:21:29 +0100 | [diff] [blame] | 1 | /* |
| 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 King | 2727f22 | 2008-08-08 15:13:27 +0100 | [diff] [blame] | 15 | struct platform_device; |
Russell King | 0321cb8 | 2009-11-20 11:12:26 +0000 | [diff] [blame] | 16 | struct clk; |
Vitaly Wool | 41561f2 | 2006-12-10 21:21:29 +0100 | [diff] [blame] | 17 | |
| 18 | struct 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 Wells | 4ced24c | 2009-11-12 00:23:00 +0100 | [diff] [blame] | 23 | u8 * buf; /* Data buffer */ |
Vitaly Wool | 41561f2 | 2006-12-10 21:21:29 +0100 | [diff] [blame] | 24 | int len; /* Length of data buffer */ |
| 25 | }; |
| 26 | |
| 27 | struct i2c_pnx_algo_data { |
Russell King | 88d968b | 2009-11-21 11:58:36 +0000 | [diff] [blame] | 28 | void __iomem *ioaddr; |
Vitaly Wool | 41561f2 | 2006-12-10 21:21:29 +0100 | [diff] [blame] | 29 | struct i2c_pnx_mif mif; |
| 30 | int last; |
Russell King | 0321cb8 | 2009-11-20 11:12:26 +0000 | [diff] [blame] | 31 | struct clk *clk; |
Russell King | 9d7f736 | 2009-11-21 12:25:27 +0000 | [diff] [blame] | 32 | struct i2c_pnx_data *i2c_pnx; |
| 33 | struct i2c_adapter adapter; |
Vitaly Wool | 41561f2 | 2006-12-10 21:21:29 +0100 | [diff] [blame] | 34 | }; |
| 35 | |
| 36 | struct i2c_pnx_data { |
Russell King | 9d7f736 | 2009-11-21 12:25:27 +0000 | [diff] [blame] | 37 | const char *name; |
Russell King | 44c5d73 | 2009-11-21 12:10:54 +0000 | [diff] [blame] | 38 | u32 base; |
| 39 | int irq; |
Vitaly Wool | 41561f2 | 2006-12-10 21:21:29 +0100 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | #endif /* __I2C_PNX_H__ */ |