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