drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c- Extension
.c- Size
- 40225 bytes
- Lines
- 1395
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/completion.hlinux/hdmi.hlinux/export.hlinux/i2c.hlinux/irq.hlinux/minmax.hlinux/module.hlinux/mutex.hlinux/of.hlinux/workqueue.hdrm/bridge/dw_hdmi_qp.hdrm/display/drm_hdmi_helper.hdrm/display/drm_hdmi_cec_helper.hdrm/display/drm_hdmi_state_helper.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_bridge.hdrm/drm_connector.hdrm/drm_edid.hdrm/drm_modes.hdrm/drm_print.hmedia/cec.hsound/hdmi-codec.hdw-hdmi-qp.h
Detected Declarations
struct dw_hdmi_qp_i2cstruct dw_hdmi_qp_cecstruct dw_hdmi_qpfunction dw_hdmi_qp_writefunction dw_hdmi_qp_readfunction dw_hdmi_qp_modfunction dw_hdmi_qp_set_cts_nfunction dw_hdmi_qp_match_tmds_n_tablefunction dw_hdmi_qp_audio_math_difffunction dw_hdmi_qp_compute_nfunction dw_hdmi_qp_find_nfunction dw_hdmi_qp_find_ctsfunction dw_hdmi_qp_set_audio_interfacefunction DMAfunction dw_hdmi_qp_set_sample_ratefunction dw_hdmi_qp_audio_enablefunction dw_hdmi_qp_audio_preparefunction dw_hdmi_qp_audio_disable_regsfunction dw_hdmi_qp_audio_disablefunction dw_hdmi_qp_i2c_readfunction dw_hdmi_qp_i2c_writefunction dw_hdmi_qp_i2c_xferfunction dw_hdmi_qp_i2c_funcfunction dw_hdmi_qp_bridge_atomic_enablefunction dw_hdmi_qp_bridge_atomic_disablefunction dw_hdmi_qp_bridge_detectfunction dw_hdmi_qp_bridge_edid_readfunction dw_hdmi_qp_bridge_tmds_char_rate_validfunction dw_hdmi_qp_bridge_clear_avi_infoframefunction dw_hdmi_qp_bridge_clear_hdmi_infoframefunction dw_hdmi_qp_bridge_clear_hdr_drm_infoframefunction dw_hdmi_qp_bridge_clear_spd_infoframefunction dw_hdmi_qp_bridge_clear_audio_infoframefunction dw_hdmi_qp_write_pktfunction dw_hdmi_qp_write_infoframefunction dw_hdmi_qp_bridge_write_avi_infoframefunction dw_hdmi_qp_bridge_write_hdmi_infoframefunction dw_hdmi_qp_bridge_write_hdr_drm_infoframefunction dw_hdmi_qp_bridge_write_spd_infoframefunction dw_hdmi_qp_bridge_write_audio_infoframefunction dw_hdmi_qp_cec_hardirqfunction dw_hdmi_qp_cec_threadfunction dw_hdmi_qp_cec_initfunction dw_hdmi_qp_cec_log_addrfunction dw_hdmi_qp_cec_enablefunction dw_hdmi_qp_cec_transmitfunction dw_hdmi_qp_main_hardirqfunction dw_hdmi_qp_init_hw
Annotated Snippet
struct dw_hdmi_qp_i2c {
struct i2c_adapter adap;
struct mutex lock; /* used to serialize data transfers */
struct completion cmp;
u8 stat;
u8 slave_reg;
bool is_regaddr;
bool is_segment;
};
#ifdef CONFIG_DRM_DW_HDMI_QP_CEC
struct dw_hdmi_qp_cec {
struct drm_connector *connector;
int irq;
u32 addresses;
struct cec_msg rx_msg;
u8 tx_status;
bool tx_done;
bool rx_done;
};
#endif
struct dw_hdmi_qp {
struct drm_bridge bridge;
struct device *dev;
struct dw_hdmi_qp_i2c *i2c;
#ifdef CONFIG_DRM_DW_HDMI_QP_CEC
struct dw_hdmi_qp_cec *cec;
#endif
struct {
const struct dw_hdmi_qp_phy_ops *ops;
void *data;
} phy;
unsigned long ref_clk_rate;
struct regmap *regm;
int main_irq;
unsigned long tmds_char_rate;
bool no_hpd;
};
static void dw_hdmi_qp_write(struct dw_hdmi_qp *hdmi, unsigned int val,
int offset)
{
regmap_write(hdmi->regm, offset, val);
}
static unsigned int dw_hdmi_qp_read(struct dw_hdmi_qp *hdmi, int offset)
{
unsigned int val = 0;
regmap_read(hdmi->regm, offset, &val);
return val;
}
static void dw_hdmi_qp_mod(struct dw_hdmi_qp *hdmi, unsigned int data,
unsigned int mask, unsigned int reg)
{
regmap_update_bits(hdmi->regm, reg, mask, data);
}
static struct dw_hdmi_qp *dw_hdmi_qp_from_bridge(struct drm_bridge *bridge)
{
return container_of(bridge, struct dw_hdmi_qp, bridge);
}
static void dw_hdmi_qp_set_cts_n(struct dw_hdmi_qp *hdmi, unsigned int cts,
unsigned int n)
{
/* Set N */
dw_hdmi_qp_mod(hdmi, n, AUDPKT_ACR_N_VALUE, AUDPKT_ACR_CONTROL0);
/* Set CTS */
if (cts)
dw_hdmi_qp_mod(hdmi, AUDPKT_ACR_CTS_OVR_EN, AUDPKT_ACR_CTS_OVR_EN_MSK,
AUDPKT_ACR_CONTROL1);
else
dw_hdmi_qp_mod(hdmi, 0, AUDPKT_ACR_CTS_OVR_EN_MSK,
AUDPKT_ACR_CONTROL1);
dw_hdmi_qp_mod(hdmi, AUDPKT_ACR_CTS_OVR_VAL(cts), AUDPKT_ACR_CTS_OVR_VAL_MSK,
AUDPKT_ACR_CONTROL1);
}
Annotation
- Immediate include surface: `linux/completion.h`, `linux/hdmi.h`, `linux/export.h`, `linux/i2c.h`, `linux/irq.h`, `linux/minmax.h`, `linux/module.h`, `linux/mutex.h`.
- Detected declarations: `struct dw_hdmi_qp_i2c`, `struct dw_hdmi_qp_cec`, `struct dw_hdmi_qp`, `function dw_hdmi_qp_write`, `function dw_hdmi_qp_read`, `function dw_hdmi_qp_mod`, `function dw_hdmi_qp_set_cts_n`, `function dw_hdmi_qp_match_tmds_n_table`, `function dw_hdmi_qp_audio_math_diff`, `function dw_hdmi_qp_compute_n`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration 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.