xref: /rk3399_rockchip-uboot/drivers/video/drm/rockchip_connector.h (revision 87e4c6020eff05133e40ab8b7b0e37e6a2be37e4)
1 /*
2  * (C) Copyright 2008-2017 Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier:	GPL-2.0+
5  */
6 
7 #ifndef _ROCKCHIP_CONNECTOR_H_
8 #define _ROCKCHIP_CONNECTOR_H_
9 
10 struct rockchip_connector {
11 	const struct rockchip_connector_funcs *funcs;
12 
13 	const void *data;
14 };
15 
16 struct rockchip_connector_funcs {
17 	/*
18 	 * init connector, prepare resource to ensure
19 	 * detect and get_timing can works
20 	 */
21 	int (*init)(struct display_state *state);
22 
23 	void (*deinit)(struct display_state *state);
24 	/*
25 	 * Optional, if connector not support hotplug,
26 	 * Returns:
27 	 *   0 means disconnected, else means connected
28 	 */
29 	int (*detect)(struct display_state *state);
30 	/*
31 	 * Optional, if implement it, need fill the timing data:
32 	 *     state->conn_state->mode
33 	 * you can refer to the rockchip_display: display_get_timing(),
34 	 * Returns:
35 	 *   0 means success, else means failed
36 	 */
37 	int (*get_timing)(struct display_state *state);
38 	/*
39 	 * Optional, if implement it, need fill the edid data:
40 	 *     state->conn_state->edid
41 	 * Returns:
42 	 *   0 means success, else means failed
43 	 */
44 	int (*get_edid)(struct display_state *state);
45 	/*
46 	 * call before crtc enable.
47 	 */
48 	int (*prepare)(struct display_state *state);
49 	/*
50 	 * call after crtc enable
51 	 */
52 	int (*enable)(struct display_state *state);
53 	int (*disable)(struct display_state *state);
54 	void (*unprepare)(struct display_state *state);
55 	/*
56 	 * Save data to dts, then you can share data to kernel space.
57 	 */
58 	int (*fixup_dts)(struct display_state *state, void *blob);
59 };
60 
61 const struct rockchip_connector *
62 rockchip_get_connector(const void *blob, int connector_node);
63 
64 #ifdef CONFIG_DRM_ROCKCHIP_ANALOGIX_DP
65 struct rockchip_dp_chip_data;
66 extern const struct rockchip_connector_funcs rockchip_analogix_dp_funcs;
67 extern const struct rockchip_dp_chip_data rk3399_analogix_edp_drv_data;
68 extern const struct rockchip_dp_chip_data rk3368_analogix_edp_drv_data;
69 extern const struct rockchip_dp_chip_data rk3288_analogix_dp_drv_data;
70 #endif
71 #endif
72