2 * Copyright (C) ROCKCHIP, Inc.
3 * Author:yzq<yzq@rock-chips.com>
5 * based on exynos_drm_hdmi.h
7 * This software is licensed under the terms of the GNU General Public
8 * License version 2, as published by the Free Software Foundation, and
9 * may be copied, distributed, and modified under those terms.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 #ifndef _ROCKCHIP_DRM_HDMI_H_
17 #define _ROCKCHIP_DRM_HDMI_H_
19 #define MIXER_WIN_NR 3
20 #define MIXER_DEFAULT_WIN 0
23 * rockchip hdmi common context structure.
25 * @drm_dev: pointer to drm_device.
26 * @ctx: pointer to the context of specific device driver.
27 * this context should be hdmi_context or mixer_context.
29 struct rockchip_drm_hdmi_context {
30 struct drm_device *drm_dev;
34 struct rockchip_hdmi_ops {
36 bool (*is_connected)(void *ctx);
37 struct edid *(*get_edid)(void *ctx,
38 struct drm_connector *connector);
39 int (*check_timing)(void *ctx, struct fb_videomode *timing);
40 int (*power_on)(void *ctx, int mode);
43 void (*mode_set)(void *ctx, void *mode);
44 void (*get_max_resol)(void *ctx, unsigned int *width,
45 unsigned int *height);
46 void (*commit)(void *ctx);
47 void (*dpms)(void *ctx, int mode);
50 struct rockchip_mixer_ops {
52 int (*iommu_on)(void *ctx, bool enable);
53 int (*enable_vblank)(void *ctx, int pipe);
54 void (*disable_vblank)(void *ctx);
55 void (*wait_for_vblank)(void *ctx);
56 void (*dpms)(void *ctx, int mode);
59 void (*win_mode_set)(void *ctx, struct rockchip_drm_overlay *overlay);
60 void (*win_commit)(void *ctx, int zpos);
61 void (*win_disable)(void *ctx, int zpos);
64 int (*check_timing)(void *ctx, struct fb_videomode *timing);
67 void rockchip_hdmi_drv_attach(struct rockchip_drm_hdmi_context *ctx);
68 void rockchip_mixer_drv_attach(struct rockchip_drm_hdmi_context *ctx);
69 void rockchip_hdmi_ops_register(struct rockchip_hdmi_ops *ops);
70 void rockchip_mixer_ops_register(struct rockchip_mixer_ops *ops);