Yakir Yang | 3424e3a | 2016-03-29 09:57:03 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Analogix DP (Display Port) Core interface driver. |
| 3 | * |
| 4 | * 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 | */ |
| 11 | #ifndef _ANALOGIX_DP_H_ |
| 12 | #define _ANALOGIX_DP_H_ |
| 13 | |
| 14 | #include <drm/drm_crtc.h> |
| 15 | |
| 16 | enum analogix_dp_devtype { |
| 17 | EXYNOS_DP, |
Yakir Yang | 9e32e16 | 2016-03-29 09:57:30 +0800 | [diff] [blame] | 18 | RK3288_DP, |
Yakir Yang | 82872e4 | 2016-06-29 17:15:26 +0800 | [diff] [blame] | 19 | RK3399_EDP, |
Yakir Yang | 3424e3a | 2016-03-29 09:57:03 +0800 | [diff] [blame] | 20 | }; |
| 21 | |
Yakir Yang | 7bdc072 | 2016-06-29 17:15:18 +0800 | [diff] [blame] | 22 | static inline bool is_rockchip(enum analogix_dp_devtype type) |
| 23 | { |
Yakir Yang | 82872e4 | 2016-06-29 17:15:26 +0800 | [diff] [blame] | 24 | return type == RK3288_DP || type == RK3399_EDP; |
Yakir Yang | 7bdc072 | 2016-06-29 17:15:18 +0800 | [diff] [blame] | 25 | } |
| 26 | |
Yakir Yang | 3424e3a | 2016-03-29 09:57:03 +0800 | [diff] [blame] | 27 | struct analogix_dp_plat_data { |
| 28 | enum analogix_dp_devtype dev_type; |
| 29 | struct drm_panel *panel; |
| 30 | struct drm_encoder *encoder; |
| 31 | struct drm_connector *connector; |
| 32 | |
| 33 | int (*power_on)(struct analogix_dp_plat_data *); |
| 34 | int (*power_off)(struct analogix_dp_plat_data *); |
| 35 | int (*attach)(struct analogix_dp_plat_data *, struct drm_bridge *, |
| 36 | struct drm_connector *); |
Yakir Yang | fcc150c | 2016-06-29 17:15:35 +0800 | [diff] [blame] | 37 | int (*get_modes)(struct analogix_dp_plat_data *, |
| 38 | struct drm_connector *); |
Yakir Yang | 3424e3a | 2016-03-29 09:57:03 +0800 | [diff] [blame] | 39 | }; |
| 40 | |
Tomeu Vizoso | 561b069 | 2016-09-23 16:06:39 +0200 | [diff] [blame] | 41 | int analogix_dp_psr_supported(struct device *dev); |
Yakir Yang | 5b3f84f | 2016-07-24 14:57:48 +0800 | [diff] [blame] | 42 | int analogix_dp_enable_psr(struct device *dev); |
| 43 | int analogix_dp_disable_psr(struct device *dev); |
| 44 | |
Yakir Yang | 3424e3a | 2016-03-29 09:57:03 +0800 | [diff] [blame] | 45 | int analogix_dp_resume(struct device *dev); |
| 46 | int analogix_dp_suspend(struct device *dev); |
| 47 | |
| 48 | int analogix_dp_bind(struct device *dev, struct drm_device *drm_dev, |
| 49 | struct analogix_dp_plat_data *plat_data); |
| 50 | void analogix_dp_unbind(struct device *dev, struct device *master, void *data); |
| 51 | |
| 52 | #endif /* _ANALOGIX_DP_H_ */ |