drivers/gpu/drm/stm/lvds.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/stm/lvds.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/stm/lvds.c- Extension
.c- Size
- 35943 bytes
- Lines
- 1223
- 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_atomic_helper.hdrm/drm_bridge.hdrm/drm_device.hdrm/drm_of.hdrm/drm_panel.hdrm/drm_print.hdrm/drm_probe_helper.hlinux/clk.hlinux/clk-provider.hlinux/io.hlinux/iopoll.hlinux/media-bus-format.hlinux/module.hlinux/of_device.hlinux/platform_device.hlinux/reset.h
Detected Declarations
struct phy_reg_offsetsstruct lvds_phy_infostruct stm_lvdsenum lvds_link_typeenum lvds_pixelfunction lvds_writefunction lvds_readfunction lvds_setfunction lvds_clearfunction lvds_pll_enablefunction pll_get_clkout_khzfunction lvds_pll_get_paramsfunction lvds_pll_configfunction lvds_pixel_clk_enablefunction lvds_pixel_clk_disablefunction lvds_pixel_clk_recalc_ratefunction lvds_pixel_clk_determine_ratefunction lvds_pixel_clk_unregisterfunction lvds_pixel_clk_registerfunction lvds_config_data_mappingfunction lvds_config_modefunction lvds_connector_get_modesfunction lvds_connector_atomic_checkfunction lvds_attachfunction lvds_atomic_enablefunction lvds_atomic_disablefunction lvds_probefunction lvds_remove
Annotated Snippet
struct phy_reg_offsets {
u32 GCR; /* Global Control Register */
u32 CMCR1; /* Current Mode Control Register 1 */
u32 CMCR2; /* Current Mode Control Register 2 */
u32 SCR; /* Serial Control Register */
u32 BCR1; /* Bias Control Register 1 */
u32 BCR2; /* Bias Control Register 2 */
u32 BCR3; /* Bias Control Register 3 */
u32 MPLCR; /* Monitor PLL Lock Control Register */
u32 DCR; /* Debug Control Register */
u32 SSR1; /* Spare Status Register 1 */
u32 CFGCR; /* Configuration Control Register */
u32 PLLCR1; /* PLL_MODE 1 Control Register */
u32 PLLCR2; /* PLL_MODE 2 Control Register */
u32 PLLSR; /* PLL Status Register */
u32 PLLSDCR1; /* PLL_SD_1 Control Register */
u32 PLLSDCR2; /* PLL_SD_2 Control Register */
u32 PLLTWGCR1;/* PLL_TWG_1 Control Register */
u32 PLLTWGCR2;/* PLL_TWG_2 Control Register */
u32 PLLCPCR; /* PLL_CP Control Register */
u32 PLLTESTCR;/* PLL_TEST Control Register */
};
struct lvds_phy_info {
u32 base;
struct phy_reg_offsets ofs;
};
static struct lvds_phy_info lvds_phy_16ff_primary = {
.base = 0x1000,
.ofs = {
.GCR = 0x0,
.CMCR1 = 0xC,
.CMCR2 = 0x10,
.SCR = 0x20,
.BCR1 = 0x2C,
.BCR2 = 0x30,
.BCR3 = 0x34,
.MPLCR = 0x64,
.DCR = 0x84,
.SSR1 = 0x88,
.CFGCR = 0xA0,
.PLLCR1 = 0xC0,
.PLLCR2 = 0xC4,
.PLLSR = 0xC8,
.PLLSDCR1 = 0xCC,
.PLLSDCR2 = 0xD0,
.PLLTWGCR1 = 0xD4,
.PLLTWGCR2 = 0xD8,
.PLLCPCR = 0xE0,
.PLLTESTCR = 0xE8,
}
};
static struct lvds_phy_info lvds_phy_16ff_secondary = {
.base = 0x1100,
.ofs = {
.GCR = 0x0,
.CMCR1 = 0xC,
.CMCR2 = 0x10,
.SCR = 0x20,
.BCR1 = 0x2C,
.BCR2 = 0x30,
.BCR3 = 0x34,
.MPLCR = 0x64,
.DCR = 0x84,
.SSR1 = 0x88,
.CFGCR = 0xA0,
.PLLCR1 = 0xC0,
.PLLCR2 = 0xC4,
.PLLSR = 0xC8,
.PLLSDCR1 = 0xCC,
.PLLSDCR2 = 0xD0,
.PLLTWGCR1 = 0xD4,
.PLLTWGCR2 = 0xD8,
.PLLCPCR = 0xE0,
.PLLTESTCR = 0xE8,
}
};
struct stm_lvds {
void __iomem *base;
struct device *dev;
struct clk *pclk; /* APB peripheral clock */
struct clk *pllref_clk; /* Reference clock for the internal PLL */
struct clk_hw lvds_ck_px; /* Pixel clock */
u32 pixel_clock_rate; /* Pixel clock rate */
struct lvds_phy_info *primary;
struct lvds_phy_info *secondary;
Annotation
- Immediate include surface: `drm/drm_atomic_helper.h`, `drm/drm_bridge.h`, `drm/drm_device.h`, `drm/drm_of.h`, `drm/drm_panel.h`, `drm/drm_print.h`, `drm/drm_probe_helper.h`, `linux/clk.h`.
- Detected declarations: `struct phy_reg_offsets`, `struct lvds_phy_info`, `struct stm_lvds`, `enum lvds_link_type`, `enum lvds_pixel`, `function lvds_write`, `function lvds_read`, `function lvds_set`, `function lvds_clear`, `function lvds_pll_enable`.
- 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.