drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c- Extension
.c- Size
- 47188 bytes
- Lines
- 1553
- 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
dt-bindings/clock/qcom,dsi-phy-28nm.hlinux/bitfield.hlinux/clk.hlinux/clk-provider.hlinux/iopoll.hdsi_phy.hdsi.xml.hdsi_phy_7nm.xml.h
Detected Declarations
struct dsi_pll_configstruct pll_7nm_cached_statestruct dsi_pll_7nmfunction dsi_pll_setup_configfunction dsi_pll_calc_dec_fracfunction dsi_pll_calc_sscfunction dsi_pll_ssc_commitfunction dsi_pll_config_hzindep_regfunction dsi_pll_commitfunction dsi_pll_7nm_vco_set_ratefunction dsi_pll_7nm_lock_statusfunction dsi_pll_disable_pll_biasfunction dsi_pll_enable_pll_biasfunction dsi_pll_cmn_clk_cfg0_writefunction dsi_pll_cmn_clk_cfg1_updatefunction dsi_pll_disable_global_clkfunction dsi_pll_enable_global_clkfunction dsi_pll_phy_dig_resetfunction dsi_pll_7nm_vco_preparefunction dsi_pll_disable_subfunction dsi_pll_7nm_vco_unpreparefunction dsi_pll_7nm_vco_recalc_ratefunction dsi_pll_7nm_clk_determine_ratefunction dsi_7nm_pll_save_statefunction dsi_7nm_pll_restore_statefunction dsi_7nm_set_usecasefunction pll_7nm_registerfunction dsi_pll_7nm_initfunction dsi_phy_hw_v4_0_is_pll_onfunction dsi_phy_hw_v4_0_config_lpcdrxfunction dsi_phy_hw_v4_0_lane_settingsfunction dsi_7nm_phy_enablefunction dsi_7nm_set_continuous_clockfunction dsi_7nm_phy_disable
Annotated Snippet
struct dsi_pll_config {
bool enable_ssc;
bool ssc_center;
u32 ssc_freq;
u32 ssc_offset;
u32 ssc_adj_per;
/* out */
u32 decimal_div_start;
u32 frac_div_start;
u32 pll_clock_inverters;
u32 ssc_stepsize;
u32 ssc_div_per;
};
struct pll_7nm_cached_state {
unsigned long vco_rate;
u8 bit_clk_div;
u8 pix_clk_div;
u8 pll_out_div;
u8 pll_mux;
};
struct dsi_pll_7nm {
struct clk_hw clk_hw;
struct msm_dsi_phy *phy;
u64 vco_current_rate;
/* protects REG_DSI_7nm_PHY_CMN_CLK_CFG0 register */
spinlock_t postdiv_lock;
/* protects REG_DSI_7nm_PHY_CMN_CLK_CFG1 register */
spinlock_t pclk_mux_lock;
/*
* protects REG_DSI_7nm_PHY_CMN_CTRL_0 register and pll_enable_cnt
* member
*/
spinlock_t pll_enable_lock;
int pll_enable_cnt;
struct pll_7nm_cached_state cached_state;
struct dsi_pll_7nm *slave;
};
#define to_pll_7nm(x) container_of(x, struct dsi_pll_7nm, clk_hw)
/*
* Global list of private DSI PLL struct pointers. We need this for bonded DSI
* mode, where the master PLL's clk_ops needs access the slave's private data
*/
static struct dsi_pll_7nm *pll_7nm_list[DSI_MAX];
static void dsi_pll_enable_pll_bias(struct dsi_pll_7nm *pll);
static void dsi_pll_disable_pll_bias(struct dsi_pll_7nm *pll);
static void dsi_pll_setup_config(struct dsi_pll_config *config)
{
config->ssc_freq = 31500;
config->ssc_offset = 4800;
config->ssc_adj_per = 2;
/* TODO: ssc enable */
config->enable_ssc = false;
config->ssc_center = 0;
}
static void dsi_pll_calc_dec_frac(struct dsi_pll_7nm *pll, struct dsi_pll_config *config)
{
u64 fref = VCO_REF_CLK_RATE;
u64 pll_freq;
u64 divider;
u64 dec, dec_multiple;
u32 frac;
u64 multiplier;
pll_freq = pll->vco_current_rate;
divider = fref * 2;
multiplier = 1 << FRAC_BITS;
dec_multiple = div_u64(pll_freq * multiplier, divider);
dec = div_u64_rem(dec_multiple, multiplier, &frac);
if (pll->phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V4_0) {
config->pll_clock_inverters = 0x28;
} else if ((pll->phy->cfg->quirks & DSI_PHY_7NM_QUIRK_V7_2)) {
Annotation
- Immediate include surface: `dt-bindings/clock/qcom,dsi-phy-28nm.h`, `linux/bitfield.h`, `linux/clk.h`, `linux/clk-provider.h`, `linux/iopoll.h`, `dsi_phy.h`, `dsi.xml.h`, `dsi_phy_7nm.xml.h`.
- Detected declarations: `struct dsi_pll_config`, `struct pll_7nm_cached_state`, `struct dsi_pll_7nm`, `function dsi_pll_setup_config`, `function dsi_pll_calc_dec_frac`, `function dsi_pll_calc_ssc`, `function dsi_pll_ssc_commit`, `function dsi_pll_config_hzindep_reg`, `function dsi_pll_commit`, `function dsi_pll_7nm_vco_set_rate`.
- 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.