The sun4i HDMI connector reset implementation creates a pristine state and initializes the HDMI state. It does not perform any hardware reset.
Since this is equivalent to what atomic_create_state expects, convert the reset function to an atomic_create_state hook that returns the initialized state. Signed-off-by: Maxime Ripard <[email protected]> --- Cc: Chen-Yu Tsai <[email protected]> Cc: Samuel Holland <[email protected]> Cc: [email protected] --- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c index d98b6f12a7bc..1226228c2ab3 100644 --- a/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +++ b/drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c @@ -283,21 +283,30 @@ sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force) } return connector_status_connected; } -static void sun4i_hdmi_connector_reset(struct drm_connector *connector) +static struct drm_connector_state * +sun4i_hdmi_connector_create_state(struct drm_connector *connector) { - drm_atomic_helper_connector_reset(connector); - __drm_atomic_helper_connector_hdmi_state_init(connector, connector->state); + struct drm_connector_state *connector_state; + + connector_state = drm_atomic_helper_connector_create_state(connector); + if (IS_ERR(connector_state)) + return connector_state; + + __drm_atomic_helper_connector_hdmi_state_init(connector, + connector_state); + + return connector_state; } static const struct drm_connector_funcs sun4i_hdmi_connector_funcs = { .debugfs_init = drm_hdmi_connector_debugfs_init, .detect = sun4i_hdmi_connector_detect, .fill_modes = drm_helper_probe_single_connector_modes, - .reset = sun4i_hdmi_connector_reset, + .atomic_create_state = sun4i_hdmi_connector_create_state, .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; #ifdef CONFIG_DRM_SUN4I_HDMI_CEC -- 2.55.0
