drivers/gpu/drm/mediatek/mtk_hdmi_common.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/mediatek/mtk_hdmi_common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/mediatek/mtk_hdmi_common.h- Extension
.h- Size
- 5329 bytes
- Lines
- 198
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_crtc.hdrm/drm_crtc_helper.hdrm/drm_edid.hdrm/drm_print.hlinux/clk.hlinux/device.hlinux/hdmi.hlinux/i2c.hlinux/mfd/syscon.hlinux/mutex.hlinux/phy/phy.hlinux/platform_device.hsound/hdmi-codec.h
Detected Declarations
struct hdmi_audio_paramstruct mtk_hdmi_ver_confstruct mtk_hdmi_confstruct mtk_hdmienum hdmi_aud_input_typeenum hdmi_aud_i2s_fmtenum hdmi_aud_mclkenum hdmi_aud_channel_typeenum hdmi_aud_channel_swap_typeenum hdmi_hpd_state
Annotated Snippet
struct hdmi_audio_param {
enum hdmi_audio_coding_type aud_codec;
enum hdmi_audio_sample_size aud_sample_size;
enum hdmi_aud_input_type aud_input_type;
enum hdmi_aud_i2s_fmt aud_i2s_fmt;
enum hdmi_aud_mclk aud_mclk;
enum hdmi_aud_channel_type aud_input_chan_type;
struct hdmi_codec_params codec_params;
};
enum hdmi_hpd_state {
HDMI_PLUG_OUT = 0,
HDMI_PLUG_IN_AND_SINK_POWER_ON,
HDMI_PLUG_IN_ONLY,
};
struct mtk_hdmi_ver_conf {
const struct drm_bridge_funcs *bridge_funcs;
const struct hdmi_codec_ops *codec_ops;
const char * const *mtk_hdmi_clock_names;
int num_clocks;
bool interlace_allowed;
};
struct mtk_hdmi_conf {
const struct mtk_hdmi_ver_conf *ver_conf;
bool tz_disabled;
bool cea_modes_only;
unsigned long max_mode_clock;
u32 reg_hdmi_tx_cfg;
};
struct mtk_hdmi {
struct drm_bridge bridge;
struct drm_connector *curr_conn;/* current connector (only valid when 'enabled') */
struct device *dev;
const struct mtk_hdmi_conf *conf;
struct phy *phy;
struct device *cec_dev;
struct i2c_adapter *ddc_adpt;
struct clk **clk;
struct drm_display_mode mode;
bool dvi_mode;
struct regmap *sys_regmap;
unsigned int sys_offset;
struct regmap *regs;
struct platform_device *audio_pdev;
struct hdmi_audio_param aud_param;
bool audio_enable;
bool powered;
bool enabled;
int irq;
enum hdmi_hpd_state hpd;
hdmi_codec_plugged_cb plugged_cb;
struct device *codec_dev;
struct mutex update_plugged_status_lock;
};
static inline struct mtk_hdmi *hdmi_ctx_from_bridge(struct drm_bridge *b)
{
return container_of(b, struct mtk_hdmi, bridge);
}
int mtk_hdmi_audio_get_eld(struct device *dev, void *data, uint8_t *buf, size_t len);
void mtk_hdmi_audio_set_plugged_cb(struct mtk_hdmi *hdmi, hdmi_codec_plugged_cb fn,
struct device *codec_dev);
int mtk_hdmi_audio_params(struct mtk_hdmi *hdmi, struct hdmi_codec_daifmt *daifmt,
struct hdmi_codec_params *params);
void mtk_hdmi_get_ncts(unsigned int sample_rate, unsigned int clock,
unsigned int *n, unsigned int *cts);
bool mtk_hdmi_bridge_mode_fixup(struct drm_bridge *bridge,
const struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode);
void mtk_hdmi_bridge_mode_set(struct drm_bridge *bridge,
const struct drm_display_mode *mode,
const struct drm_display_mode *adjusted_mode);
struct mtk_hdmi *mtk_hdmi_common_probe(struct platform_device *pdev);
#endif /* _MTK_HDMI_COMMON_H */
Annotation
- Immediate include surface: `drm/drm_atomic_helper.h`, `drm/drm_bridge.h`, `drm/drm_crtc.h`, `drm/drm_crtc_helper.h`, `drm/drm_edid.h`, `drm/drm_print.h`, `linux/clk.h`, `linux/device.h`.
- Detected declarations: `struct hdmi_audio_param`, `struct mtk_hdmi_ver_conf`, `struct mtk_hdmi_conf`, `struct mtk_hdmi`, `enum hdmi_aud_input_type`, `enum hdmi_aud_i2s_fmt`, `enum hdmi_aud_mclk`, `enum hdmi_aud_channel_type`, `enum hdmi_aud_channel_swap_type`, `enum hdmi_hpd_state`.
- 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.
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.