Lines Matching +full:panel +full:- +full:lvds

1 // SPDX-License-Identifier: GPL-2.0+
4 * Maxime Ripard <maxime.ripard@free-electrons.com>
23 struct drm_panel *panel; member
42 struct sun4i_lvds *lvds = in sun4i_lvds_get_modes() local
45 return drm_panel_get_modes(lvds->panel); in sun4i_lvds_get_modes()
55 struct sun4i_lvds *lvds = drm_connector_to_sun4i_lvds(connector); in sun4i_lvds_connector_destroy() local
57 drm_panel_detach(lvds->panel); in sun4i_lvds_connector_destroy()
71 struct sun4i_lvds *lvds = drm_encoder_to_sun4i_lvds(encoder); in sun4i_lvds_encoder_enable() local
73 DRM_DEBUG_DRIVER("Enabling LVDS output\n"); in sun4i_lvds_encoder_enable()
75 if (lvds->panel) { in sun4i_lvds_encoder_enable()
76 drm_panel_prepare(lvds->panel); in sun4i_lvds_encoder_enable()
77 drm_panel_enable(lvds->panel); in sun4i_lvds_encoder_enable()
83 struct sun4i_lvds *lvds = drm_encoder_to_sun4i_lvds(encoder); in sun4i_lvds_encoder_disable() local
85 DRM_DEBUG_DRIVER("Disabling LVDS output\n"); in sun4i_lvds_encoder_disable()
87 if (lvds->panel) { in sun4i_lvds_encoder_disable()
88 drm_panel_disable(lvds->panel); in sun4i_lvds_encoder_disable()
89 drm_panel_unprepare(lvds->panel); in sun4i_lvds_encoder_disable()
106 struct sun4i_lvds *lvds; in sun4i_lvds_init() local
109 lvds = devm_kzalloc(drm->dev, sizeof(*lvds), GFP_KERNEL); in sun4i_lvds_init()
110 if (!lvds) in sun4i_lvds_init()
111 return -ENOMEM; in sun4i_lvds_init()
112 encoder = &lvds->encoder; in sun4i_lvds_init()
114 ret = drm_of_find_panel_or_bridge(tcon->dev->of_node, 1, 0, in sun4i_lvds_init()
115 &lvds->panel, &bridge); in sun4i_lvds_init()
117 dev_info(drm->dev, "No panel or bridge found... LVDS output disabled\n"); in sun4i_lvds_init()
121 drm_encoder_helper_add(&lvds->encoder, in sun4i_lvds_init()
124 &lvds->encoder, in sun4i_lvds_init()
129 dev_err(drm->dev, "Couldn't initialise the lvds encoder\n"); in sun4i_lvds_init()
133 /* The LVDS encoder can only work with the TCON channel 0 */ in sun4i_lvds_init()
134 lvds->encoder.possible_crtcs = drm_crtc_mask(&tcon->crtc->crtc); in sun4i_lvds_init()
136 if (lvds->panel) { in sun4i_lvds_init()
137 drm_connector_helper_add(&lvds->connector, in sun4i_lvds_init()
139 ret = drm_connector_init(drm, &lvds->connector, in sun4i_lvds_init()
143 dev_err(drm->dev, "Couldn't initialise the lvds connector\n"); in sun4i_lvds_init()
147 drm_connector_attach_encoder(&lvds->connector, in sun4i_lvds_init()
148 &lvds->encoder); in sun4i_lvds_init()
150 ret = drm_panel_attach(lvds->panel, &lvds->connector); in sun4i_lvds_init()
152 dev_err(drm->dev, "Couldn't attach our panel\n"); in sun4i_lvds_init()
160 dev_err(drm->dev, "Couldn't attach our bridge\n"); in sun4i_lvds_init()
168 drm_encoder_cleanup(&lvds->encoder); in sun4i_lvds_init()