1 /*
2  * Copyright (c) 2021 Microchip Technology Inc.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 /** @file
7  * @brief Microchip XEC MCU family I2C port support.
8  *
9  */
10 
11 #ifndef _MICROCHIP_MEC_SOC_I2C_H_
12 #define _MICROCHIP_MEC_SOC_I2C_H_
13 
14 /* 144-pin package I2C port masks */
15 #if defined(CONFIG_SOC_MEC172X_NSZ)
16 #define MEC_I2C_PORT_MASK	0xFEFFU
17 #elif defined(CONFIG_SOC_MEC1501_HSZ)
18 #define MEC_I2C_PORT_MASK	0xFEFFU
19 #endif
20 
21 #define MCHP_I2C_PORT_0		0
22 #define MCHP_I2C_PORT_1		1
23 #define MCHP_I2C_PORT_2		2
24 #define MCHP_I2C_PORT_3		3
25 #define MCHP_I2C_PORT_4		4
26 #define MCHP_I2C_PORT_5		5
27 #define MCHP_I2C_PORT_6		6
28 #define MCHP_I2C_PORT_7		7
29 #define MCHP_I2C_PORT_8		8
30 #define MCHP_I2C_PORT_9		9
31 #define MCHP_I2C_PORT_10	10
32 #define MCHP_I2C_PORT_11	11
33 #define MCHP_I2C_PORT_12	12
34 #define MCHP_I2C_PORT_13	13
35 #define MCHP_I2C_PORT_14	14
36 #define MCHP_I2C_PORT_15	15
37 #define MCHP_I2C_PORT_MAX	16
38 
39 /*
40  * Read pin states of specified I2C port.
41  * We GPIO control register always active RO pad input bit.
42  * lines b[0]=SCL pin state at pad, b[1]=SDA pin state at pad
43  * Returns 0 success or -EINVAL if port is not support or lines is NULL.
44  */
45 #define SOC_I2C_SCL_POS		0
46 #define SOC_I2C_SDA_POS		1
47 
48 int soc_i2c_port_lines_get(uint8_t port, uint32_t *lines);
49 
50 #endif /* _MICROCHIP_MEC_SOC_I2C_H_ */
51