1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2012 Samsung Electronics
17 struct exynos5_hsi2c {
49 struct s3c24x0_i2c_bus {
50 bool active; /* port is active and available */
51 int node; /* device tree node */
52 int bus_num; /* i2c bus number */
53 struct s3c24x0_i2c *regs;
54 struct exynos5_hsi2c *hsregs;
55 int is_highspeed; /* High speed type, rather than I2C */
56 unsigned clock_frequency;
68 #define I2C_NOK_LA 3 /* Lost arbitration */
69 #define I2C_NOK_TOUT 4 /* time out */
71 /* S3C I2C Controller bits */
72 #define I2CSTAT_BSY 0x20 /* Busy bit */
73 #define I2CSTAT_NACK 0x01 /* Nack bit */
74 #define I2CCON_ACKGEN 0x80 /* Acknowledge generation */
75 #define I2CCON_IRPND 0x10 /* Interrupt pending bit */
76 #define I2C_MODE_MT 0xC0 /* Master Transmit Mode */
77 #define I2C_MODE_MR 0x80 /* Master Receive Mode */
78 #define I2C_START_STOP 0x20 /* START / STOP */
79 #define I2C_TXRX_ENA 0x10 /* I2C Tx/Rx enable */
81 #define I2C_TIMEOUT_MS 10 /* 10 ms */
83 #endif /* _S3C24X0_I2C_H */