xref: /linux/drivers/gpu/drm/tegra/dp.h (revision 7aa3cc540d00b0be7d225202fa5c2d0c8e99f3f1)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright (C) 2013-2019 NVIDIA Corporation.
4  * Copyright (C) 2015 Rob Clark
5  */
6 
7 #ifndef DRM_TEGRA_DP_H
8 #define DRM_TEGRA_DP_H 1
9 
10 #include <linux/types.h>
11 
12 struct drm_dp_aux;
13 
14 /**
15  * struct drm_dp_link_caps - DP link capabilities
16  */
17 struct drm_dp_link_caps {
18 	/**
19 	 * @enhanced_framing:
20 	 *
21 	 * enhanced framing capability (mandatory as of DP 1.2)
22 	 */
23 	bool enhanced_framing;
24 
25 	/**
26 	 * tps3_supported:
27 	 *
28 	 * training pattern sequence 3 supported for equalization
29 	 */
30 	bool tps3_supported;
31 
32 	/**
33 	 * @fast_training:
34 	 *
35 	 * AUX CH handshake not required for link training
36 	 */
37 	bool fast_training;
38 
39 	/**
40 	 * @channel_coding:
41 	 *
42 	 * ANSI 8B/10B channel coding capability
43 	 */
44 	bool channel_coding;
45 
46 	/**
47 	 * @alternate_scrambler_reset:
48 	 *
49 	 * eDP alternate scrambler reset capability
50 	 */
51 	bool alternate_scrambler_reset;
52 };
53 
54 void drm_dp_link_caps_copy(struct drm_dp_link_caps *dest,
55 			   const struct drm_dp_link_caps *src);
56 
57 /**
58  * struct drm_dp_link - DP link capabilities and configuration
59  * @revision: DP specification revision supported on the link
60  * @max_rate: maximum clock rate supported on the link
61  * @max_lanes: maximum number of lanes supported on the link
62  * @caps: capabilities supported on the link (see &drm_dp_link_caps)
63  * @edp: eDP revision (0x11: eDP 1.1, 0x12: eDP 1.2, ...)
64  * @rate: currently configured link rate
65  * @lanes: currently configured number of lanes
66  */
67 struct drm_dp_link {
68 	unsigned char revision;
69 	unsigned int max_rate;
70 	unsigned int max_lanes;
71 
72 	struct drm_dp_link_caps caps;
73 	unsigned char edp;
74 
75 	unsigned int rate;
76 	unsigned int lanes;
77 };
78 
79 int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link);
80 int drm_dp_link_power_up(struct drm_dp_aux *aux, struct drm_dp_link *link);
81 int drm_dp_link_power_down(struct drm_dp_aux *aux, struct drm_dp_link *link);
82 int drm_dp_link_configure(struct drm_dp_aux *aux, struct drm_dp_link *link);
83 
84 #endif
85