drivers/video/fbdev/mmp/core.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/mmp/core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/mmp/core.c- Extension
.c- Size
- 5860 bytes
- Lines
- 240
- Domain
- Driver Families
- Bucket
- drivers/video
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/slab.hlinux/dma-mapping.hlinux/export.hlinux/module.hvideo/mmp_disp.h
Detected Declarations
function Copyrightfunction path_check_statusfunction path_get_modelistfunction mmp_register_panelfunction mmp_unregister_panelfunction list_for_each_entryfunction mmp_unregister_pathexport mmp_register_panelexport mmp_unregister_panelexport mmp_get_pathexport mmp_register_pathexport mmp_unregister_path
Annotated Snippet
if (!strcmp(panel->plat_path_name, path->name)) {
dev_info(panel->dev, "connect to path %s\n",
path->name);
path->panel = panel;
break;
}
}
mutex_unlock(&disp_lock);
}
EXPORT_SYMBOL_GPL(mmp_register_panel);
/*
* mmp_unregister_panel - unregister panel from panel_list and disconnect
* @p: panel to be unregistered
*
* this function provides interface for panel drivers to unregister panel
* from panel_list and disconnect from path.
*/
void mmp_unregister_panel(struct mmp_panel *panel)
{
struct mmp_path *path;
mutex_lock(&disp_lock);
list_del(&panel->node);
list_for_each_entry(path, &path_list, node) {
if (path->panel && path->panel == panel) {
dev_info(panel->dev, "disconnect from path %s\n",
path->name);
path->panel = NULL;
break;
}
}
mutex_unlock(&disp_lock);
}
EXPORT_SYMBOL_GPL(mmp_unregister_panel);
/*
* mmp_get_path - get path by name
* @p: path name
*
* this function checks path name in path_list and return matching path
* return NULL if no matching path
*/
struct mmp_path *mmp_get_path(const char *name)
{
struct mmp_path *path = NULL, *iter;
mutex_lock(&disp_lock);
list_for_each_entry(iter, &path_list, node) {
if (!strcmp(name, iter->name)) {
path = iter;
break;
}
}
mutex_unlock(&disp_lock);
return path;
}
EXPORT_SYMBOL_GPL(mmp_get_path);
/*
* mmp_register_path - init and register path by path_info
* @p: path info provided by display controller
*
* this function init by path info and register path to path_list
* this function also try to connect path with panel by name
*/
struct mmp_path *mmp_register_path(struct mmp_path_info *info)
{
int i;
struct mmp_path *path = NULL;
struct mmp_panel *panel;
path = kzalloc_flex(*path, overlays, info->overlay_num);
if (!path)
return NULL;
/* path set */
mutex_init(&path->access_ok);
path->dev = info->dev;
path->id = info->id;
path->name = info->name;
path->output_type = info->output_type;
path->overlay_num = info->overlay_num;
path->plat_data = info->plat_data;
path->ops.set_mode = info->set_mode;
mutex_lock(&disp_lock);
Annotation
- Immediate include surface: `linux/slab.h`, `linux/dma-mapping.h`, `linux/export.h`, `linux/module.h`, `video/mmp_disp.h`.
- Detected declarations: `function Copyright`, `function path_check_status`, `function path_get_modelist`, `function mmp_register_panel`, `function mmp_unregister_panel`, `function list_for_each_entry`, `function mmp_unregister_path`, `export mmp_register_panel`, `export mmp_unregister_panel`, `export mmp_get_path`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.