1*79fc540fSWolfram Sang /* SPDX-License-Identifier: GPL-2.0 */
2*79fc540fSWolfram Sang #ifndef __I2C_OMAP_H__
3*79fc540fSWolfram Sang #define __I2C_OMAP_H__
4*79fc540fSWolfram Sang 
5*79fc540fSWolfram Sang #include <linux/platform_device.h>
6*79fc540fSWolfram Sang 
7*79fc540fSWolfram Sang /*
8*79fc540fSWolfram Sang  * Version 2 of the I2C peripheral unit has a different register
9*79fc540fSWolfram Sang  * layout and extra registers.  The ID register in the V2 peripheral
10*79fc540fSWolfram Sang  * unit on the OMAP4430 reports the same ID as the V1 peripheral
11*79fc540fSWolfram Sang  * unit on the OMAP3530, so we must inform the driver which IP
12*79fc540fSWolfram Sang  * version we know it is running on from platform / cpu-specific
13*79fc540fSWolfram Sang  * code using these constants in the hwmod class definition.
14*79fc540fSWolfram Sang  */
15*79fc540fSWolfram Sang 
16*79fc540fSWolfram Sang #define OMAP_I2C_IP_VERSION_1 1
17*79fc540fSWolfram Sang #define OMAP_I2C_IP_VERSION_2 2
18*79fc540fSWolfram Sang 
19*79fc540fSWolfram Sang /* struct omap_i2c_bus_platform_data .flags meanings */
20*79fc540fSWolfram Sang 
21*79fc540fSWolfram Sang #define OMAP_I2C_FLAG_NO_FIFO			BIT(0)
22*79fc540fSWolfram Sang #define OMAP_I2C_FLAG_SIMPLE_CLOCK		BIT(1)
23*79fc540fSWolfram Sang #define OMAP_I2C_FLAG_16BIT_DATA_REG		BIT(2)
24*79fc540fSWolfram Sang #define OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK	BIT(5)
25*79fc540fSWolfram Sang #define OMAP_I2C_FLAG_FORCE_19200_INT_CLK	BIT(6)
26*79fc540fSWolfram Sang /* how the CPU address bus must be translated for I2C unit access */
27*79fc540fSWolfram Sang #define OMAP_I2C_FLAG_BUS_SHIFT_NONE 0
28*79fc540fSWolfram Sang #define OMAP_I2C_FLAG_BUS_SHIFT_1		BIT(7)
29*79fc540fSWolfram Sang #define OMAP_I2C_FLAG_BUS_SHIFT_2		BIT(8)
30*79fc540fSWolfram Sang #define OMAP_I2C_FLAG_BUS_SHIFT__SHIFT 7
31*79fc540fSWolfram Sang 
32*79fc540fSWolfram Sang struct omap_i2c_bus_platform_data {
33*79fc540fSWolfram Sang 	u32		clkrate;
34*79fc540fSWolfram Sang 	u32		rev;
35*79fc540fSWolfram Sang 	u32		flags;
36*79fc540fSWolfram Sang 	void		(*set_mpu_wkup_lat)(struct device *dev, long set);
37*79fc540fSWolfram Sang };
38*79fc540fSWolfram Sang 
39*79fc540fSWolfram Sang #endif
40