drivers/gpu/drm/bridge/imx/imx-ldb-helper.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/imx/imx-ldb-helper.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/imx/imx-ldb-helper.c- Extension
.c- Size
- 5850 bytes
- Lines
- 231
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/media-bus-format.hlinux/mfd/syscon.hlinux/module.hlinux/of.hlinux/regmap.hdrm/drm_bridge.hdrm/drm_of.hdrm/drm_print.himx-ldb-helper.h
Detected Declarations
function Copyrightfunction ldb_channel_is_split_linkfunction ldb_bridge_atomic_check_helperfunction ldb_bridge_mode_set_helperfunction ldb_bridge_enable_helperfunction ldb_bridge_disable_helperfunction ldb_bridge_attach_helperfunction ldb_init_helperfunction for_each_available_child_of_nodefunction ldb_find_next_bridge_helperfunction ldb_add_bridge_helperfunction ldb_remove_bridge_helperexport ldb_channel_is_single_linkexport ldb_channel_is_split_linkexport ldb_bridge_atomic_check_helperexport ldb_bridge_mode_set_helperexport ldb_bridge_enable_helperexport ldb_bridge_disable_helperexport ldb_bridge_attach_helperexport ldb_init_helperexport ldb_find_next_bridge_helperexport ldb_add_bridge_helperexport ldb_remove_bridge_helper
Annotated Snippet
if (ret || i > MAX_LDB_CHAN_NUM - 1) {
ret = -EINVAL;
DRM_DEV_ERROR(dev,
"invalid channel node address: %u\n", i);
of_node_put(child);
return ret;
}
ldb_ch = ldb->channel[i];
ldb_ch->ldb = ldb;
ldb_ch->chno = i;
ldb_ch->is_available = true;
ldb_ch->np = child;
ldb->available_ch_cnt++;
}
return 0;
}
EXPORT_SYMBOL_GPL(ldb_init_helper);
int ldb_find_next_bridge_helper(struct ldb *ldb)
{
struct device *dev = ldb->dev;
struct ldb_channel *ldb_ch;
int ret, i;
for (i = 0; i < MAX_LDB_CHAN_NUM; i++) {
ldb_ch = ldb->channel[i];
if (!ldb_ch->is_available)
continue;
ldb_ch->next_bridge = devm_drm_of_get_bridge(dev, ldb_ch->np,
1, 0);
if (IS_ERR(ldb_ch->next_bridge)) {
ret = PTR_ERR(ldb_ch->next_bridge);
if (ret != -EPROBE_DEFER)
DRM_DEV_ERROR(dev,
"failed to get next bridge: %d\n",
ret);
return ret;
}
}
return 0;
}
EXPORT_SYMBOL_GPL(ldb_find_next_bridge_helper);
void ldb_add_bridge_helper(struct ldb *ldb)
{
struct ldb_channel *ldb_ch;
int i;
for (i = 0; i < MAX_LDB_CHAN_NUM; i++) {
ldb_ch = ldb->channel[i];
if (!ldb_ch->is_available)
continue;
ldb_ch->bridge.driver_private = ldb_ch;
ldb_ch->bridge.of_node = ldb_ch->np;
drm_bridge_add(&ldb_ch->bridge);
}
}
EXPORT_SYMBOL_GPL(ldb_add_bridge_helper);
void ldb_remove_bridge_helper(struct ldb *ldb)
{
struct ldb_channel *ldb_ch;
int i;
for (i = 0; i < MAX_LDB_CHAN_NUM; i++) {
ldb_ch = ldb->channel[i];
if (!ldb_ch->is_available)
continue;
drm_bridge_remove(&ldb_ch->bridge);
}
}
EXPORT_SYMBOL_GPL(ldb_remove_bridge_helper);
MODULE_DESCRIPTION("i.MX8 LVDS Display Bridge(LDB)/Pixel Mapper bridge helper");
MODULE_AUTHOR("Liu Ying <victor.liu@nxp.com>");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/export.h`, `linux/media-bus-format.h`, `linux/mfd/syscon.h`, `linux/module.h`, `linux/of.h`, `linux/regmap.h`, `drm/drm_bridge.h`, `drm/drm_of.h`.
- Detected declarations: `function Copyright`, `function ldb_channel_is_split_link`, `function ldb_bridge_atomic_check_helper`, `function ldb_bridge_mode_set_helper`, `function ldb_bridge_enable_helper`, `function ldb_bridge_disable_helper`, `function ldb_bridge_attach_helper`, `function ldb_init_helper`, `function for_each_available_child_of_node`, `function ldb_find_next_bridge_helper`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.