drivers/media/i2c/adv748x/adv748x-afe.c
Source file repositories/reference/linux-study-clean/drivers/media/i2c/adv748x/adv748x-afe.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/i2c/adv748x/adv748x-afe.c- Extension
.c- Size
- 13150 bytes
- Lines
- 540
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/delay.hlinux/module.hlinux/mutex.hlinux/v4l2-dv-timings.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-dv-timings.hmedia/v4l2-ioctl.hadv748x.h
Detected Declarations
function endfunction adv748x_afe_statusfunction adv748x_afe_fill_formatfunction adv748x_afe_stdfunction adv748x_afe_set_video_standardfunction adv748x_afe_s_inputfunction adv748x_afe_g_stdfunction adv748x_afe_s_stdfunction adv748x_afe_querystdfunction adv748x_afe_g_tvnormsfunction adv748x_afe_g_input_statusfunction adv748x_afe_s_streamfunction adv748x_afe_propagate_pixelratefunction adv748x_afe_enum_mbus_codefunction adv748x_afe_get_formatfunction adv748x_afe_set_formatfunction adv748x_afe_s_ctrlfunction adv748x_afe_init_controlsfunction adv748x_afe_initfunction adv748x_afe_cleanup
Annotated Snippet
if (state->endpoints[i]) {
afe->input = i;
break;
}
}
adv748x_afe_s_input(afe, afe->input);
adv_dbg(state, "AFE Default input set to %d\n", afe->input);
/* Entity pads and sinks are 0-indexed to match the pads */
for (i = ADV748X_AFE_SINK_AIN0; i <= ADV748X_AFE_SINK_AIN7; i++)
afe->pads[i].flags = MEDIA_PAD_FL_SINK;
afe->pads[ADV748X_AFE_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
ret = media_entity_pads_init(&afe->sd.entity, ADV748X_AFE_NR_PADS,
afe->pads);
if (ret)
return ret;
ret = adv748x_afe_init_controls(afe);
if (ret)
goto error;
return 0;
error:
media_entity_cleanup(&afe->sd.entity);
return ret;
}
void adv748x_afe_cleanup(struct adv748x_afe *afe)
{
v4l2_device_unregister_subdev(&afe->sd);
media_entity_cleanup(&afe->sd.entity);
v4l2_ctrl_handler_free(&afe->ctrl_hdl);
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/module.h`, `linux/mutex.h`, `linux/v4l2-dv-timings.h`, `media/v4l2-ctrls.h`, `media/v4l2-device.h`, `media/v4l2-dv-timings.h`, `media/v4l2-ioctl.h`.
- Detected declarations: `function end`, `function adv748x_afe_status`, `function adv748x_afe_fill_format`, `function adv748x_afe_std`, `function adv748x_afe_set_video_standard`, `function adv748x_afe_s_input`, `function adv748x_afe_g_std`, `function adv748x_afe_s_std`, `function adv748x_afe_querystd`, `function adv748x_afe_g_tvnorms`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source 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.