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;
57 #if IS_ENABLED(CONFIG_ARCH_EXYNOS4) || IS_ENABLED(CONFIG_ARCH_EXYNOS5)
70 #define I2C_NOK_LA 3 /* Lost arbitration */
71 #define I2C_NOK_TOUT 4 /* time out */
73 /* S3C I2C Controller bits */
74 #define I2CSTAT_BSY 0x20 /* Busy bit */
75 #define I2CSTAT_NACK 0x01 /* Nack bit */
76 #define I2CCON_ACKGEN 0x80 /* Acknowledge generation */
77 #define I2CCON_IRPND 0x10 /* Interrupt pending bit */
78 #define I2C_MODE_MT 0xC0 /* Master Transmit Mode */
79 #define I2C_MODE_MR 0x80 /* Master Receive Mode */
80 #define I2C_START_STOP 0x20 /* START / STOP */
81 #define I2C_TXRX_ENA 0x10 /* I2C Tx/Rx enable */
83 #define I2C_TIMEOUT_MS 10 /* 10 ms */
85 #endif /* _S3C24X0_I2C_H */