1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright (C) 2018 Cadence Design Systems Inc.
6 #ifndef __PHY_MIPI_DPHY_H_
7 #define __PHY_MIPI_DPHY_H_
10 * struct phy_configure_opts_mipi_dphy - MIPI D-PHY configuration set
12 * This structure is used to represent the configuration state of a
15 struct phy_configure_opts_mipi_dphy {
19 * Timeout, in picoseconds, for receiver to detect absence of
20 * Clock transitions and disable the Clock Lane HS-RX.
22 * Maximum value: 60000 ps
24 unsigned int clk_miss;
29 * Time, in picoseconds, that the transmitter continues to
30 * send HS clock after the last associated Data Lane has
31 * transitioned to LP Mode. Interval is defined as the period
32 * from the end of @hs_trail to the beginning of @clk_trail.
34 * Minimum value: 60000 ps + 52 * @hs_clk_rate period in ps
36 unsigned int clk_post;
41 * Time, in UI, that the HS clock shall be driven by
42 * the transmitter prior to any associated Data Lane beginning
43 * the transition from LP to HS mode.
52 * Time, in picoseconds, that the transmitter drives the Clock
53 * Lane LP-00 Line state immediately before the HS-0 Line
54 * state starting the HS transmission.
56 * Minimum value: 38000 ps
57 * Maximum value: 95000 ps
59 unsigned int clk_prepare;
64 * Time interval, in picoseconds, during which the HS receiver
65 * should ignore any Clock Lane HS transitions, starting from
66 * the beginning of @clk_prepare.
68 * Minimum value: 95000 ps
69 * Maximum value: 300000 ps
71 unsigned int clk_settle;
76 * Time, in picoseconds, for the Clock Lane receiver to enable
77 * the HS line termination.
79 * Maximum value: 38000 ps
81 unsigned int clk_term_en;
86 * Time, in picoseconds, that the transmitter drives the HS-0
87 * state after the last payload clock bit of a HS transmission
90 * Minimum value: 60000 ps
92 unsigned int clk_trail;
97 * Time, in picoseconds, that the transmitter drives the HS-0
98 * state prior to starting the Clock.
100 unsigned int clk_zero;
105 * Time, in picoseconds, for the Data Lane receiver to enable
106 * the HS line termination.
108 * Maximum value: 35000 ps + 4 * @hs_clk_rate period in ps
110 unsigned int d_term_en;
115 * Transmitted time interval, in picoseconds, from the start
116 * of @hs_trail or @clk_trail, to the start of the LP- 11
117 * state following a HS burst.
119 * Maximum value: 105000 ps + 12 * @hs_clk_rate period in ps
126 * Time, in picoseconds, that the transmitter drives LP-11
127 * following a HS burst.
129 * Minimum value: 100000 ps
131 unsigned int hs_exit;
136 * Time, in picoseconds, that the transmitter drives the Data
137 * Lane LP-00 Line state immediately before the HS-0 Line
138 * state starting the HS transmission.
140 * Minimum value: 40000 ps + 4 * @hs_clk_rate period in ps
141 * Maximum value: 85000 ps + 6 * @hs_clk_rate period in ps
143 unsigned int hs_prepare;
148 * Time interval, in picoseconds, during which the HS receiver
149 * shall ignore any Data Lane HS transitions, starting from
150 * the beginning of @hs_prepare.
152 * Minimum value: 85000 ps + 6 * @hs_clk_rate period in ps
153 * Maximum value: 145000 ps + 10 * @hs_clk_rate period in ps
155 unsigned int hs_settle;
160 * Time interval, in picoseconds, during which the HS-RX
161 * should ignore any transitions on the Data Lane, following a
162 * HS burst. The end point of the interval is defined as the
163 * beginning of the LP-11 state following the HS burst.
165 * Minimum value: 40000 ps
166 * Maximum value: 55000 ps + 4 * @hs_clk_rate period in ps
168 unsigned int hs_skip;
173 * Time, in picoseconds, that the transmitter drives the
174 * flipped differential state after last payload data bit of a
175 * HS transmission burst
177 * Minimum value: max(8 * @hs_clk_rate period in ps,
178 * 60000 ps + 4 * @hs_clk_rate period in ps)
180 unsigned int hs_trail;
185 * Time, in picoseconds, that the transmitter drives the HS-0
186 * state prior to transmitting the Sync sequence.
188 unsigned int hs_zero;
193 * Time, in microseconds for the initialization period to
196 * Minimum value: 100 us
203 * Transmitted length, in picoseconds, of any Low-Power state
206 * Minimum value: 50000 ps
213 * Time, in picoseconds, that the new transmitter drives the
214 * Bridge state (LP-00) after accepting control during a Link
224 * Time, in picoseconds, that the transmitter drives the
225 * Bridge state (LP-00) before releasing control during a Link
235 * Time, in picoseconds, that the new transmitter waits after
236 * the LP-10 state before transmitting the Bridge state
237 * (LP-00) during a Link Turnaround.
239 * Minimum value: @lpx
240 * Maximum value: 2 * @lpx
242 unsigned int ta_sure;
247 * Time, in microseconds, that a transmitter drives a Mark-1
248 * state prior to a Stop state in order to initiate an exit
251 * Minimum value: 1000 us
258 * Clock rate, in Hertz, of the high-speed clock.
260 unsigned long hs_clk_rate;
265 * Clock rate, in Hertz, of the low-power clock.
267 unsigned long lp_clk_rate;
272 * Number of active, consecutive, data lanes, starting from
273 * lane 0, used for the transmissions.
278 int phy_mipi_dphy_get_default_config(unsigned long pixel_clock,
281 struct phy_configure_opts_mipi_dphy *cfg);
282 int phy_mipi_dphy_config_validate(struct phy_configure_opts_mipi_dphy *cfg);
284 #endif /* __PHY_MIPI_DPHY_H_ */