drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/imx/ipuv3/dw_hdmi-imx.c- Extension
.c- Size
- 6879 bytes
- Lines
- 284
- 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.
- 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/component.hlinux/mfd/syscon.hlinux/mfd/syscon/imx6q-iomuxc-gpr.hlinux/module.hlinux/platform_device.hlinux/regmap.hvideo/imx-ipu-v3.hdrm/bridge/dw_hdmi.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_edid.hdrm/drm_encoder.hdrm/drm_managed.hdrm/drm_of.hdrm/drm_simple_kms_helper.himx-drm.h
Detected Declarations
struct imx_hdmistruct imx_hdmi_encoderstruct imx_hdmifunction dw_hdmi_imx_encoder_enablefunction dw_hdmi_imx_atomic_checkfunction imx6q_hdmi_mode_validfunction imx6dl_hdmi_mode_validfunction dw_hdmi_imx_bindfunction dw_hdmi_imx_probefunction dw_hdmi_imx_remove
Annotated Snippet
struct imx_hdmi_encoder {
struct drm_encoder encoder;
struct imx_hdmi *hdmi;
};
struct imx_hdmi {
struct device *dev;
struct drm_bridge *bridge;
struct dw_hdmi *hdmi;
struct regmap *regmap;
};
static inline struct imx_hdmi *enc_to_imx_hdmi(struct drm_encoder *e)
{
return container_of(e, struct imx_hdmi_encoder, encoder)->hdmi;
}
static const struct dw_hdmi_mpll_config imx_mpll_cfg[] = {
{
45250000, {
{ 0x01e0, 0x0000 },
{ 0x21e1, 0x0000 },
{ 0x41e2, 0x0000 }
},
}, {
92500000, {
{ 0x0140, 0x0005 },
{ 0x2141, 0x0005 },
{ 0x4142, 0x0005 },
},
}, {
148500000, {
{ 0x00a0, 0x000a },
{ 0x20a1, 0x000a },
{ 0x40a2, 0x000a },
},
}, {
216000000, {
{ 0x00a0, 0x000a },
{ 0x2001, 0x000f },
{ 0x4002, 0x000f },
},
}, {
~0UL, {
{ 0x0000, 0x0000 },
{ 0x0000, 0x0000 },
{ 0x0000, 0x0000 },
},
}
};
static const struct dw_hdmi_curr_ctrl imx_cur_ctr[] = {
/* pixelclk bpp8 bpp10 bpp12 */
{
54000000, { 0x091c, 0x091c, 0x06dc },
}, {
58400000, { 0x091c, 0x06dc, 0x06dc },
}, {
72000000, { 0x06dc, 0x06dc, 0x091c },
}, {
74250000, { 0x06dc, 0x0b5c, 0x091c },
}, {
118800000, { 0x091c, 0x091c, 0x06dc },
}, {
216000000, { 0x06dc, 0x0b5c, 0x091c },
}, {
~0UL, { 0x0000, 0x0000, 0x0000 },
},
};
/*
* Resistance term 133Ohm Cfg
* PREEMP config 0.00
* TX/CK level 10
*/
static const struct dw_hdmi_phy_config imx_phy_config[] = {
/*pixelclk symbol term vlev */
{ 216000000, 0x800d, 0x0005, 0x01ad},
{ ~0UL, 0x0000, 0x0000, 0x0000}
};
static void dw_hdmi_imx_encoder_enable(struct drm_encoder *encoder)
{
struct imx_hdmi *hdmi = enc_to_imx_hdmi(encoder);
int mux = drm_of_encoder_active_port_id(hdmi->dev->of_node, encoder);
regmap_update_bits(hdmi->regmap, IOMUXC_GPR3,
IMX6Q_GPR3_HDMI_MUX_CTL_MASK,
mux << IMX6Q_GPR3_HDMI_MUX_CTL_SHIFT);
}
Annotation
- Immediate include surface: `linux/component.h`, `linux/mfd/syscon.h`, `linux/mfd/syscon/imx6q-iomuxc-gpr.h`, `linux/module.h`, `linux/platform_device.h`, `linux/regmap.h`, `video/imx-ipu-v3.h`, `drm/bridge/dw_hdmi.h`.
- Detected declarations: `struct imx_hdmi`, `struct imx_hdmi_encoder`, `struct imx_hdmi`, `function dw_hdmi_imx_encoder_enable`, `function dw_hdmi_imx_atomic_check`, `function imx6q_hdmi_mode_valid`, `function imx6dl_hdmi_mode_valid`, `function dw_hdmi_imx_bind`, `function dw_hdmi_imx_probe`, `function dw_hdmi_imx_remove`.
- 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.