Lines Matching refs:panel

57 void drm_panel_init(struct drm_panel *panel, struct device *dev,  in drm_panel_init()  argument
60 INIT_LIST_HEAD(&panel->list); in drm_panel_init()
61 INIT_LIST_HEAD(&panel->followers); in drm_panel_init()
62 mutex_init(&panel->follower_lock); in drm_panel_init()
63 panel->dev = dev; in drm_panel_init()
64 panel->funcs = funcs; in drm_panel_init()
65 panel->connector_type = connector_type; in drm_panel_init()
76 void drm_panel_add(struct drm_panel *panel) in drm_panel_add() argument
79 list_add_tail(&panel->list, &panel_list); in drm_panel_add()
90 void drm_panel_remove(struct drm_panel *panel) in drm_panel_remove() argument
93 list_del_init(&panel->list); in drm_panel_remove()
108 int drm_panel_prepare(struct drm_panel *panel) in drm_panel_prepare() argument
113 if (!panel) in drm_panel_prepare()
116 if (panel->prepared) { in drm_panel_prepare()
117 dev_warn(panel->dev, "Skipping prepare of already prepared panel\n"); in drm_panel_prepare()
121 mutex_lock(&panel->follower_lock); in drm_panel_prepare()
123 if (panel->funcs && panel->funcs->prepare) { in drm_panel_prepare()
124 ret = panel->funcs->prepare(panel); in drm_panel_prepare()
128 panel->prepared = true; in drm_panel_prepare()
130 list_for_each_entry(follower, &panel->followers, list) { in drm_panel_prepare()
133 dev_info(panel->dev, "%ps failed: %d\n", in drm_panel_prepare()
139 mutex_unlock(&panel->follower_lock); in drm_panel_prepare()
156 int drm_panel_unprepare(struct drm_panel *panel) in drm_panel_unprepare() argument
161 if (!panel) in drm_panel_unprepare()
164 if (!panel->prepared) { in drm_panel_unprepare()
165 dev_warn(panel->dev, "Skipping unprepare of already unprepared panel\n"); in drm_panel_unprepare()
169 mutex_lock(&panel->follower_lock); in drm_panel_unprepare()
171 list_for_each_entry(follower, &panel->followers, list) { in drm_panel_unprepare()
174 dev_info(panel->dev, "%ps failed: %d\n", in drm_panel_unprepare()
178 if (panel->funcs && panel->funcs->unprepare) { in drm_panel_unprepare()
179 ret = panel->funcs->unprepare(panel); in drm_panel_unprepare()
183 panel->prepared = false; in drm_panel_unprepare()
187 mutex_unlock(&panel->follower_lock); in drm_panel_unprepare()
203 int drm_panel_enable(struct drm_panel *panel) in drm_panel_enable() argument
207 if (!panel) in drm_panel_enable()
210 if (panel->enabled) { in drm_panel_enable()
211 dev_warn(panel->dev, "Skipping enable of already enabled panel\n"); in drm_panel_enable()
215 if (panel->funcs && panel->funcs->enable) { in drm_panel_enable()
216 ret = panel->funcs->enable(panel); in drm_panel_enable()
220 panel->enabled = true; in drm_panel_enable()
222 ret = backlight_enable(panel->backlight); in drm_panel_enable()
224 DRM_DEV_INFO(panel->dev, "failed to enable backlight: %d\n", in drm_panel_enable()
241 int drm_panel_disable(struct drm_panel *panel) in drm_panel_disable() argument
245 if (!panel) in drm_panel_disable()
248 if (!panel->enabled) { in drm_panel_disable()
249 dev_warn(panel->dev, "Skipping disable of already disabled panel\n"); in drm_panel_disable()
253 ret = backlight_disable(panel->backlight); in drm_panel_disable()
255 DRM_DEV_INFO(panel->dev, "failed to disable backlight: %d\n", in drm_panel_disable()
258 if (panel->funcs && panel->funcs->disable) { in drm_panel_disable()
259 ret = panel->funcs->disable(panel); in drm_panel_disable()
263 panel->enabled = false; in drm_panel_disable()
280 int drm_panel_get_modes(struct drm_panel *panel, in drm_panel_get_modes() argument
283 if (!panel) in drm_panel_get_modes()
286 if (panel->funcs && panel->funcs->get_modes) in drm_panel_get_modes()
287 return panel->funcs->get_modes(panel, connector); in drm_panel_get_modes()
312 struct drm_panel *panel; in of_drm_find_panel() local
319 list_for_each_entry(panel, &panel_list, list) { in of_drm_find_panel()
320 if (panel->dev->of_node == np) { in of_drm_find_panel()
322 return panel; in of_drm_find_panel()
421 struct drm_panel *panel; in drm_panel_add_follower() local
428 panel = of_drm_find_panel(panel_np); in drm_panel_add_follower()
430 if (IS_ERR(panel)) in drm_panel_add_follower()
431 return PTR_ERR(panel); in drm_panel_add_follower()
433 get_device(panel->dev); in drm_panel_add_follower()
434 follower->panel = panel; in drm_panel_add_follower()
436 mutex_lock(&panel->follower_lock); in drm_panel_add_follower()
438 list_add_tail(&follower->list, &panel->followers); in drm_panel_add_follower()
439 if (panel->prepared) { in drm_panel_add_follower()
442 dev_info(panel->dev, "%ps failed: %d\n", in drm_panel_add_follower()
446 mutex_unlock(&panel->follower_lock); in drm_panel_add_follower()
463 struct drm_panel *panel = follower->panel; in drm_panel_remove_follower() local
466 mutex_lock(&panel->follower_lock); in drm_panel_remove_follower()
468 if (panel->prepared) { in drm_panel_remove_follower()
471 dev_info(panel->dev, "%ps failed: %d\n", in drm_panel_remove_follower()
476 mutex_unlock(&panel->follower_lock); in drm_panel_remove_follower()
478 put_device(panel->dev); in drm_panel_remove_follower()
531 int drm_panel_of_backlight(struct drm_panel *panel) in drm_panel_of_backlight() argument
535 if (!panel || !panel->dev) in drm_panel_of_backlight()
538 backlight = devm_of_find_backlight(panel->dev); in drm_panel_of_backlight()
543 panel->backlight = backlight; in drm_panel_of_backlight()