drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c- Extension
.c- Size
- 30391 bytes
- Lines
- 1037
- 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/clk.hlinux/clk-provider.hlinux/iopoll.hdsi_phy.hdsi.xml.hdsi_phy_10nm.xml.h
Detected Declarations
struct dsi_pll_configstruct pll_10nm_cached_statestruct dsi_pll_10nmstruct dsi_phy_10nm_tuning_cfgfunction 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_10nm_vco_set_ratefunction dsi_pll_10nm_lock_statusfunction dsi_pll_disable_pll_biasfunction dsi_pll_enable_pll_biasfunction dsi_pll_disable_global_clkfunction dsi_pll_enable_global_clkfunction dsi_pll_10nm_vco_preparefunction dsi_pll_disable_subfunction dsi_pll_10nm_vco_unpreparefunction dsi_pll_10nm_vco_recalc_ratefunction dsi_pll_10nm_clk_determine_ratefunction dsi_10nm_pll_save_statefunction dsi_10nm_pll_restore_statefunction dsi_10nm_set_usecasefunction pll_10nm_registerfunction dsi_pll_10nm_initfunction dsi_phy_hw_v3_0_is_pll_onfunction dsi_phy_hw_v3_0_config_lpcdrxfunction dsi_phy_hw_v3_0_lane_settingsfunction dsi_10nm_phy_enablefunction dsi_10nm_phy_disablefunction dsi_10nm_phy_parse_dt
Annotated Snippet
struct dsi_pll_config {
bool enable_ssc;
bool ssc_center;
u32 ssc_freq;
u32 ssc_offset;
u32 ssc_adj_per;
/* out */
u32 pll_prop_gain_rate;
u32 decimal_div_start;
u32 frac_div_start;
u32 pll_clock_inverters;
u32 ssc_stepsize;
u32 ssc_div_per;
};
struct pll_10nm_cached_state {
unsigned long vco_rate;
u8 bit_clk_div;
u8 pix_clk_div;
u8 pll_out_div;
u8 pll_mux;
};
struct dsi_pll_10nm {
struct clk_hw clk_hw;
struct msm_dsi_phy *phy;
u64 vco_current_rate;
/* protects REG_DSI_10nm_PHY_CMN_CLK_CFG0 register */
spinlock_t postdiv_lock;
struct pll_10nm_cached_state cached_state;
struct dsi_pll_10nm *slave;
};
#define to_pll_10nm(x) container_of(x, struct dsi_pll_10nm, clk_hw)
/**
* struct dsi_phy_10nm_tuning_cfg - Holds 10nm PHY tuning config parameters.
* @rescode_offset_top: Offset for pull-up legs rescode.
* @rescode_offset_bot: Offset for pull-down legs rescode.
* @vreg_ctrl: vreg ctrl to drive LDO level
*/
struct dsi_phy_10nm_tuning_cfg {
u8 rescode_offset_top[DSI_LANE_MAX];
u8 rescode_offset_bot[DSI_LANE_MAX];
u8 vreg_ctrl;
};
/*
* 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_10nm *pll_10nm_list[DSI_MAX];
static void dsi_pll_setup_config(struct dsi_pll_config *config)
{
config->ssc_freq = 31500;
config->ssc_offset = 5000;
config->ssc_adj_per = 2;
config->enable_ssc = false;
config->ssc_center = false;
}
static void dsi_pll_calc_dec_frac(struct dsi_pll_10nm *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_freq <= 1900000000UL)
config->pll_prop_gain_rate = 8;
else if (pll_freq <= 3000000000UL)
config->pll_prop_gain_rate = 10;
Annotation
- Immediate include surface: `dt-bindings/clock/qcom,dsi-phy-28nm.h`, `linux/clk.h`, `linux/clk-provider.h`, `linux/iopoll.h`, `dsi_phy.h`, `dsi.xml.h`, `dsi_phy_10nm.xml.h`.
- Detected declarations: `struct dsi_pll_config`, `struct pll_10nm_cached_state`, `struct dsi_pll_10nm`, `struct dsi_phy_10nm_tuning_cfg`, `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`.
- 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.