16 #include <linux/kernel.h>
17 #include <linux/wait.h>
18 #include <linux/module.h>
22 #include <drm/exynos_drm.h>
27 #define to_context(dev) platform_get_drvdata(to_platform_device(dev))
28 #define to_subdrv(dev) to_context(dev)
29 #define get_ctx_from_subdrv(subdrv) container_of(subdrv,\
30 struct drm_hdmi_context, subdrv);
63 DRM_DEBUG_KMS(
"%s\n", __FILE__);
71 DRM_DEBUG_KMS(
"%s\n", __FILE__);
77 static bool drm_hdmi_is_connected(
struct device *
dev)
81 DRM_DEBUG_KMS(
"%s\n", __FILE__);
89 static int drm_hdmi_get_edid(
struct device *dev,
94 DRM_DEBUG_KMS(
"%s\n", __FILE__);
103 static int drm_hdmi_check_timing(
struct device *dev,
void *
timing)
107 DRM_DEBUG_KMS(
"%s\n", __FILE__);
115 static int drm_hdmi_power_on(
struct device *dev,
int mode)
119 DRM_DEBUG_KMS(
"%s\n", __FILE__);
129 .is_connected = drm_hdmi_is_connected,
130 .get_edid = drm_hdmi_get_edid,
131 .check_timing = drm_hdmi_check_timing,
132 .power_on = drm_hdmi_power_on,
135 static int drm_hdmi_enable_vblank(
struct device *subdrv_dev)
141 DRM_DEBUG_KMS(
"%s\n", __FILE__);
150 static void drm_hdmi_disable_vblank(
struct device *subdrv_dev)
154 DRM_DEBUG_KMS(
"%s\n", __FILE__);
160 static void drm_hdmi_mode_fixup(
struct device *subdrv_dev,
167 DRM_DEBUG_KMS(
"%s\n", __FILE__);
174 static void drm_hdmi_mode_set(
struct device *subdrv_dev,
void *mode)
178 DRM_DEBUG_KMS(
"%s\n", __FILE__);
184 static void drm_hdmi_get_max_resol(
struct device *subdrv_dev,
189 DRM_DEBUG_KMS(
"%s\n", __FILE__);
195 static void drm_hdmi_commit(
struct device *subdrv_dev)
199 DRM_DEBUG_KMS(
"%s\n", __FILE__);
201 if (hdmi_ops && hdmi_ops->
commit)
205 static void drm_hdmi_dpms(
struct device *subdrv_dev,
int mode)
209 DRM_DEBUG_KMS(
"%s\n", __FILE__);
211 if (mixer_ops && mixer_ops->
dpms)
214 if (hdmi_ops && hdmi_ops->
dpms)
218 static void drm_hdmi_apply(
struct device *subdrv_dev)
223 DRM_DEBUG_KMS(
"%s\n", __FILE__);
232 if (hdmi_ops && hdmi_ops->
commit)
237 .dpms = drm_hdmi_dpms,
238 .apply = drm_hdmi_apply,
239 .enable_vblank = drm_hdmi_enable_vblank,
240 .disable_vblank = drm_hdmi_disable_vblank,
241 .mode_fixup = drm_hdmi_mode_fixup,
242 .mode_set = drm_hdmi_mode_set,
243 .get_max_resol = drm_hdmi_get_max_resol,
244 .commit = drm_hdmi_commit,
247 static void drm_mixer_mode_set(
struct device *subdrv_dev,
252 DRM_DEBUG_KMS(
"%s\n", __FILE__);
258 static void drm_mixer_commit(
struct device *subdrv_dev,
int zpos)
263 DRM_DEBUG_KMS(
"%s\n", __FILE__);
265 if (win < 0 || win > MIXER_WIN_NR) {
266 DRM_ERROR(
"mixer window[%d] is wrong\n", win);
276 static void drm_mixer_disable(
struct device *subdrv_dev,
int zpos)
281 DRM_DEBUG_KMS(
"%s\n", __FILE__);
283 if (win < 0 || win > MIXER_WIN_NR) {
284 DRM_ERROR(
"mixer window[%d] is wrong\n", win);
294 static void drm_mixer_wait_for_vblank(
struct device *subdrv_dev)
298 DRM_DEBUG_KMS(
"%s\n", __FILE__);
305 .mode_set = drm_mixer_mode_set,
306 .commit = drm_mixer_commit,
307 .disable = drm_mixer_disable,
308 .wait_for_vblank = drm_mixer_wait_for_vblank,
313 .ops = &drm_hdmi_manager_ops,
314 .overlay_ops = &drm_hdmi_overlay_ops,
315 .display_ops = &drm_hdmi_display_ops,
318 static int hdmi_subdrv_probe(
struct drm_device *drm_dev,
324 DRM_DEBUG_KMS(
"%s\n", __FILE__);
327 DRM_ERROR(
"hdmi context not initialized.\n");
332 DRM_ERROR(
"mixer context not initialized.\n");
339 DRM_ERROR(
"no drm hdmi context.\n");
358 DRM_DEBUG_KMS(
"%s\n", __FILE__);
362 DRM_LOG_KMS(
"failed to alloc common hdmi context.\n");
369 subdrv->
manager = &hdmi_manager;
370 subdrv->
probe = hdmi_subdrv_probe;
372 platform_set_drvdata(pdev, subdrv);
383 DRM_DEBUG_KMS(
"%s\n", __FILE__);
391 .probe = exynos_drm_hdmi_probe,
394 .name =
"exynos-drm-hdmi",