diff options
-rw-r--r-- | drivers/gpu/drm/imx/dw_hdmi-imx.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/drivers/gpu/drm/imx/dw_hdmi-imx.c b/drivers/gpu/drm/imx/dw_hdmi-imx.c index 121d30ca2d44..d25aaef3cba6 100644 --- a/drivers/gpu/drm/imx/dw_hdmi-imx.c +++ b/drivers/gpu/drm/imx/dw_hdmi-imx.c | |||
@@ -136,11 +136,34 @@ static struct drm_encoder_funcs dw_hdmi_imx_encoder_funcs = { | |||
136 | .destroy = drm_encoder_cleanup, | 136 | .destroy = drm_encoder_cleanup, |
137 | }; | 137 | }; |
138 | 138 | ||
139 | static enum drm_mode_status imx6q_hdmi_mode_valid(struct drm_connector *con, | ||
140 | struct drm_display_mode *mode) | ||
141 | { | ||
142 | if (mode->clock < 13500) | ||
143 | return MODE_CLOCK_LOW; | ||
144 | if (mode->clock > 266000) | ||
145 | return MODE_CLOCK_HIGH; | ||
146 | |||
147 | return MODE_OK; | ||
148 | } | ||
149 | |||
150 | static enum drm_mode_status imx6dl_hdmi_mode_valid(struct drm_connector *con, | ||
151 | struct drm_display_mode *mode) | ||
152 | { | ||
153 | if (mode->clock < 13500) | ||
154 | return MODE_CLOCK_LOW; | ||
155 | if (mode->clock > 270000) | ||
156 | return MODE_CLOCK_HIGH; | ||
157 | |||
158 | return MODE_OK; | ||
159 | } | ||
160 | |||
139 | static struct dw_hdmi_plat_data imx6q_hdmi_drv_data = { | 161 | static struct dw_hdmi_plat_data imx6q_hdmi_drv_data = { |
140 | .mpll_cfg = imx_mpll_cfg, | 162 | .mpll_cfg = imx_mpll_cfg, |
141 | .cur_ctr = imx_cur_ctr, | 163 | .cur_ctr = imx_cur_ctr, |
142 | .sym_term = imx_sym_term, | 164 | .sym_term = imx_sym_term, |
143 | .dev_type = IMX6Q_HDMI, | 165 | .dev_type = IMX6Q_HDMI, |
166 | .mode_valid = imx6q_hdmi_mode_valid, | ||
144 | }; | 167 | }; |
145 | 168 | ||
146 | static struct dw_hdmi_plat_data imx6dl_hdmi_drv_data = { | 169 | static struct dw_hdmi_plat_data imx6dl_hdmi_drv_data = { |
@@ -148,6 +171,7 @@ static struct dw_hdmi_plat_data imx6dl_hdmi_drv_data = { | |||
148 | .cur_ctr = imx_cur_ctr, | 171 | .cur_ctr = imx_cur_ctr, |
149 | .sym_term = imx_sym_term, | 172 | .sym_term = imx_sym_term, |
150 | .dev_type = IMX6DL_HDMI, | 173 | .dev_type = IMX6DL_HDMI, |
174 | .mode_valid = imx6dl_hdmi_mode_valid, | ||
151 | }; | 175 | }; |
152 | 176 | ||
153 | static const struct of_device_id dw_hdmi_imx_dt_ids[] = { | 177 | static const struct of_device_id dw_hdmi_imx_dt_ids[] = { |