drivers/gpu/drm/msm/dp/dp_aux.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/dp/dp_aux.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/dp/dp_aux.c- Extension
.c- Size
- 18383 bytes
- Lines
- 730
- 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/delay.hlinux/iopoll.hlinux/phy/phy.hdrm/drm_print.hdp_reg.hdp_aux.h
Detected Declarations
struct msm_dp_aux_privateenum msm_dp_aux_errfunction msm_dp_read_auxfunction msm_dp_write_auxfunction msm_dp_aux_clear_hw_interruptsfunction msm_dp_aux_resetfunction msm_dp_aux_enablefunction msm_dp_aux_disablefunction msm_dp_aux_wait_for_hpd_connect_statefunction msm_dp_aux_writefunction msm_dp_aux_cmd_fifo_txfunction msm_dp_aux_cmd_fifo_rxfunction msm_dp_aux_update_offset_and_segmentfunction msm_dp_aux_transfer_helperfunction aux_resetfunction msm_dp_aux_isrfunction msm_dp_aux_enable_xfersfunction msm_dp_aux_reconfigfunction msm_dp_aux_initfunction msm_dp_aux_deinitfunction msm_dp_aux_registerfunction msm_dp_aux_unregisterfunction msm_dp_wait_hpd_assertedfunction msm_dp_aux_hpd_enablefunction msm_dp_aux_hpd_disablefunction msm_dp_aux_hpd_intr_enablefunction msm_dp_aux_hpd_intr_disablefunction msm_dp_aux_get_hpd_intr_statusfunction msm_dp_aux_is_link_connectedfunction msm_dp_aux_put
Annotated Snippet
struct msm_dp_aux_private {
struct device *dev;
void __iomem *aux_base;
struct phy *phy;
struct mutex mutex;
struct completion comp;
enum msm_dp_aux_err aux_error_num;
u32 retry_cnt;
bool cmd_busy;
bool native;
bool read;
bool no_send_addr;
bool no_send_stop;
bool initted;
bool is_edp;
bool enable_xfers;
u32 offset;
u32 segment;
struct drm_dp_aux msm_dp_aux;
};
static inline u32 msm_dp_read_aux(struct msm_dp_aux_private *aux, u32 offset)
{
return readl_relaxed(aux->aux_base + offset);
}
static inline void msm_dp_write_aux(struct msm_dp_aux_private *aux,
u32 offset, u32 data)
{
/*
* To make sure aux reg writes happens before any other operation,
* this function uses writel() instread of writel_relaxed()
*/
writel(data, aux->aux_base + offset);
}
static void msm_dp_aux_clear_hw_interrupts(struct msm_dp_aux_private *aux)
{
msm_dp_read_aux(aux, REG_DP_PHY_AUX_INTERRUPT_STATUS);
msm_dp_write_aux(aux, REG_DP_PHY_AUX_INTERRUPT_CLEAR, 0x1f);
msm_dp_write_aux(aux, REG_DP_PHY_AUX_INTERRUPT_CLEAR, 0x9f);
msm_dp_write_aux(aux, REG_DP_PHY_AUX_INTERRUPT_CLEAR, 0);
}
/*
* NOTE: resetting AUX controller will also clear any pending HPD related interrupts
*/
static void msm_dp_aux_reset(struct msm_dp_aux_private *aux)
{
u32 aux_ctrl;
aux_ctrl = msm_dp_read_aux(aux, REG_DP_AUX_CTRL);
aux_ctrl |= DP_AUX_CTRL_RESET;
msm_dp_write_aux(aux, REG_DP_AUX_CTRL, aux_ctrl);
usleep_range(1000, 1100); /* h/w recommended delay */
aux_ctrl &= ~DP_AUX_CTRL_RESET;
msm_dp_write_aux(aux, REG_DP_AUX_CTRL, aux_ctrl);
}
static void msm_dp_aux_enable(struct msm_dp_aux_private *aux)
{
u32 aux_ctrl;
aux_ctrl = msm_dp_read_aux(aux, REG_DP_AUX_CTRL);
msm_dp_write_aux(aux, REG_DP_TIMEOUT_COUNT, 0xffff);
msm_dp_write_aux(aux, REG_DP_AUX_LIMITS, 0xffff);
aux_ctrl |= DP_AUX_CTRL_ENABLE;
msm_dp_write_aux(aux, REG_DP_AUX_CTRL, aux_ctrl);
}
static void msm_dp_aux_disable(struct msm_dp_aux_private *aux)
{
u32 aux_ctrl;
aux_ctrl = msm_dp_read_aux(aux, REG_DP_AUX_CTRL);
aux_ctrl &= ~DP_AUX_CTRL_ENABLE;
msm_dp_write_aux(aux, REG_DP_AUX_CTRL, aux_ctrl);
}
static int msm_dp_aux_wait_for_hpd_connect_state(struct msm_dp_aux_private *aux,
unsigned long wait_us)
{
Annotation
- Immediate include surface: `linux/delay.h`, `linux/iopoll.h`, `linux/phy/phy.h`, `drm/drm_print.h`, `dp_reg.h`, `dp_aux.h`.
- Detected declarations: `struct msm_dp_aux_private`, `enum msm_dp_aux_err`, `function msm_dp_read_aux`, `function msm_dp_write_aux`, `function msm_dp_aux_clear_hw_interrupts`, `function msm_dp_aux_reset`, `function msm_dp_aux_enable`, `function msm_dp_aux_disable`, `function msm_dp_aux_wait_for_hpd_connect_state`, `function msm_dp_aux_write`.
- 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.