drivers/gpu/drm/tegra/hdmi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/tegra/hdmi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/tegra/hdmi.c- Extension
.c- Size
- 57546 bytes
- Lines
- 1927
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/clk.hlinux/debugfs.hlinux/delay.hlinux/hdmi.hlinux/math64.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_opp.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/reset.hsoc/tegra/common.hsound/hdmi-codec.hdrm/drm_bridge_connector.hdrm/drm_atomic_helper.hdrm/drm_crtc.hdrm/drm_debugfs.hdrm/drm_edid.hdrm/drm_encoder.hdrm/drm_eld.hdrm/drm_file.hdrm/drm_fourcc.hdrm/drm_print.hdrm/drm_probe_helper.hhda.hhdmi.hdrm.hdc.htrace.h
Detected Declarations
struct tmds_configstruct tegra_hdmi_configstruct tegra_hdmistruct tegra_hdmi_audio_configfunction host1x_client_to_hdmifunction tegra_hdmi_readlfunction tegra_hdmi_writelfunction tegra_hdmi_audio_lockfunction tegra_hdmi_audio_unlockfunction tegra_hdmi_get_audio_configfunction tegra_hdmi_setup_audio_fs_tablesfunction tegra_hdmi_write_avalfunction tegra_hdmi_setup_audiofunction tegra_hdmi_disable_audiofunction tegra_hdmi_enable_audiofunction tegra_hdmi_write_eldfunction tegra_hdmi_subpackfunction tegra_hdmi_write_infopackfunction tegra_hdmi_setup_avi_infoframefunction tegra_hdmi_disable_avi_infoframefunction tegra_hdmi_enable_avi_infoframefunction tegra_hdmi_setup_audio_infoframefunction tegra_hdmi_disable_audio_infoframefunction tegra_hdmi_enable_audio_infoframefunction tegra_hdmi_setup_stereo_infoframefunction tegra_hdmi_disable_stereo_infoframefunction tegra_hdmi_enable_stereo_infoframefunction tegra_hdmi_setup_tmdsfunction tegra_hdmi_reconfigure_audiofunction tegra_output_is_hdmifunction tegra_hdmi_connector_detectfunction tegra_hdmi_show_regsfunction tegra_hdmi_late_registerfunction tegra_hdmi_early_unregisterfunction tegra_hdmi_connector_mode_validfunction tegra_hdmi_encoder_disablefunction tegra_hdmi_encoder_enablefunction tegra_hdmi_encoder_atomic_checkfunction tegra_hdmi_hw_paramsfunction tegra_hdmi_audio_startupfunction tegra_hdmi_audio_shutdownfunction tegra_hdmi_codec_registerfunction tegra_hdmi_codec_unregisterfunction tegra_hdmi_initfunction tegra_hdmi_exitfunction tegra_hdmi_runtime_suspendfunction tegra_hdmi_runtime_resumefunction tegra_hdmi_irq
Annotated Snippet
struct tmds_config {
unsigned int pclk;
u32 pll0;
u32 pll1;
u32 pe_current;
u32 drive_current;
u32 peak_current;
};
struct tegra_hdmi_config {
const struct tmds_config *tmds;
unsigned int num_tmds;
unsigned long fuse_override_offset;
u32 fuse_override_value;
bool has_sor_io_peak_current;
bool has_hda;
bool has_hbr;
};
struct tegra_hdmi {
struct host1x_client client;
struct tegra_output output;
struct device *dev;
struct regulator *hdmi;
struct regulator *pll;
struct regulator *vdd;
void __iomem *regs;
unsigned int irq;
struct clk *clk_parent;
struct clk *clk;
struct reset_control *rst;
const struct tegra_hdmi_config *config;
unsigned int audio_source;
struct tegra_hda_format format;
unsigned int pixel_clock;
bool stereo;
bool dvi;
struct drm_info_list *debugfs_files;
struct platform_device *audio_pdev;
struct mutex audio_lock;
};
static inline struct tegra_hdmi *
host1x_client_to_hdmi(struct host1x_client *client)
{
return container_of(client, struct tegra_hdmi, client);
}
static inline struct tegra_hdmi *to_hdmi(struct tegra_output *output)
{
return container_of(output, struct tegra_hdmi, output);
}
#define HDMI_AUDIOCLK_FREQ 216000000
#define HDMI_REKEY_DEFAULT 56
enum {
AUTO = 0,
SPDIF,
HDA,
};
static inline u32 tegra_hdmi_readl(struct tegra_hdmi *hdmi,
unsigned int offset)
{
u32 value = readl(hdmi->regs + (offset << 2));
trace_hdmi_readl(hdmi->dev, offset, value);
return value;
}
static inline void tegra_hdmi_writel(struct tegra_hdmi *hdmi, u32 value,
unsigned int offset)
{
trace_hdmi_writel(hdmi->dev, offset, value);
writel(value, hdmi->regs + (offset << 2));
}
struct tegra_hdmi_audio_config {
Annotation
- Immediate include surface: `linux/clk.h`, `linux/debugfs.h`, `linux/delay.h`, `linux/hdmi.h`, `linux/math64.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`.
- Detected declarations: `struct tmds_config`, `struct tegra_hdmi_config`, `struct tegra_hdmi`, `struct tegra_hdmi_audio_config`, `function host1x_client_to_hdmi`, `function tegra_hdmi_readl`, `function tegra_hdmi_writel`, `function tegra_hdmi_audio_lock`, `function tegra_hdmi_audio_unlock`, `function tegra_hdmi_get_audio_config`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.