xref: /openbmc/linux/drivers/gpu/drm/xlnx/zynqmp_dpsub.h (revision 1682ade6630823dd186723b44991d9933503dfc3)
1d76271d2SHyun Kwon /* SPDX-License-Identifier: GPL-2.0 */
2d76271d2SHyun Kwon /*
3d76271d2SHyun Kwon  * ZynqMP DPSUB Subsystem Driver
4d76271d2SHyun Kwon  *
5d76271d2SHyun Kwon  * Copyright (C) 2017 - 2020 Xilinx, Inc.
6d76271d2SHyun Kwon  *
7d76271d2SHyun Kwon  * Authors:
8d76271d2SHyun Kwon  * - Hyun Woo Kwon <hyun.kwon@xilinx.com>
9d76271d2SHyun Kwon  * - Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10d76271d2SHyun Kwon  */
11d76271d2SHyun Kwon 
12d76271d2SHyun Kwon #ifndef _ZYNQMP_DPSUB_H_
13d76271d2SHyun Kwon #define _ZYNQMP_DPSUB_H_
14d76271d2SHyun Kwon 
15e8e35733SLaurent Pinchart #include <drm/drm_encoder.h>
16e8e35733SLaurent Pinchart 
17d76271d2SHyun Kwon struct clk;
18d76271d2SHyun Kwon struct device;
19e8e35733SLaurent Pinchart struct drm_bridge;
20d76271d2SHyun Kwon struct drm_device;
21d76271d2SHyun Kwon struct zynqmp_disp;
22d76271d2SHyun Kwon struct zynqmp_dp;
23d76271d2SHyun Kwon 
24d76271d2SHyun Kwon enum zynqmp_dpsub_format {
25d76271d2SHyun Kwon 	ZYNQMP_DPSUB_FORMAT_RGB,
26d76271d2SHyun Kwon 	ZYNQMP_DPSUB_FORMAT_YCRCB444,
27d76271d2SHyun Kwon 	ZYNQMP_DPSUB_FORMAT_YCRCB422,
28d76271d2SHyun Kwon 	ZYNQMP_DPSUB_FORMAT_YONLY,
29d76271d2SHyun Kwon };
30d76271d2SHyun Kwon 
31d76271d2SHyun Kwon /**
32d76271d2SHyun Kwon  * struct zynqmp_dpsub - ZynqMP DisplayPort Subsystem
33d76271d2SHyun Kwon  * @drm: The DRM/KMS device
34d76271d2SHyun Kwon  * @dev: The physical device
35d76271d2SHyun Kwon  * @apb_clk: The APB clock
36*1682ade6SLaurent Pinchart  * @vid_clk: Video clock
37*1682ade6SLaurent Pinchart  * @vid_clk_from_ps: True of the video clock comes from PS, false from PL
38e8e35733SLaurent Pinchart  * @encoder: The dummy DRM encoder
39e8e35733SLaurent Pinchart  * @bridge: The DP encoder bridge
40d76271d2SHyun Kwon  * @disp: The display controller
41d76271d2SHyun Kwon  * @dp: The DisplayPort controller
42d76271d2SHyun Kwon  * @dma_align: DMA alignment constraint (must be a power of 2)
43d76271d2SHyun Kwon  */
44d76271d2SHyun Kwon struct zynqmp_dpsub {
45d76271d2SHyun Kwon 	struct drm_device drm;
46d76271d2SHyun Kwon 	struct device *dev;
47d76271d2SHyun Kwon 
48d76271d2SHyun Kwon 	struct clk *apb_clk;
49*1682ade6SLaurent Pinchart 	struct clk *vid_clk;
50*1682ade6SLaurent Pinchart 	bool vid_clk_from_ps;
51d76271d2SHyun Kwon 
52e8e35733SLaurent Pinchart 	struct drm_encoder encoder;
53e8e35733SLaurent Pinchart 	struct drm_bridge *bridge;
54e8e35733SLaurent Pinchart 
55d76271d2SHyun Kwon 	struct zynqmp_disp *disp;
56d76271d2SHyun Kwon 	struct zynqmp_dp *dp;
57d76271d2SHyun Kwon 
58d76271d2SHyun Kwon 	unsigned int dma_align;
59d76271d2SHyun Kwon };
60d76271d2SHyun Kwon 
61d76271d2SHyun Kwon static inline struct zynqmp_dpsub *to_zynqmp_dpsub(struct drm_device *drm)
62d76271d2SHyun Kwon {
63d76271d2SHyun Kwon 	return container_of(drm, struct zynqmp_dpsub, drm);
64d76271d2SHyun Kwon }
65d76271d2SHyun Kwon 
66d76271d2SHyun Kwon #endif /* _ZYNQMP_DPSUB_H_ */
67