Lines Matching refs:panel
57 * DOC: drm panel
59 * The DRM panel helpers allow drivers to register panel objects with a
68 * drm_panel_init - initialize a panel
69 * @panel: DRM panel
70 * @dev: parent device of the panel
71 * @funcs: panel operations
73 * the panel interface
75 * Initialize the panel structure for subsequent registration with
78 void drm_panel_init(struct drm_panel *panel, struct device *dev,
81 INIT_LIST_HEAD(&panel->list);
82 panel->dev = dev;
83 panel->funcs = funcs;
84 panel->connector_type = connector_type;
89 * drm_panel_add - add a panel to the global registry
90 * @panel: panel to add
92 * Add a panel to the global registry so that it can be looked up by display
97 int drm_panel_add(struct drm_panel *panel)
100 list_add_tail(&panel->list, &panel_list);
108 * drm_panel_remove - remove a panel from the global registry
109 * @panel: DRM panel
111 * Removes a panel from the global registry.
113 void drm_panel_remove(struct drm_panel *panel)
116 list_del_init(&panel->list);
122 * drm_panel_attach - attach a panel to a connector
123 * @panel: DRM panel
126 * After obtaining a pointer to a DRM panel a display driver calls this
127 * function to attach a panel to a connector.
129 * An error is returned if the panel is already attached to another connector.
131 * When unloading, the driver should detach from the panel by calling
136 int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector)
143 * drm_panel_detach - detach a panel from a connector
144 * @panel: DRM panel
146 * Detaches a panel from the connector it is attached to. If a panel is not
149 * This function should not be called by the panel device itself. It
152 void drm_panel_detach(struct drm_panel *panel)
158 * drm_panel_prepare - power on a panel
159 * @panel: DRM panel
162 * the panel. After this has completed it is possible to communicate with any
167 int drm_panel_prepare(struct drm_panel *panel)
169 if (!panel)
172 if (panel->funcs && panel->funcs->prepare)
173 return panel->funcs->prepare(panel);
180 * drm_panel_unprepare - power off a panel
181 * @panel: DRM panel
183 * Calling this function will completely power off a panel (assert the panel's
185 * is usually no longer possible to communicate with the panel until another
190 int drm_panel_unprepare(struct drm_panel *panel)
192 if (!panel)
195 if (panel->funcs && panel->funcs->unprepare)
196 return panel->funcs->unprepare(panel);
203 * drm_panel_enable - enable a panel
204 * @panel: DRM panel
206 * Calling this function will cause the panel display drivers to be turned on
212 int drm_panel_enable(struct drm_panel *panel)
216 if (!panel)
219 if (panel->funcs && panel->funcs->enable) {
220 ret = panel->funcs->enable(panel);
225 ret = backlight_enable(panel->backlight);
227 DRM_DEV_INFO(panel->dev, "failed to enable backlight: %d\n",
235 * drm_panel_disable - disable a panel
236 * @panel: DRM panel
238 * This will typically turn off the panel's backlight or disable the display
244 int drm_panel_disable(struct drm_panel *panel)
248 if (!panel)
251 ret = backlight_disable(panel->backlight);
253 DRM_DEV_INFO(panel->dev, "failed to disable backlight: %d\n",
256 if (panel->funcs && panel->funcs->disable)
257 return panel->funcs->disable(panel);
264 * drm_panel_get_modes - probe the available display modes of a panel
265 * @panel: DRM panel
268 * The modes probed from the panel are automatically added to the connector
269 * that the panel is attached to.
271 * Return: The number of modes available from the panel on success or a
274 int drm_panel_get_modes(struct drm_panel *panel,
277 if (!panel)
280 if (panel->funcs && panel->funcs->get_modes)
281 return panel->funcs->get_modes(panel, connector);
289 * of_drm_find_panel - look up a panel using a device tree node
290 * @np: device tree node of the panel
293 * tree node. If a matching panel is found, return a pointer to it.
295 * Return: A pointer to the panel registered for the specified device tree
296 * node or an ERR_PTR() if no panel matching the device tree node can be found.
300 * - EPROBE_DEFER: the panel device has not been probed yet, and the caller
306 struct drm_panel *panel;
313 list_for_each_entry(panel, &panel_list, list) {
314 if (panel->dev->of_node == np) {
316 return panel;
329 * @panel: DRM panel
331 * Use this function to enable backlight handling if your panel
334 * When the panel is enabled backlight will be enabled after a
337 * When the panel is disabled backlight will be disabled before the
340 * A typical implementation for a panel driver supporting device tree
347 int drm_panel_of_backlight(struct drm_panel *panel)
351 if (!panel || !panel->dev)
354 backlight = devm_of_find_backlight(panel->dev);
359 panel->backlight = backlight;
366 MODULE_DESCRIPTION("DRM panel infrastructure");