drivers/video/fbdev/omap2/omapfb/dss/hdmi_wp.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/omap2/omapfb/dss/hdmi_wp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/omap2/omapfb/dss/hdmi_wp.c- Extension
.c- Size
- 7441 bytes
- Lines
- 282
- Domain
- Driver Families
- Bucket
- drivers/video
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/err.hlinux/io.hlinux/platform_device.hlinux/seq_file.hvideo/omapfb_dss.hdss.hhdmi.h
Detected Declarations
function Copyrightfunction hdmi_wp_get_irqstatusfunction hdmi_wp_set_irqstatusfunction hdmi_wp_set_irqenablefunction hdmi_wp_clear_irqenablefunction hdmi_wp_set_phy_pwrfunction hdmi_wp_set_pll_pwrfunction hdmi_wp_video_startfunction hdmi_wp_video_stopfunction hdmi_wp_video_config_formatfunction hdmi_wp_video_config_interfacefunction hdmi_wp_video_config_timingfunction hdmi_wp_init_vid_fmt_timingsfunction hdmi_wp_audio_config_formatfunction omapdss_get_versionfunction hdmi_wp_audio_config_dmafunction hdmi_wp_audio_enablefunction hdmi_wp_audio_core_req_enablefunction hdmi_wp_initfunction hdmi_wp_get_audio_dma_addr
Annotated Snippet
omapdss_get_version() == OMAPDSS_VER_OMAP4) {
r = FLD_MOD(r, aud_fmt->stereo_channels, 26, 24);
r = FLD_MOD(r, aud_fmt->active_chnnls_msk, 23, 16);
}
r = FLD_MOD(r, aud_fmt->en_sig_blk_strt_end, 5, 5);
r = FLD_MOD(r, aud_fmt->type, 4, 4);
r = FLD_MOD(r, aud_fmt->justification, 3, 3);
r = FLD_MOD(r, aud_fmt->sample_order, 2, 2);
r = FLD_MOD(r, aud_fmt->samples_per_word, 1, 1);
r = FLD_MOD(r, aud_fmt->sample_size, 0, 0);
hdmi_write_reg(wp->base, HDMI_WP_AUDIO_CFG, r);
}
void hdmi_wp_audio_config_dma(struct hdmi_wp_data *wp,
struct hdmi_audio_dma *aud_dma)
{
u32 r;
DSSDBG("Enter hdmi_wp_audio_config_dma\n");
r = hdmi_read_reg(wp->base, HDMI_WP_AUDIO_CFG2);
r = FLD_MOD(r, aud_dma->transfer_size, 15, 8);
r = FLD_MOD(r, aud_dma->block_size, 7, 0);
hdmi_write_reg(wp->base, HDMI_WP_AUDIO_CFG2, r);
r = hdmi_read_reg(wp->base, HDMI_WP_AUDIO_CTRL);
r = FLD_MOD(r, aud_dma->mode, 9, 9);
r = FLD_MOD(r, aud_dma->fifo_threshold, 8, 0);
hdmi_write_reg(wp->base, HDMI_WP_AUDIO_CTRL, r);
}
int hdmi_wp_audio_enable(struct hdmi_wp_data *wp, bool enable)
{
REG_FLD_MOD(wp->base, HDMI_WP_AUDIO_CTRL, enable, 31, 31);
return 0;
}
int hdmi_wp_audio_core_req_enable(struct hdmi_wp_data *wp, bool enable)
{
REG_FLD_MOD(wp->base, HDMI_WP_AUDIO_CTRL, enable, 30, 30);
return 0;
}
int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
{
struct resource *res;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "wp");
if (!res) {
DSSERR("can't get WP mem resource\n");
return -EINVAL;
}
wp->phys_base = res->start;
wp->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(wp->base)) {
DSSERR("can't ioremap HDMI WP\n");
return PTR_ERR(wp->base);
}
return 0;
}
phys_addr_t hdmi_wp_get_audio_dma_addr(struct hdmi_wp_data *wp)
{
return wp->phys_base + HDMI_WP_AUDIO_DATA;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/err.h`, `linux/io.h`, `linux/platform_device.h`, `linux/seq_file.h`, `video/omapfb_dss.h`, `dss.h`, `hdmi.h`.
- Detected declarations: `function Copyright`, `function hdmi_wp_get_irqstatus`, `function hdmi_wp_set_irqstatus`, `function hdmi_wp_set_irqenable`, `function hdmi_wp_clear_irqenable`, `function hdmi_wp_set_phy_pwr`, `function hdmi_wp_set_pll_pwr`, `function hdmi_wp_video_start`, `function hdmi_wp_video_stop`, `function hdmi_wp_video_config_format`.
- Atlas domain: Driver Families / drivers/video.
- 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.