drivers/gpu/drm/msm/dp/dp_audio.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/dp/dp_audio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/dp/dp_audio.c- Extension
.c- Size
- 9118 bytes
- Lines
- 380
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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.
- 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/platform_device.hdrm/display/drm_dp_helper.hdrm/drm_edid.hdp_audio.hdp_drm.hdp_panel.hdp_reg.hdp_display.hdp_utils.h
Detected Declarations
struct msm_dp_audio_privatefunction msm_dp_read_linkfunction msm_dp_write_linkfunction msm_dp_audio_stream_sdpfunction msm_dp_audio_timestamp_sdpfunction msm_dp_audio_infoframe_sdpfunction msm_dp_audio_copy_management_sdpfunction msm_dp_audio_isrc_sdpfunction msm_dp_audio_config_sdpfunction msm_dp_audio_setup_sdpfunction msm_dp_audio_setup_acrfunction msm_dp_audio_safe_to_exit_levelfunction msm_dp_audio_enablefunction msm_dp_audio_preparefunction msm_dp_audio_shutdownfunction msm_dp_audio_put
Annotated Snippet
struct msm_dp_audio_private {
struct platform_device *pdev;
struct drm_device *drm_dev;
void __iomem *link_base;
u32 channels;
struct msm_dp_audio msm_dp_audio;
};
static inline u32 msm_dp_read_link(struct msm_dp_audio_private *audio, u32 offset)
{
return readl_relaxed(audio->link_base + offset);
}
static inline void msm_dp_write_link(struct msm_dp_audio_private *audio,
u32 offset, u32 data)
{
/*
* To make sure link reg writes happens before any other operation,
* this function uses writel() instread of writel_relaxed()
*/
writel(data, audio->link_base + offset);
}
static void msm_dp_audio_stream_sdp(struct msm_dp_audio_private *audio)
{
struct dp_sdp_header sdp_hdr = {
.HB0 = 0x00,
.HB1 = 0x02,
.HB2 = 0x00,
.HB3 = audio->channels - 1,
};
u32 header[2];
msm_dp_utils_pack_sdp_header(&sdp_hdr, header);
msm_dp_write_link(audio, MMSS_DP_AUDIO_STREAM_0, header[0]);
msm_dp_write_link(audio, MMSS_DP_AUDIO_STREAM_1, header[1]);
}
static void msm_dp_audio_timestamp_sdp(struct msm_dp_audio_private *audio)
{
struct dp_sdp_header sdp_hdr = {
.HB0 = 0x00,
.HB1 = 0x01,
.HB2 = 0x17,
.HB3 = 0x0 | (0x11 << 2),
};
u32 header[2];
msm_dp_utils_pack_sdp_header(&sdp_hdr, header);
msm_dp_write_link(audio, MMSS_DP_AUDIO_TIMESTAMP_0, header[0]);
msm_dp_write_link(audio, MMSS_DP_AUDIO_TIMESTAMP_1, header[1]);
}
static void msm_dp_audio_infoframe_sdp(struct msm_dp_audio_private *audio)
{
struct dp_sdp_header sdp_hdr = {
.HB0 = 0x00,
.HB1 = 0x84,
.HB2 = 0x1b,
.HB3 = 0x0 | (0x11 << 2),
};
u32 header[2];
msm_dp_utils_pack_sdp_header(&sdp_hdr, header);
msm_dp_write_link(audio, MMSS_DP_AUDIO_INFOFRAME_0, header[0]);
msm_dp_write_link(audio, MMSS_DP_AUDIO_INFOFRAME_1, header[1]);
}
static void msm_dp_audio_copy_management_sdp(struct msm_dp_audio_private *audio)
{
struct dp_sdp_header sdp_hdr = {
.HB0 = 0x00,
.HB1 = 0x05,
.HB2 = 0x0f,
.HB3 = 0x00,
};
u32 header[2];
msm_dp_utils_pack_sdp_header(&sdp_hdr, header);
msm_dp_write_link(audio, MMSS_DP_AUDIO_COPYMANAGEMENT_0, header[0]);
msm_dp_write_link(audio, MMSS_DP_AUDIO_COPYMANAGEMENT_1, header[1]);
}
static void msm_dp_audio_isrc_sdp(struct msm_dp_audio_private *audio)
Annotation
- Immediate include surface: `linux/platform_device.h`, `drm/display/drm_dp_helper.h`, `drm/drm_edid.h`, `dp_audio.h`, `dp_drm.h`, `dp_panel.h`, `dp_reg.h`, `dp_display.h`.
- Detected declarations: `struct msm_dp_audio_private`, `function msm_dp_read_link`, `function msm_dp_write_link`, `function msm_dp_audio_stream_sdp`, `function msm_dp_audio_timestamp_sdp`, `function msm_dp_audio_infoframe_sdp`, `function msm_dp_audio_copy_management_sdp`, `function msm_dp_audio_isrc_sdp`, `function msm_dp_audio_config_sdp`, `function msm_dp_audio_setup_sdp`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.