drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c- Extension
.c- Size
- 31377 bytes
- Lines
- 1117
- 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/delay.hdsi_phy.hdsi.xml.hdsi_phy_14nm.xml.h
Detected Declarations
struct dsi_pll_configstruct pll_14nm_cached_statestruct dsi_pll_14nmstruct dsi_pll_14nm_postdivfunction pll_14nm_poll_for_readyfunction dsi_pll_14nm_config_initfunction pll_14nm_ssc_calcfunction pll_14nm_dec_frac_calcfunction pll_14nm_kvco_slopfunction pll_14nm_calc_vco_countfunction pll_db_commit_sscfunction pll_db_commit_commonfunction pll_14nm_software_resetfunction pll_db_commit_14nmfunction dsi_pll_14nm_vco_set_ratefunction dsi_pll_14nm_vco_recalc_ratefunction dsi_pll_14nm_vco_preparefunction dsi_pll_14nm_vco_unpreparefunction dsi_pll_14nm_clk_determine_ratefunction dsi_pll_14nm_postdiv_recalc_ratefunction dsi_pll_14nm_postdiv_determine_ratefunction dsi_pll_14nm_postdiv_set_ratefunction dsi_14nm_pll_save_statefunction dsi_14nm_pll_restore_statefunction dsi_14nm_set_usecasefunction pll_14nm_registerfunction dsi_pll_14nm_initfunction dsi_14nm_dphy_set_timingfunction dsi_14nm_phy_enablefunction dsi_14nm_phy_disable
Annotated Snippet
struct dsi_pll_config {
u64 vco_current_rate;
u32 ssc_en; /* SSC enable/disable */
/* fixed params */
u32 plllock_cnt;
u32 ssc_center;
u32 ssc_adj_period;
u32 ssc_spread;
u32 ssc_freq;
/* calculated */
u32 dec_start;
u32 div_frac_start;
u32 ssc_period;
u32 ssc_step_size;
u32 plllock_cmp;
u32 pll_vco_div_ref;
u32 pll_vco_count;
u32 pll_kvco_div_ref;
u32 pll_kvco_count;
};
struct pll_14nm_cached_state {
unsigned long vco_rate;
u8 n2postdiv;
u8 n1postdiv;
};
struct dsi_pll_14nm {
struct clk_hw clk_hw;
struct msm_dsi_phy *phy;
/* protects REG_DSI_14nm_PHY_CMN_CLK_CFG0 register */
spinlock_t postdiv_lock;
struct pll_14nm_cached_state cached_state;
struct dsi_pll_14nm *slave;
};
#define to_pll_14nm(x) container_of(x, struct dsi_pll_14nm, clk_hw)
/*
* Private struct for N1/N2 post-divider clocks. These clocks are similar to
* the generic clk_divider class of clocks. The only difference is that it
* also sets the slave DSI PLL's post-dividers if in bonded DSI mode
*/
struct dsi_pll_14nm_postdiv {
struct clk_hw hw;
/* divider params */
u8 shift;
u8 width;
u8 flags; /* same flags as used by clk_divider struct */
struct dsi_pll_14nm *pll;
};
#define to_pll_14nm_postdiv(_hw) container_of(_hw, struct dsi_pll_14nm_postdiv, 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_14nm *pll_14nm_list[DSI_MAX];
static bool pll_14nm_poll_for_ready(struct dsi_pll_14nm *pll_14nm,
u32 nb_tries, u32 timeout_us)
{
bool pll_locked = false, pll_ready = false;
void __iomem *base = pll_14nm->phy->pll_base;
u32 tries, val;
tries = nb_tries;
while (tries--) {
val = readl(base + REG_DSI_14nm_PHY_PLL_RESET_SM_READY_STATUS);
pll_locked = !!(val & BIT(5));
if (pll_locked)
break;
udelay(timeout_us);
}
if (!pll_locked)
goto out;
Annotation
- Immediate include surface: `dt-bindings/clock/qcom,dsi-phy-28nm.h`, `linux/clk.h`, `linux/clk-provider.h`, `linux/delay.h`, `dsi_phy.h`, `dsi.xml.h`, `dsi_phy_14nm.xml.h`.
- Detected declarations: `struct dsi_pll_config`, `struct pll_14nm_cached_state`, `struct dsi_pll_14nm`, `struct dsi_pll_14nm_postdiv`, `function pll_14nm_poll_for_ready`, `function dsi_pll_14nm_config_init`, `function pll_14nm_ssc_calc`, `function pll_14nm_dec_frac_calc`, `function pll_14nm_kvco_slop`, `function pll_14nm_calc_vco_count`.
- 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.