xref: /OK3568_Linux_fs/u-boot/include/max96745.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * (C) Copyright 2022 Rockchip Electronics Co., Ltd
4  */
5 
6 #ifndef _MAX96745_H_
7 #define _MAX96745_H_
8 
9 #include <linux/bitfield.h>
10 
11 #define GPIO_A_REG(gpio)	(0x0200 + ((gpio) * 8))
12 #define GPIO_B_REG(gpio)	(0x0201 + ((gpio) * 8))
13 #define GPIO_C_REG(gpio)	(0x0202 + ((gpio) * 8))
14 #define GPIO_D_REG(gpio)	(0x0203 + ((gpio) * 8))
15 
16 /* 0010h */
17 #define RESET_ALL		BIT(7)
18 #define SLEEP			BIT(3)
19 
20 /* 0011h */
21 #define CXTP_B			BIT(2)
22 #define CXTP_A			BIT(0)
23 
24 /* 0028h, 0032h */
25 #define LINK_EN			BIT(7)
26 #define TX_RATE			GENMASK(3, 2)
27 
28 /* 0029h, 0033h */
29 #define RESET_LINK		BIT(0)
30 #define RESET_ONESHOT		BIT(1)
31 
32 /* 002Ah, 0034h */
33 #define LINK_LOCKED		BIT(0)
34 
35 /* 0076h, 0086h */
36 #define DIS_REM_CC		BIT(7)
37 
38 /* 0100h */
39 #define VID_LINK_SEL		GENMASK(2, 1)
40 #define VID_TX_EN		BIT(0)
41 
42 /* 0200h */
43 #define RES_CFG			BIT(7)
44 #define TX_COM_EN		BIT(5)
45 #define GPIO_OUT		BIT(4)
46 #define GPIO_IN			BIT(3)
47 #define GPIO_OUT_DIS		BIT(0)
48 
49 /* 0201h */
50 #define PULL_UPDN_SEL		GENMASK(7, 6)
51 #define OUT_TYPEC		BIT(5)
52 #define GPIO_TX_ID		GENMASK(4, 0)
53 
54 /* 0202h */
55 #define OVR_RES_CFG		BIT(7)
56 #define IO_EDGE_RATE		GENMASK(6, 5)
57 #define GPIO_RX_ID		GENMASK(4, 0)
58 
59 /* 0203h */
60 #define GPIO_IO_RX_EN		BIT(5)
61 #define GPIO_OUT_LGC		BIT(4)
62 #define GPIO_RX_EN_B		BIT(3)
63 #define GPIO_TX_EN_B		BIT(2)
64 #define GPIO_RX_EN_A		BIT(1)
65 #define GPIO_TX_EN_A		BIT(0)
66 
67 #endif
68