drivers/gpu/drm/i915/display/intel_dkl_phy.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_dkl_phy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_dkl_phy.c- Extension
.c- Size
- 2843 bytes
- Lines
- 118
- 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_device.hdrm/drm_print.hintel_de.hintel_display.hintel_dkl_phy.hintel_dkl_phy_regs.h
Detected Declarations
function intel_dkl_phy_initfunction dkl_phy_set_hip_idxfunction intel_dkl_phy_readfunction intel_dkl_phy_writefunction intel_dkl_phy_rmwfunction intel_dkl_phy_posting_read
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2022 Intel Corporation
*/
#include <drm/drm_device.h>
#include <drm/drm_print.h>
#include "intel_de.h"
#include "intel_display.h"
#include "intel_dkl_phy.h"
#include "intel_dkl_phy_regs.h"
/**
* intel_dkl_phy_init - initialize Dekel PHY
* @display: display device instance
*/
void intel_dkl_phy_init(struct intel_display *display)
{
spin_lock_init(&display->dkl.phy_lock);
}
static void
dkl_phy_set_hip_idx(struct intel_display *display, struct intel_dkl_phy_reg reg)
{
enum tc_port tc_port = DKL_REG_TC_PORT(reg);
if (drm_WARN_ON(display->drm,
tc_port < TC_PORT_1 || tc_port >= I915_MAX_TC_PORTS))
return;
intel_de_write(display,
HIP_INDEX_REG(tc_port),
HIP_INDEX_VAL(tc_port, reg.bank_idx));
}
/**
* intel_dkl_phy_read - read a Dekel PHY register
* @display: intel_display device instance
* @reg: Dekel PHY register
*
* Read the @reg Dekel PHY register.
*
* Returns the read value.
*/
u32
intel_dkl_phy_read(struct intel_display *display, struct intel_dkl_phy_reg reg)
{
u32 val;
spin_lock(&display->dkl.phy_lock);
dkl_phy_set_hip_idx(display, reg);
val = intel_de_read(display, DKL_REG_MMIO(reg));
spin_unlock(&display->dkl.phy_lock);
return val;
}
/**
* intel_dkl_phy_write - write a Dekel PHY register
* @display: intel_display device instance
* @reg: Dekel PHY register
* @val: value to write
*
* Write @val to the @reg Dekel PHY register.
*/
void
intel_dkl_phy_write(struct intel_display *display, struct intel_dkl_phy_reg reg, u32 val)
{
spin_lock(&display->dkl.phy_lock);
dkl_phy_set_hip_idx(display, reg);
intel_de_write(display, DKL_REG_MMIO(reg), val);
spin_unlock(&display->dkl.phy_lock);
}
/**
* intel_dkl_phy_rmw - read-modify-write a Dekel PHY register
* @display: display device instance
* @reg: Dekel PHY register
* @clear: mask to clear
* @set: mask to set
*
* Read the @reg Dekel PHY register, clearing then setting the @clear/@set bits in it, and writing
* this value back to the register if the value differs from the read one.
*/
void
Annotation
- Immediate include surface: `drm/drm_device.h`, `drm/drm_print.h`, `intel_de.h`, `intel_display.h`, `intel_dkl_phy.h`, `intel_dkl_phy_regs.h`.
- Detected declarations: `function intel_dkl_phy_init`, `function dkl_phy_set_hip_idx`, `function intel_dkl_phy_read`, `function intel_dkl_phy_write`, `function intel_dkl_phy_rmw`, `function intel_dkl_phy_posting_read`.
- 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.