Lines Matching +full:charge +full:- +full:integration
4 * Permission is hereby granted, free of charge, to any person obtaining a
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
42 * For easy integration into drivers using the &drm_bridge infrastructure please
47 * drm_panel_init - initialize a panel
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()
70 * drm_panel_add - add a panel to the global registry
79 list_add_tail(&panel->list, &panel_list); in drm_panel_add()
85 * drm_panel_remove - remove a panel from the global registry
93 list_del_init(&panel->list); in drm_panel_remove()
99 * drm_panel_prepare - power on a panel
114 return -EINVAL; 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()
131 ret = follower->funcs->panel_prepared(follower); in drm_panel_prepare()
133 dev_info(panel->dev, "%ps failed: %d\n", in drm_panel_prepare()
134 follower->funcs->panel_prepared, ret); in drm_panel_prepare()
139 mutex_unlock(&panel->follower_lock); in drm_panel_prepare()
146 * drm_panel_unprepare - power off a panel
162 return -EINVAL; in drm_panel_unprepare()
166 * - Your panel driver incorrectly calls drm_panel_unprepare() in its in drm_panel_unprepare()
168 * - You are using panel-edp or panel-simple and your DRM modeset in drm_panel_unprepare()
173 if (!panel->prepared) { in drm_panel_unprepare()
174 dev_warn(panel->dev, "Skipping unprepare of already unprepared panel\n"); in drm_panel_unprepare()
178 mutex_lock(&panel->follower_lock); in drm_panel_unprepare()
180 list_for_each_entry(follower, &panel->followers, list) { in drm_panel_unprepare()
181 ret = follower->funcs->panel_unpreparing(follower); in drm_panel_unprepare()
183 dev_info(panel->dev, "%ps failed: %d\n", in drm_panel_unprepare()
184 follower->funcs->panel_unpreparing, ret); in drm_panel_unprepare()
187 if (panel->funcs && panel->funcs->unprepare) { in drm_panel_unprepare()
188 ret = panel->funcs->unprepare(panel); in drm_panel_unprepare()
192 panel->prepared = false; in drm_panel_unprepare()
196 mutex_unlock(&panel->follower_lock); in drm_panel_unprepare()
203 * drm_panel_enable - enable a panel
217 return -EINVAL; in drm_panel_enable()
219 if (panel->enabled) { in drm_panel_enable()
220 dev_warn(panel->dev, "Skipping enable of already enabled panel\n"); in drm_panel_enable()
224 if (panel->funcs && panel->funcs->enable) { in drm_panel_enable()
225 ret = panel->funcs->enable(panel); in drm_panel_enable()
229 panel->enabled = true; in drm_panel_enable()
231 ret = backlight_enable(panel->backlight); in drm_panel_enable()
233 DRM_DEV_INFO(panel->dev, "failed to enable backlight: %d\n", in drm_panel_enable()
241 * drm_panel_disable - disable a panel
255 return -EINVAL; in drm_panel_disable()
259 * - Your panel driver incorrectly calls drm_panel_disable() in its in drm_panel_disable()
261 * - You are using panel-edp or panel-simple and your DRM modeset in drm_panel_disable()
266 if (!panel->enabled) { in drm_panel_disable()
267 dev_warn(panel->dev, "Skipping disable of already disabled panel\n"); in drm_panel_disable()
271 ret = backlight_disable(panel->backlight); in drm_panel_disable()
273 DRM_DEV_INFO(panel->dev, "failed to disable backlight: %d\n", in drm_panel_disable()
276 if (panel->funcs && panel->funcs->disable) { in drm_panel_disable()
277 ret = panel->funcs->disable(panel); in drm_panel_disable()
281 panel->enabled = false; in drm_panel_disable()
288 * drm_panel_get_modes - probe the available display modes of a panel
304 if (panel->funcs && panel->funcs->get_modes) { in drm_panel_get_modes()
307 num = panel->funcs->get_modes(panel, connector); in drm_panel_get_modes()
318 * of_drm_find_panel - look up a panel using a device tree node
329 * - EPROBE_DEFER: the panel device has not been probed yet, and the caller
331 * - ENODEV: the device is not available (status != "okay" or "ok")
338 return ERR_PTR(-ENODEV); in of_drm_find_panel()
343 if (panel->dev->of_node == np) { in of_drm_find_panel()
350 return ERR_PTR(-EPROBE_DEFER); in of_drm_find_panel()
355 * of_drm_get_panel_orientation - look up the orientation of the panel through
373 if (ret == -EINVAL) { in of_drm_get_panel_orientation()
391 return -EINVAL; in of_drm_get_panel_orientation()
399 * drm_is_panel_follower() - Check if the device is a panel follower
416 return of_property_read_bool(dev->of_node, "panel"); in drm_is_panel_follower()
421 * drm_panel_add_follower() - Register something to follow panel state.
436 * Return: 0 or an error code. Note that -ENODEV means that we detected that
447 panel_np = of_parse_phandle(follower_dev->of_node, "panel", 0); in drm_panel_add_follower()
449 return -ENODEV; in drm_panel_add_follower()
456 get_device(panel->dev); in drm_panel_add_follower()
457 follower->panel = panel; in drm_panel_add_follower()
459 mutex_lock(&panel->follower_lock); in drm_panel_add_follower()
461 list_add_tail(&follower->list, &panel->followers); in drm_panel_add_follower()
462 if (panel->prepared) { in drm_panel_add_follower()
463 ret = follower->funcs->panel_prepared(follower); in drm_panel_add_follower()
465 dev_info(panel->dev, "%ps failed: %d\n", in drm_panel_add_follower()
466 follower->funcs->panel_prepared, ret); in drm_panel_add_follower()
469 mutex_unlock(&panel->follower_lock); in drm_panel_add_follower()
476 * drm_panel_remove_follower() - Reverse drm_panel_add_follower().
486 struct drm_panel *panel = follower->panel; in drm_panel_remove_follower()
489 mutex_lock(&panel->follower_lock); in drm_panel_remove_follower()
491 if (panel->prepared) { in drm_panel_remove_follower()
492 ret = follower->funcs->panel_unpreparing(follower); in drm_panel_remove_follower()
494 dev_info(panel->dev, "%ps failed: %d\n", in drm_panel_remove_follower()
495 follower->funcs->panel_unpreparing, ret); in drm_panel_remove_follower()
497 list_del_init(&follower->list); in drm_panel_remove_follower()
499 mutex_unlock(&panel->follower_lock); in drm_panel_remove_follower()
501 put_device(panel->dev); in drm_panel_remove_follower()
511 * devm_drm_panel_add_follower() - devm version of drm_panel_add_follower()
535 * drm_panel_of_backlight - use backlight device node for backlight
558 if (!panel || !panel->dev) in drm_panel_of_backlight()
559 return -EINVAL; in drm_panel_of_backlight()
561 backlight = devm_of_find_backlight(panel->dev); in drm_panel_of_backlight()
566 panel->backlight = backlight; in drm_panel_of_backlight()