aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/imx/dw_hdmi-imx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/imx/dw_hdmi-imx.c')
-rw-r--r--drivers/gpu/drm/imx/dw_hdmi-imx.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/gpu/drm/imx/dw_hdmi-imx.c b/drivers/gpu/drm/imx/dw_hdmi-imx.c
index a24631fdf4ad..359cd2765552 100644
--- a/drivers/gpu/drm/imx/dw_hdmi-imx.c
+++ b/drivers/gpu/drm/imx/dw_hdmi-imx.c
@@ -28,6 +28,11 @@ struct imx_hdmi {
28 struct regmap *regmap; 28 struct regmap *regmap;
29}; 29};
30 30
31static inline struct imx_hdmi *enc_to_imx_hdmi(struct drm_encoder *e)
32{
33 return container_of(e, struct imx_hdmi, encoder);
34}
35
31static const struct dw_hdmi_mpll_config imx_mpll_cfg[] = { 36static const struct dw_hdmi_mpll_config imx_mpll_cfg[] = {
32 { 37 {
33 45250000, { 38 45250000, {
@@ -109,15 +114,9 @@ static void dw_hdmi_imx_encoder_disable(struct drm_encoder *encoder)
109{ 114{
110} 115}
111 116
112static void dw_hdmi_imx_encoder_mode_set(struct drm_encoder *encoder, 117static void dw_hdmi_imx_encoder_enable(struct drm_encoder *encoder)
113 struct drm_display_mode *mode,
114 struct drm_display_mode *adj_mode)
115{ 118{
116} 119 struct imx_hdmi *hdmi = enc_to_imx_hdmi(encoder);
117
118static void dw_hdmi_imx_encoder_commit(struct drm_encoder *encoder)
119{
120 struct imx_hdmi *hdmi = container_of(encoder, struct imx_hdmi, encoder);
121 int mux = drm_of_encoder_active_port_id(hdmi->dev->of_node, encoder); 120 int mux = drm_of_encoder_active_port_id(hdmi->dev->of_node, encoder);
122 121
123 regmap_update_bits(hdmi->regmap, IOMUXC_GPR3, 122 regmap_update_bits(hdmi->regmap, IOMUXC_GPR3,
@@ -125,16 +124,23 @@ static void dw_hdmi_imx_encoder_commit(struct drm_encoder *encoder)
125 mux << IMX6Q_GPR3_HDMI_MUX_CTL_SHIFT); 124 mux << IMX6Q_GPR3_HDMI_MUX_CTL_SHIFT);
126} 125}
127 126
128static void dw_hdmi_imx_encoder_prepare(struct drm_encoder *encoder) 127static int dw_hdmi_imx_atomic_check(struct drm_encoder *encoder,
128 struct drm_crtc_state *crtc_state,
129 struct drm_connector_state *conn_state)
129{ 130{
130 imx_drm_set_bus_format(encoder, MEDIA_BUS_FMT_RGB888_1X24); 131 struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(crtc_state);
132
133 imx_crtc_state->bus_format = MEDIA_BUS_FMT_RGB888_1X24;
134 imx_crtc_state->di_hsync_pin = 2;
135 imx_crtc_state->di_vsync_pin = 3;
136
137 return 0;
131} 138}
132 139
133static const struct drm_encoder_helper_funcs dw_hdmi_imx_encoder_helper_funcs = { 140static const struct drm_encoder_helper_funcs dw_hdmi_imx_encoder_helper_funcs = {
134 .mode_set = dw_hdmi_imx_encoder_mode_set, 141 .enable = dw_hdmi_imx_encoder_enable,
135 .prepare = dw_hdmi_imx_encoder_prepare,
136 .commit = dw_hdmi_imx_encoder_commit,
137 .disable = dw_hdmi_imx_encoder_disable, 142 .disable = dw_hdmi_imx_encoder_disable,
143 .atomic_check = dw_hdmi_imx_atomic_check,
138}; 144};
139 145
140static const struct drm_encoder_funcs dw_hdmi_imx_encoder_funcs = { 146static const struct drm_encoder_funcs dw_hdmi_imx_encoder_funcs = {