@@ -103,33 +103,11 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder,
103
103
struct drm_display_mode * mode = & encoder -> crtc -> state -> adjusted_mode ;
104
104
struct sun4i_hdmi * hdmi = drm_encoder_to_sun4i_hdmi (encoder );
105
105
struct drm_display_info * display = & hdmi -> connector .display_info ;
106
+ unsigned int x , y ;
106
107
u32 val = 0 ;
107
108
108
109
DRM_DEBUG_DRIVER ("Enabling the HDMI Output\n" );
109
110
110
- clk_prepare_enable (hdmi -> tmds_clk );
111
-
112
- sun4i_hdmi_setup_avi_infoframes (hdmi , mode );
113
- val |= SUN4I_HDMI_PKT_CTRL_TYPE (0 , SUN4I_HDMI_PKT_AVI );
114
- val |= SUN4I_HDMI_PKT_CTRL_TYPE (1 , SUN4I_HDMI_PKT_END );
115
- writel (val , hdmi -> base + SUN4I_HDMI_PKT_CTRL_REG (0 ));
116
-
117
- val = SUN4I_HDMI_VID_CTRL_ENABLE ;
118
- if (display -> is_hdmi )
119
- val |= SUN4I_HDMI_VID_CTRL_HDMI_MODE ;
120
-
121
- writel (val , hdmi -> base + SUN4I_HDMI_VID_CTRL_REG );
122
- }
123
-
124
- static void sun4i_hdmi_mode_set (struct drm_encoder * encoder ,
125
- struct drm_crtc_state * crtc_state ,
126
- struct drm_connector_state * conn_state )
127
- {
128
- const struct drm_display_mode * mode = & crtc_state -> mode ;
129
- struct sun4i_hdmi * hdmi = drm_encoder_to_sun4i_hdmi (encoder );
130
- unsigned int x , y ;
131
- u32 val ;
132
-
133
111
clk_set_rate (hdmi -> mod_clk , mode -> crtc_clock * 1000 );
134
112
clk_set_rate (hdmi -> tmds_clk , mode -> crtc_clock * 1000 );
135
113
@@ -181,6 +159,19 @@ static void sun4i_hdmi_mode_set(struct drm_encoder *encoder,
181
159
val |= SUN4I_HDMI_VID_TIMING_POL_VSYNC ;
182
160
183
161
writel (val , hdmi -> base + SUN4I_HDMI_VID_TIMING_POL_REG );
162
+
163
+ clk_prepare_enable (hdmi -> tmds_clk );
164
+
165
+ sun4i_hdmi_setup_avi_infoframes (hdmi , mode );
166
+ val |= SUN4I_HDMI_PKT_CTRL_TYPE (0 , SUN4I_HDMI_PKT_AVI );
167
+ val |= SUN4I_HDMI_PKT_CTRL_TYPE (1 , SUN4I_HDMI_PKT_END );
168
+ writel (val , hdmi -> base + SUN4I_HDMI_PKT_CTRL_REG (0 ));
169
+
170
+ val = SUN4I_HDMI_VID_CTRL_ENABLE ;
171
+ if (display -> is_hdmi )
172
+ val |= SUN4I_HDMI_VID_CTRL_HDMI_MODE ;
173
+
174
+ writel (val , hdmi -> base + SUN4I_HDMI_VID_CTRL_REG );
184
175
}
185
176
186
177
static enum drm_mode_status sun4i_hdmi_mode_valid (struct drm_encoder * encoder ,
@@ -206,7 +197,6 @@ static const struct drm_encoder_helper_funcs sun4i_hdmi_helper_funcs = {
206
197
.atomic_check = sun4i_hdmi_atomic_check ,
207
198
.atomic_disable = sun4i_hdmi_disable ,
208
199
.atomic_enable = sun4i_hdmi_enable ,
209
- .atomic_mode_set = sun4i_hdmi_mode_set ,
210
200
.mode_valid = sun4i_hdmi_mode_valid ,
211
201
};
212
202
0 commit comments