Commit 90170b18 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/ast: Use drm_connector_helper_get_modes()

The .get_modes() code for VGA and SIL164 connectors does not depend
on either type of connector. Replace the driver code with the common
helper drm_connector_helper_get_modes(). It reads EDID data via
DDC and updates the connector's EDID property.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarSui Jingfeng <sui.jingfeng@linux.dev>
Reviewed-by: default avatarJocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240325200855.21150-12-tzimmermann@suse.de
parent dfff99cb
...@@ -1344,27 +1344,8 @@ static int ast_crtc_init(struct drm_device *dev) ...@@ -1344,27 +1344,8 @@ static int ast_crtc_init(struct drm_device *dev)
* VGA Connector * VGA Connector
*/ */
static int ast_vga_connector_helper_get_modes(struct drm_connector *connector)
{
struct edid *edid;
int count;
edid = drm_get_edid(connector, connector->ddc);
if (!edid)
goto err_drm_get_edid;
count = drm_add_edid_modes(connector, edid);
kfree(edid);
return count;
err_drm_get_edid:
drm_connector_update_edid_property(connector, NULL);
return 0;
}
static const struct drm_connector_helper_funcs ast_vga_connector_helper_funcs = { static const struct drm_connector_helper_funcs ast_vga_connector_helper_funcs = {
.get_modes = ast_vga_connector_helper_get_modes, .get_modes = drm_connector_helper_get_modes,
}; };
static const struct drm_connector_funcs ast_vga_connector_funcs = { static const struct drm_connector_funcs ast_vga_connector_funcs = {
...@@ -1431,27 +1412,8 @@ static int ast_vga_output_init(struct ast_device *ast) ...@@ -1431,27 +1412,8 @@ static int ast_vga_output_init(struct ast_device *ast)
* SIL164 Connector * SIL164 Connector
*/ */
static int ast_sil164_connector_helper_get_modes(struct drm_connector *connector)
{
struct edid *edid;
int count;
edid = drm_get_edid(connector, connector->ddc);
if (!edid)
goto err_drm_get_edid;
count = drm_add_edid_modes(connector, edid);
kfree(edid);
return count;
err_drm_get_edid:
drm_connector_update_edid_property(connector, NULL);
return 0;
}
static const struct drm_connector_helper_funcs ast_sil164_connector_helper_funcs = { static const struct drm_connector_helper_funcs ast_sil164_connector_helper_funcs = {
.get_modes = ast_sil164_connector_helper_get_modes, .get_modes = drm_connector_helper_get_modes,
}; };
static const struct drm_connector_funcs ast_sil164_connector_funcs = { static const struct drm_connector_funcs ast_sil164_connector_funcs = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment