2 * Copyright (C) 2011 Freescale Semiconductor, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
24 enum dw_hdmi_devtype {
32 struct dw_hdmi_audio_tmds_n {
39 enum dw_hdmi_phy_type {
40 DW_HDMI_PHY_DWC_HDMI_TX_PHY = 0x00,
41 DW_HDMI_PHY_DWC_MHL_PHY_HEAC = 0xb2,
42 DW_HDMI_PHY_DWC_MHL_PHY = 0xc2,
43 DW_HDMI_PHY_DWC_HDMI_3D_TX_PHY_HEAC = 0xe2,
44 DW_HDMI_PHY_DWC_HDMI_3D_TX_PHY = 0xf2,
45 DW_HDMI_PHY_DWC_HDMI20_TX_PHY = 0xf3,
46 DW_HDMI_PHY_VENDOR_PHY = 0xfe,
49 struct dw_hdmi_mpll_config {
50 unsigned long mpixelclock;
54 } res[DW_HDMI_RES_MAX];
57 struct dw_hdmi_curr_ctrl {
58 unsigned long mpixelclock;
59 u16 curr[DW_HDMI_RES_MAX];
62 struct dw_hdmi_phy_config {
63 unsigned long mpixelclock;
64 u16 sym_ctr; /*clock symbol and transmitter control*/
65 u16 term; /*transmission termination value*/
66 u16 vlev_ctr; /* voltage level control */
69 struct dw_hdmi_phy_ops {
70 int (*init)(struct dw_hdmi *hdmi, void *data,
71 struct drm_display_mode *mode);
72 void (*disable)(struct dw_hdmi *hdmi, void *data);
73 enum drm_connector_status (*read_hpd)(struct dw_hdmi *hdmi, void *data);
76 struct dw_hdmi_plat_data {
77 enum dw_hdmi_devtype dev_type;
78 const struct dw_hdmi_audio_tmds_n *tmds_n_table;
79 enum drm_mode_status (*mode_valid)(struct drm_connector *connector,
80 struct drm_display_mode *mode);
81 /* Vendor PHY support */
82 const struct dw_hdmi_phy_ops *phy_ops;
86 /* Synopsys PHY support */
87 const struct dw_hdmi_mpll_config *mpll_cfg;
88 const struct dw_hdmi_curr_ctrl *cur_ctr;
89 const struct dw_hdmi_phy_config *phy_config;
90 int (*configure_phy)(struct dw_hdmi *hdmi,
91 const struct dw_hdmi_plat_data *pdata,
92 unsigned long mpixelclock);
95 void dw_hdmi_unbind(struct device *dev, struct device *master, void *data);
96 int dw_hdmi_bind(struct device *dev, struct device *master,
97 void *data, struct drm_encoder *encoder,
98 struct resource *iores, int irq,
99 const struct dw_hdmi_plat_data *plat_data);
100 void dw_hdmi_suspend(struct device *dev);
101 void dw_hdmi_resume(struct device *dev);
103 void dw_hdmi_set_sample_rate(struct dw_hdmi *hdmi, unsigned int rate);
104 void dw_hdmi_audio_enable(struct dw_hdmi *hdmi);
105 void dw_hdmi_audio_disable(struct dw_hdmi *hdmi);
107 /* PHY configuration */
108 void dw_hdmi_phy_i2c_write(struct dw_hdmi *hdmi, unsigned short data,
111 #endif /* __IMX_HDMI_H__ */