Lines Matching +full:device +full:- +full:tree
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
47 * drm_panel_init - initialize a panel
49 * @dev: parent device of the panel
57 void drm_panel_init(struct drm_panel *panel, struct device *dev, in drm_panel_init()
60 INIT_LIST_HEAD(&panel->list); in drm_panel_init()
61 panel->dev = dev; in drm_panel_init()
62 panel->funcs = funcs; in drm_panel_init()
63 panel->connector_type = connector_type; in drm_panel_init()
68 * drm_panel_add - add a panel to the global registry
77 list_add_tail(&panel->list, &panel_list); in drm_panel_add()
83 * drm_panel_remove - remove a panel from the global registry
91 list_del_init(&panel->list); in drm_panel_remove()
97 * drm_panel_prepare - power on a panel
109 return -EINVAL; in drm_panel_prepare()
111 if (panel->funcs && panel->funcs->prepare) in drm_panel_prepare()
112 return panel->funcs->prepare(panel); in drm_panel_prepare()
119 * drm_panel_unprepare - power off a panel
132 return -EINVAL; in drm_panel_unprepare()
134 if (panel->funcs && panel->funcs->unprepare) in drm_panel_unprepare()
135 return panel->funcs->unprepare(panel); in drm_panel_unprepare()
142 * drm_panel_enable - enable a panel
156 return -EINVAL; in drm_panel_enable()
158 if (panel->funcs && panel->funcs->enable) { in drm_panel_enable()
159 ret = panel->funcs->enable(panel); in drm_panel_enable()
164 ret = backlight_enable(panel->backlight); in drm_panel_enable()
166 DRM_DEV_INFO(panel->dev, "failed to enable backlight: %d\n", in drm_panel_enable()
174 * drm_panel_disable - disable a panel
188 return -EINVAL; in drm_panel_disable()
190 ret = backlight_disable(panel->backlight); in drm_panel_disable()
192 DRM_DEV_INFO(panel->dev, "failed to disable backlight: %d\n", in drm_panel_disable()
195 if (panel->funcs && panel->funcs->disable) in drm_panel_disable()
196 return panel->funcs->disable(panel); in drm_panel_disable()
203 * drm_panel_get_modes - probe the available display modes of a panel
217 return -EINVAL; in drm_panel_get_modes()
219 if (panel->funcs && panel->funcs->get_modes) in drm_panel_get_modes()
220 return panel->funcs->get_modes(panel, connector); in drm_panel_get_modes()
222 return -EOPNOTSUPP; in drm_panel_get_modes()
228 * of_drm_find_panel - look up a panel using a device tree node
229 * @np: device tree node of the panel
231 * Searches the set of registered panels for one that matches the given device
232 * tree node. If a matching panel is found, return a pointer to it.
234 * Return: A pointer to the panel registered for the specified device tree
235 * node or an ERR_PTR() if no panel matching the device tree node can be found.
239 * - EPROBE_DEFER: the panel device has not been probed yet, and the caller
241 * - ENODEV: the device is not available (status != "okay" or "ok")
248 return ERR_PTR(-ENODEV); in of_drm_find_panel()
253 if (panel->dev->of_node == np) { in of_drm_find_panel()
260 return ERR_PTR(-EPROBE_DEFER); in of_drm_find_panel()
265 * of_drm_get_panel_orientation - look up the orientation of the panel through
266 * the "rotation" binding from a device tree node
267 * @np: device tree node of the panel
270 * Looks up the rotation of a panel in the device tree. The orientation of the
271 * panel is expressed as a property name "rotation" in the device tree. The
272 * rotation in the device tree is counter clockwise.
283 if (ret == -EINVAL) { in of_drm_get_panel_orientation()
301 return -EINVAL; in of_drm_get_panel_orientation()
310 * drm_panel_of_backlight - use backlight device node for backlight
314 * uses device tree and has a backlight phandle.
322 * A typical implementation for a panel driver supporting device tree
333 if (!panel || !panel->dev) in drm_panel_of_backlight()
334 return -EINVAL; in drm_panel_of_backlight()
336 backlight = devm_of_find_backlight(panel->dev); in drm_panel_of_backlight()
341 panel->backlight = backlight; in drm_panel_of_backlight()