xref: /OK3568_Linux_fs/kernel/include/linux/mfd/max96755f.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Defining registers address and its bit definitions of MAX96752F
4  *
5  * Copyright (c) 2022 Rockchip Electronics Co. Ltd.
6  */
7 
8 #ifndef _MFD_MAX96755F_H_
9 #define _MFD_MAX96755F_H_
10 
11 #include <linux/bitfield.h>
12 
13 struct max96755f {
14 	struct device *dev;
15 	struct regmap *regmap;
16 	struct i2c_mux_core *muxc;
17 	struct gpio_desc *enable_gpio;
18 	struct gpio_desc *reset_gpio;
19 	struct regulator *supply;
20 	struct gpio_desc *pwdnb_gpio;
21 	struct gpio_desc *lock_gpio;
22 	struct extcon_dev *extcon;
23 	bool split_mode;
24 };
25 
26 #define GPIO_A_REG(gpio)	(0x02be + ((gpio) * 3))
27 #define GPIO_B_REG(gpio)	(0x02bf + ((gpio) * 3))
28 #define GPIO_C_REG(gpio)	(0x02c0 + ((gpio) * 3))
29 
30 /* 0000h */
31 #define DEV_ADDR		GENMASK(7, 1)
32 #define CFG_BLOCK		BIT(0)
33 
34 /* 0001h */
35 #define IIC_2_EN		BIT(7)
36 #define IIC_1_EN		BIT(6)
37 #define DIS_REM_CC		BIT(4)
38 #define TX_RATE			GENMASK(3, 2)
39 
40 /* 0002h */
41 #define VID_TX_EN_U		BIT(7)
42 #define VID_TX_EN_Z		BIT(6)
43 #define VID_TX_EN_Y		BIT(5)
44 #define VID_TX_EN_X		BIT(4)
45 #define AUD_TX_EN_Y		BIT(3)
46 #define AUD_TX_EN_X		BIT(2)
47 
48 /* 0003h */
49 #define UART_2_EN		BIT(5)
50 #define UART_1_EN		BIT(4)
51 
52 /* 0005h */
53 #define LOCK_EN			BIT(7)
54 #define ERRB_EN			BIT(6)
55 #define PU_LF3			BIT(3)
56 #define PU_LF2			BIT(2)
57 #define PU_LF1			BIT(1)
58 #define PU_LF0			BIT(0)
59 
60 /* 0006h */
61 #define RCLKEN			BIT(5)
62 
63 /* 0010h */
64 #define RESET_ALL		BIT(7)
65 #define RESET_LINK		BIT(6)
66 #define RESET_ONESHOT		BIT(5)
67 #define AUTO_LINK		BIT(4)
68 #define SLEEP			BIT(3)
69 #define REG_ENABLE		BIT(2)
70 #define LINK_CFG		GENMASK(1, 0)
71 
72 /* 0013h */
73 #define LINK_MODE		GENMASK(5, 4)
74 #define	LOCKED			BIT(3)
75 
76 /* 0026h */
77 #define LF_1			GENMASK(6, 4)
78 #define LF_0			GENMASK(2, 0)
79 
80 /* 0048h */
81 #define REM_MS_EN		BIT(5)
82 #define LOC_MS_EN		BIT(4)
83 
84 /* 0053h */
85 #define TX_SPLIT_MASK_B		BIT(5)
86 #define TX_SPLIT_MASK_A		BIT(4)
87 #define TX_STR_SEL		GENMASK(1, 0)
88 
89 /* 0140h */
90 #define AUD_RX_EN		BIT(0)
91 
92 /* 0170h */
93 #define SPI_EN			BIT(0)
94 
95 /* 01e5h */
96 #define PATGEN_MODE		GENMASK(1, 0)
97 
98 /* 02beh */
99 #define RES_CFG			BIT(7)
100 #define TX_PRIO			BIT(6)
101 #define TX_COMP_EN		BIT(5)
102 #define GPIO_OUT		BIT(4)
103 #define GPIO_IN			BIT(3)
104 #define GPIO_RX_EN		BIT(2)
105 #define GPIO_TX_EN		BIT(1)
106 #define GPIO_OUT_DIS		BIT(0)
107 
108 /* 02bfh */
109 #define PULL_UPDN_SEL		GENMASK(7, 6)
110 #define OUT_TYPE		BIT(5)
111 #define GPIO_TX_ID		GENMASK(4, 0)
112 
113 /* 02c0h */
114 #define OVR_RES_CFG		BIT(7)
115 #define GPIO_RX_ID		GENMASK(4, 0)
116 
117 /* 0311h */
118 #define START_PORTBU		BIT(7)
119 #define START_PORTBZ		BIT(6)
120 #define START_PORTBY		BIT(5)
121 #define START_PORTBX		BIT(4)
122 #define START_PORTAU		BIT(3)
123 #define START_PORTAZ		BIT(2)
124 #define START_PORTAY		BIT(1)
125 #define START_PORTAX		BIT(0)
126 
127 /* 032ah */
128 #define DV_LOCK			BIT(7)
129 #define DV_SWP_AB		BIT(6)
130 #define LINE_ALT		BIT(5)
131 #define DV_CONV			BIT(2)
132 #define DV_SPL			BIT(1)
133 #define DV_EN			BIT(0)
134 
135 /* 0330h */
136 #define PHY_CONFIG		GENMASK(2, 0)
137 #define MIPI_RX_RESET		BIT(3)
138 
139 /* 0331h */
140 #define NUM_LANES		GENMASK(1, 0)
141 
142 /* 0385h */
143 #define DPI_HSYNC_WIDTH_L	GENMASK(7, 0)
144 
145 /* 0386h */
146 #define DPI_VYSNC_WIDTH_L	GENMASK(7, 0)
147 
148 /* 0387h */
149 #define	DPI_HSYNC_WIDTH_H	GENMASK(3, 0)
150 #define DPI_VSYNC_WIDTH_H	GENMASK(7, 4)
151 
152 /* 03a4h */
153 #define DPI_DE_SKEW_SEL		BIT(1)
154 #define DPI_DESKEW_EN		BIT(0)
155 
156 /* 03a5h */
157 #define DPI_VFP_L		GENMASK(7, 0)
158 
159 /* 03a6h */
160 #define DPI_VFP_H		GENMASK(3, 0)
161 #define DPI_VBP_L		GENMASK(7, 4)
162 
163 /* 03a7h */
164 #define DPI_VBP_H		GENMASK(7, 0)
165 
166 /* 03a8h */
167 #define DPI_VACT_L		GENMASK(7, 0)
168 
169 /* 03a9h */
170 #define DPI_VACT_H		GENMASK(3, 0)
171 
172 /* 03aah */
173 #define DPI_HFP_L		GENMASK(7, 0)
174 
175 /* 03abh */
176 #define DPI_HFP_H		GENMASK(3, 0)
177 #define DPI_HBP_L		GENMASK(7, 4)
178 
179 /* 03ach */
180 #define DPI_HBP_H		GENMASK(7, 0)
181 
182 /* 03adh */
183 #define DPI_HACT_L		GENMASK(7, 0)
184 
185 /* 03aeh */
186 #define DPI_HACT_H		GENMASK(4, 0)
187 
188 /* 055dh */
189 #define VS_DET			BIT(5)
190 #define HS_DET			BIT(4)
191 
192 enum link_mode {
193 	DUAL_LINK,
194 	LINKA,
195 	LINKB,
196 	SPLITTER_MODE,
197 };
198 
199 #endif /* _MFD_MAX96755F_H_ */
200