.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
---|
1 | 2 | /* |
---|
2 | 3 | * Analogix DP (Display Port) Core interface driver. |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2015 Rockchip Electronics Co., Ltd. |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify it |
---|
7 | | - * under the terms of the GNU General Public License as published by the |
---|
8 | | - * Free Software Foundation; either version 2 of the License, or (at your |
---|
9 | | - * option) any later version. |
---|
10 | 6 | */ |
---|
11 | 7 | #ifndef _ANALOGIX_DP_H_ |
---|
12 | 8 | #define _ANALOGIX_DP_H_ |
---|
.. | .. |
---|
19 | 15 | enum analogix_dp_devtype { |
---|
20 | 16 | EXYNOS_DP, |
---|
21 | 17 | RK3288_DP, |
---|
22 | | - RK3368_EDP, |
---|
23 | 18 | RK3399_EDP, |
---|
24 | 19 | RK3568_EDP, |
---|
| 20 | + RK3588_EDP, |
---|
25 | 21 | }; |
---|
26 | 22 | |
---|
27 | 23 | static inline bool is_rockchip(enum analogix_dp_devtype type) |
---|
28 | 24 | { |
---|
29 | 25 | switch (type) { |
---|
30 | 26 | case RK3288_DP: |
---|
31 | | - case RK3368_EDP: |
---|
32 | 27 | case RK3399_EDP: |
---|
33 | 28 | case RK3568_EDP: |
---|
| 29 | + case RK3588_EDP: |
---|
34 | 30 | return true; |
---|
35 | 31 | default: |
---|
36 | 32 | return false; |
---|
37 | 33 | } |
---|
38 | 34 | } |
---|
39 | 35 | |
---|
40 | | -struct analogix_dp_plat_data; |
---|
41 | | -struct analogix_dp_property_ops { |
---|
42 | | - int (*attach_properties)(struct drm_connector *connector); |
---|
43 | | - int (*get_property)(struct drm_connector *connector, |
---|
44 | | - const struct drm_connector_state *state, |
---|
45 | | - struct drm_property *property, |
---|
46 | | - u64 *val, |
---|
47 | | - struct analogix_dp_plat_data *data); |
---|
48 | | -}; |
---|
49 | | - |
---|
50 | 36 | struct analogix_dp_plat_data { |
---|
51 | 37 | enum analogix_dp_devtype dev_type; |
---|
52 | 38 | struct drm_panel *panel; |
---|
| 39 | + struct drm_bridge *bridge; |
---|
53 | 40 | struct drm_encoder *encoder; |
---|
54 | 41 | struct drm_connector *connector; |
---|
55 | 42 | bool skip_connector; |
---|
56 | 43 | bool ssc; |
---|
| 44 | + |
---|
| 45 | + bool split_mode; |
---|
| 46 | + struct analogix_dp_device *left; |
---|
| 47 | + struct analogix_dp_device *right; |
---|
57 | 48 | |
---|
58 | 49 | int (*power_on_start)(struct analogix_dp_plat_data *); |
---|
59 | 50 | int (*power_on_end)(struct analogix_dp_plat_data *); |
---|
60 | 51 | int (*power_off)(struct analogix_dp_plat_data *); |
---|
61 | 52 | int (*attach)(struct analogix_dp_plat_data *, struct drm_bridge *, |
---|
62 | 53 | struct drm_connector *); |
---|
| 54 | + void (*detach)(struct analogix_dp_plat_data *, struct drm_bridge *); |
---|
63 | 55 | int (*get_modes)(struct analogix_dp_plat_data *, |
---|
64 | 56 | struct drm_connector *); |
---|
65 | | - /* Vendor Property support */ |
---|
66 | | - const struct analogix_dp_property_ops *property_ops; |
---|
| 57 | + void (*convert_to_split_mode)(struct drm_display_mode *); |
---|
| 58 | + void (*convert_to_origin_mode)(struct drm_display_mode *); |
---|
67 | 59 | }; |
---|
68 | | - |
---|
69 | | -int analogix_dp_psr_enabled(struct analogix_dp_device *dp); |
---|
70 | | -int analogix_dp_enable_psr(struct analogix_dp_device *dp); |
---|
71 | | -int analogix_dp_disable_psr(struct analogix_dp_device *dp); |
---|
72 | 60 | |
---|
73 | 61 | int analogix_dp_resume(struct analogix_dp_device *dp); |
---|
74 | 62 | int analogix_dp_suspend(struct analogix_dp_device *dp); |
---|
| 63 | +int analogix_dp_runtime_resume(struct analogix_dp_device *dp); |
---|
| 64 | +int analogix_dp_runtime_suspend(struct analogix_dp_device *dp); |
---|
75 | 65 | |
---|
76 | 66 | struct analogix_dp_device * |
---|
77 | | -analogix_dp_bind(struct device *dev, struct drm_device *drm_dev, |
---|
78 | | - struct analogix_dp_plat_data *plat_data); |
---|
| 67 | +analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data); |
---|
| 68 | +int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev); |
---|
79 | 69 | void analogix_dp_unbind(struct analogix_dp_device *dp); |
---|
| 70 | +void analogix_dp_remove(struct analogix_dp_device *dp); |
---|
80 | 71 | |
---|
81 | 72 | int analogix_dp_start_crc(struct drm_connector *connector); |
---|
82 | 73 | int analogix_dp_stop_crc(struct drm_connector *connector); |
---|
.. | .. |
---|
88 | 79 | int analogix_dp_audio_startup(struct analogix_dp_device *dp); |
---|
89 | 80 | int analogix_dp_audio_get_eld(struct analogix_dp_device *dp, |
---|
90 | 81 | u8 *buf, size_t len); |
---|
| 82 | +int analogix_dp_loader_protect(struct analogix_dp_device *dp); |
---|
| 83 | +void analogix_dp_disable(struct analogix_dp_device *dp); |
---|
91 | 84 | |
---|
92 | 85 | #endif /* _ANALOGIX_DP_H_ */ |
---|