Lines Matching +full:op +full:- +full:panel

1 // SPDX-License-Identifier: GPL-2.0-or-later
11 #include <linux/dma-mapping.h>
19 if (path && overlay_id < path->overlay_num) in path_get_overlay()
20 return &path->overlays[overlay_id]; in path_get_overlay()
27 for (i = 0; i < path->overlay_num; i++) in path_check_status()
28 if (path->overlays[i].status) in path_check_status()
37 * this function fetches modelist from phy/panel:
39 * or get from panel
46 if (path->panel && path->panel->get_modelist) in path_get_modelist()
47 return path->panel->get_modelist(path->panel, modelist); in path_get_modelist()
53 * panel list is used to pair panel/path when path/panel registered
56 * panel driver do panel register/unregister
64 * mmp_register_panel - register panel to panel_list and connect to path
65 * @p: panel to be registered
67 * this function provides interface for panel drivers to register panel
68 * to panel_list and connect to path which matchs panel->plat_path_name.
70 * panel register is permitted.
72 void mmp_register_panel(struct mmp_panel *panel) in mmp_register_panel() argument
79 list_add_tail(&panel->node, &panel_list); in mmp_register_panel()
83 if (!strcmp(panel->plat_path_name, path->name)) { in mmp_register_panel()
84 dev_info(panel->dev, "connect to path %s\n", in mmp_register_panel()
85 path->name); in mmp_register_panel()
86 path->panel = panel; in mmp_register_panel()
96 * mmp_unregister_panel - unregister panel from panel_list and disconnect
97 * @p: panel to be unregistered
99 * this function provides interface for panel drivers to unregister panel
102 void mmp_unregister_panel(struct mmp_panel *panel) in mmp_unregister_panel() argument
107 list_del(&panel->node); in mmp_unregister_panel()
110 if (path->panel && path->panel == panel) { in mmp_unregister_panel()
111 dev_info(panel->dev, "disconnect from path %s\n", in mmp_unregister_panel()
112 path->name); in mmp_unregister_panel()
113 path->panel = NULL; in mmp_unregister_panel()
122 * mmp_get_path - get path by name
134 if (!strcmp(name, iter->name)) { in mmp_get_path()
146 * mmp_register_path - init and register path by path_info
150 * this function also try to connect path with panel by name
156 struct mmp_panel *panel; in mmp_register_path() local
158 path = kzalloc(struct_size(path, overlays, info->overlay_num), in mmp_register_path()
164 mutex_init(&path->access_ok); in mmp_register_path()
165 path->dev = info->dev; in mmp_register_path()
166 path->id = info->id; in mmp_register_path()
167 path->name = info->name; in mmp_register_path()
168 path->output_type = info->output_type; in mmp_register_path()
169 path->overlay_num = info->overlay_num; in mmp_register_path()
170 path->plat_data = info->plat_data; in mmp_register_path()
171 path->ops.set_mode = info->set_mode; in mmp_register_path()
174 /* get panel */ in mmp_register_path()
175 list_for_each_entry(panel, &panel_list, node) { in mmp_register_path()
176 if (!strcmp(info->name, panel->plat_path_name)) { in mmp_register_path()
177 dev_info(path->dev, "get panel %s\n", panel->name); in mmp_register_path()
178 path->panel = panel; in mmp_register_path()
183 dev_info(path->dev, "register %s, overlay_num %d\n", in mmp_register_path()
184 path->name, path->overlay_num); in mmp_register_path()
186 /* default op set: if already set by driver, never cover it */ in mmp_register_path()
187 if (!path->ops.check_status) in mmp_register_path()
188 path->ops.check_status = path_check_status; in mmp_register_path()
189 if (!path->ops.get_overlay) in mmp_register_path()
190 path->ops.get_overlay = path_get_overlay; in mmp_register_path()
191 if (!path->ops.get_modelist) in mmp_register_path()
192 path->ops.get_modelist = path_get_modelist; in mmp_register_path()
195 for (i = 0; i < path->overlay_num; i++) { in mmp_register_path()
196 path->overlays[i].path = path; in mmp_register_path()
197 path->overlays[i].id = i; in mmp_register_path()
198 mutex_init(&path->overlays[i].access_ok); in mmp_register_path()
199 path->overlays[i].ops = info->overlay_ops; in mmp_register_path()
203 list_add_tail(&path->node, &path_list); in mmp_register_path()
211 * mmp_unregister_path - unregister and destroy path
225 list_del(&path->node); in mmp_unregister_path()
228 for (i = 0; i < path->overlay_num; i++) in mmp_unregister_path()
229 mutex_destroy(&path->overlays[i].access_ok); in mmp_unregister_path()
231 mutex_destroy(&path->access_ok); in mmp_unregister_path()