xref: /rk3399_rockchip-uboot/include/max96745.h (revision f143afc2c5fe25515c8d3be25ce5ce68203fdedb)
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 /* 002Ah, 0034h */
21 #define LINK_LOCKED		BIT(0)
22 
23 /* 0076h, 0086h */
24 #define DIS_REM_CC		BIT(7)
25 
26 /* 0100h */
27 #define VID_LINK_SEL		GENMASK(2, 1)
28 #define VID_TX_EN		BIT(0)
29 
30 /* 0200h */
31 #define RES_CFG			BIT(7)
32 #define TX_COM_EN		BIT(5)
33 #define GPIO_OUT		BIT(4)
34 #define GPIO_IN			BIT(3)
35 #define GPIO_OUT_DIS		BIT(0)
36 
37 /* 0201h */
38 #define PULL_UPDN_SEL		GENMASK(7, 6)
39 #define OUT_TYPEC		BIT(5)
40 #define GPIO_TX_ID		GENMASK(4, 0)
41 
42 /* 0202h */
43 #define OVR_RES_CFG		BIT(7)
44 #define IO_EDGE_RATE		GENMASK(6, 5)
45 #define GPIO_RX_ID		GENMASK(4, 0)
46 
47 /* 0203h */
48 #define GPIO_IO_RX_EN		BIT(5)
49 #define GPIO_OUT_LGC		BIT(4)
50 #define GPIO_RX_EN_B		BIT(3)
51 #define GPIO_TX_EN_B		BIT(2)
52 #define GPIO_RX_EN_A		BIT(1)
53 #define GPIO_TX_EN_A		BIT(0)
54 
55 #endif
56