Shawn Guo | 0a886f5 | 2016-09-22 19:52:39 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Linaro Ltd. |
| 3 | * Copyright 2016 ZTE Corporation. |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | */ |
| 10 | |
| 11 | #ifndef __ZX_VOU_H__ |
| 12 | #define __ZX_VOU_H__ |
| 13 | |
| 14 | #define VOU_CRTC_MASK 0x3 |
| 15 | |
| 16 | /* VOU output interfaces */ |
| 17 | enum vou_inf_id { |
| 18 | VOU_HDMI = 0, |
| 19 | VOU_RGB_LCD = 1, |
| 20 | VOU_TV_ENC = 2, |
| 21 | VOU_MIPI_DSI = 3, |
| 22 | VOU_LVDS = 4, |
| 23 | VOU_VGA = 5, |
| 24 | }; |
| 25 | |
Shawn Guo | 83d7115 | 2016-12-01 17:20:31 +0800 | [diff] [blame] | 26 | enum vou_inf_hdmi_audio { |
| 27 | VOU_HDMI_AUD_SPDIF = BIT(0), |
| 28 | VOU_HDMI_AUD_I2S = BIT(1), |
| 29 | VOU_HDMI_AUD_DSD = BIT(2), |
| 30 | VOU_HDMI_AUD_HBR = BIT(3), |
| 31 | VOU_HDMI_AUD_PARALLEL = BIT(4), |
| 32 | }; |
| 33 | |
Shawn Guo | 83d7115 | 2016-12-01 17:20:31 +0800 | [diff] [blame] | 34 | void vou_inf_hdmi_audio_sel(struct drm_crtc *crtc, |
| 35 | enum vou_inf_hdmi_audio aud); |
Shawn Guo | 831a8d5 | 2017-01-12 16:27:35 +0800 | [diff] [blame] | 36 | void vou_inf_enable(enum vou_inf_id id, struct drm_crtc *crtc); |
| 37 | void vou_inf_disable(enum vou_inf_id id, struct drm_crtc *crtc); |
Shawn Guo | 0a886f5 | 2016-09-22 19:52:39 +0800 | [diff] [blame] | 38 | |
Shawn Guo | 9cc2a68 | 2017-01-12 22:20:31 +0800 | [diff] [blame] | 39 | enum vou_div_id { |
| 40 | VOU_DIV_VGA, |
| 41 | VOU_DIV_PIC, |
| 42 | VOU_DIV_TVENC, |
| 43 | VOU_DIV_HDMI_PNX, |
| 44 | VOU_DIV_HDMI, |
| 45 | VOU_DIV_INF, |
| 46 | VOU_DIV_LAYER, |
| 47 | }; |
| 48 | |
| 49 | enum vou_div_val { |
| 50 | VOU_DIV_1 = 0, |
| 51 | VOU_DIV_2 = 1, |
| 52 | VOU_DIV_4 = 3, |
| 53 | VOU_DIV_8 = 7, |
| 54 | }; |
| 55 | |
| 56 | struct vou_div_config { |
| 57 | enum vou_div_id id; |
| 58 | enum vou_div_val val; |
| 59 | }; |
| 60 | |
| 61 | void zx_vou_config_dividers(struct drm_crtc *crtc, |
| 62 | struct vou_div_config *configs, int num); |
| 63 | |
Shawn Guo | 7254b1f | 2016-12-29 08:03:03 +0800 | [diff] [blame] | 64 | void zx_vou_layer_enable(struct drm_plane *plane); |
| 65 | void zx_vou_layer_disable(struct drm_plane *plane); |
| 66 | |
Shawn Guo | 0a886f5 | 2016-09-22 19:52:39 +0800 | [diff] [blame] | 67 | #endif /* __ZX_VOU_H__ */ |