drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c- Extension
.c- Size
- 29572 bytes
- Lines
- 1108
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/device.hlinux/gpio/consumer.hlinux/io.hlinux/iopoll.hlinux/phy/phy.hdrm/bridge/analogix_dp.hanalogix_dp_core.hanalogix_dp_reg.h
Detected Declarations
function DPfunction analogix_dp_stop_videofunction analogix_dp_lane_swapfunction analogix_dp_init_analog_paramfunction analogix_dp_init_interruptfunction analogix_dp_resetfunction analogix_dp_swresetfunction analogix_dp_config_interruptfunction analogix_dp_mute_hpd_interruptfunction analogix_dp_unmute_hpd_interruptfunction analogix_dp_wait_pll_lockedfunction analogix_dp_set_pll_power_downfunction analogix_dp_set_analog_power_downfunction analogix_dp_init_analog_funcfunction analogix_dp_clear_hotplug_interruptsfunction analogix_dp_init_hpdfunction analogix_dp_force_hpdfunction analogix_dp_get_irq_typefunction analogix_dp_reset_auxfunction analogix_dp_init_auxfunction analogix_dp_get_plug_in_statusfunction analogix_dp_enable_sw_functionfunction analogix_dp_set_link_bandwidthfunction analogix_dp_get_link_bandwidthfunction analogix_dp_set_lane_countfunction analogix_dp_get_lane_countfunction analogix_dp_set_lane_link_trainingfunction analogix_dp_get_lane_link_trainingfunction analogix_dp_enable_enhanced_modefunction analogix_dp_set_training_patternfunction analogix_dp_reset_macrofunction analogix_dp_init_videofunction analogix_dp_set_video_color_formatfunction analogix_dp_is_slave_video_stream_clock_onfunction analogix_dp_set_video_cr_mnfunction analogix_dp_set_video_timing_modefunction analogix_dp_enable_video_masterfunction analogix_dp_start_videofunction analogix_dp_is_video_stream_onfunction analogix_dp_config_video_slave_modefunction analogix_dp_enable_scramblingfunction analogix_dp_disable_scramblingfunction analogix_dp_enable_psr_crcfunction analogix_dp_get_psr_statusfunction analogix_dp_send_psr_spdfunction analogix_dp_transfer
Annotated Snippet
if (enable) {
reg = DP_ALL_PD;
writel(reg, dp->reg_base + phy_pd_addr);
} else {
reg = DP_ALL_PD;
writel(reg, dp->reg_base + phy_pd_addr);
usleep_range(10, 15);
reg &= ~DP_INC_BG;
writel(reg, dp->reg_base + phy_pd_addr);
usleep_range(10, 15);
writel(0x00, dp->reg_base + phy_pd_addr);
}
break;
default:
break;
}
}
int analogix_dp_init_analog_func(struct analogix_dp_device *dp)
{
u32 reg;
analogix_dp_set_analog_power_down(dp, POWER_ALL, 0);
reg = PLL_LOCK_CHG;
writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_STA_1);
reg = readl(dp->reg_base + ANALOGIX_DP_DEBUG_CTL);
reg &= ~(F_PLL_LOCK | PLL_LOCK_CTRL);
writel(reg, dp->reg_base + ANALOGIX_DP_DEBUG_CTL);
/* Power up PLL */
analogix_dp_set_pll_power_down(dp, 0);
/* Enable Serdes FIFO function and Link symbol clock domain module */
reg = readl(dp->reg_base + ANALOGIX_DP_FUNC_EN_2);
reg &= ~(SERDES_FIFO_FUNC_EN_N | LS_CLK_DOMAIN_FUNC_EN_N
| AUX_FUNC_EN_N);
writel(reg, dp->reg_base + ANALOGIX_DP_FUNC_EN_2);
return 0;
}
void analogix_dp_clear_hotplug_interrupts(struct analogix_dp_device *dp)
{
u32 reg;
if (dp->hpd_gpiod)
return;
reg = HOTPLUG_CHG | HPD_LOST | PLUG;
writel(reg, dp->reg_base + ANALOGIX_DP_COMMON_INT_STA_4);
reg = INT_HPD;
writel(reg, dp->reg_base + ANALOGIX_DP_INT_STA);
}
void analogix_dp_init_hpd(struct analogix_dp_device *dp)
{
u32 reg;
if (dp->hpd_gpiod)
return;
analogix_dp_clear_hotplug_interrupts(dp);
reg = readl(dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
reg &= ~(F_HPD | HPD_CTRL);
writel(reg, dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
}
void analogix_dp_force_hpd(struct analogix_dp_device *dp)
{
u32 reg;
reg = readl(dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
reg = (F_HPD | HPD_CTRL);
writel(reg, dp->reg_base + ANALOGIX_DP_SYS_CTL_3);
}
enum dp_irq_type analogix_dp_get_irq_type(struct analogix_dp_device *dp)
{
u32 reg;
if (dp->hpd_gpiod) {
reg = gpiod_get_value(dp->hpd_gpiod);
if (reg)
return DP_IRQ_TYPE_HP_CABLE_IN;
else
return DP_IRQ_TYPE_HP_CABLE_OUT;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/gpio/consumer.h`, `linux/io.h`, `linux/iopoll.h`, `linux/phy/phy.h`, `drm/bridge/analogix_dp.h`, `analogix_dp_core.h`.
- Detected declarations: `function DP`, `function analogix_dp_stop_video`, `function analogix_dp_lane_swap`, `function analogix_dp_init_analog_param`, `function analogix_dp_init_interrupt`, `function analogix_dp_reset`, `function analogix_dp_swreset`, `function analogix_dp_config_interrupt`, `function analogix_dp_mute_hpd_interrupt`, `function analogix_dp_unmute_hpd_interrupt`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.