drivers/gpu/drm/omapdrm/dss/dpi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/omapdrm/dss/dpi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/omapdrm/dss/dpi.c- Extension
.c- Size
- 15657 bytes
- Lines
- 747
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/delay.hlinux/err.hlinux/errno.hlinux/export.hlinux/kernel.hlinux/of.hlinux/of_graph.hlinux/platform_device.hlinux/regulator/consumer.hlinux/string.hlinux/sys_soc.hdrm/drm_bridge.hdss.homapdss.h
Detected Declarations
struct dpi_datastruct dpi_clk_calc_ctxfunction dpi_get_clk_src_dra7xxfunction dpi_get_clk_srcfunction dpi_calc_dispc_cbfunction dpi_calc_hsdiv_cbfunction dpi_calc_pll_cbfunction dpi_calc_dss_cbfunction dpi_pll_clk_calcfunction dpi_dss_clk_calcfunction dpi_set_pll_clkfunction dpi_set_dispc_clkfunction dpi_set_modefunction dpi_config_lcd_managerfunction dpi_clock_updatefunction dpi_verify_pllfunction dpi_init_pllfunction dpi_bridge_attachfunction dpi_bridge_mode_validfunction dpi_bridge_mode_fixupfunction dpi_bridge_mode_setfunction dpi_bridge_enablefunction dpi_bridge_disablefunction dpi_bridge_initfunction dpi_bridge_cleanupfunction dpi_get_channelfunction dpi_init_output_portfunction dpi_uninit_output_portfunction dpi_init_regulatorfunction dpi_init_portfunction dpi_uninit_port
Annotated Snippet
struct dpi_data {
struct platform_device *pdev;
enum dss_model dss_model;
struct dss_device *dss;
unsigned int id;
struct regulator *vdds_dsi_reg;
enum dss_clk_source clk_src;
struct dss_pll *pll;
struct dss_lcd_mgr_config mgr_config;
unsigned long pixelclock;
int data_lines;
struct omap_dss_device output;
struct drm_bridge bridge;
};
#define drm_bridge_to_dpi(bridge) container_of(bridge, struct dpi_data, bridge)
/* -----------------------------------------------------------------------------
* Clock Handling and PLL
*/
static enum dss_clk_source dpi_get_clk_src_dra7xx(struct dpi_data *dpi,
enum omap_channel channel)
{
/*
* Possible clock sources:
* LCD1: FCK/PLL1_1/HDMI_PLL
* LCD2: FCK/PLL1_3/HDMI_PLL (DRA74x: PLL2_3)
* LCD3: FCK/PLL1_3/HDMI_PLL (DRA74x: PLL2_1)
*/
switch (channel) {
case OMAP_DSS_CHANNEL_LCD:
{
if (dss_pll_find_by_src(dpi->dss, DSS_CLK_SRC_PLL1_1))
return DSS_CLK_SRC_PLL1_1;
break;
}
case OMAP_DSS_CHANNEL_LCD2:
{
if (dss_pll_find_by_src(dpi->dss, DSS_CLK_SRC_PLL1_3))
return DSS_CLK_SRC_PLL1_3;
if (dss_pll_find_by_src(dpi->dss, DSS_CLK_SRC_PLL2_3))
return DSS_CLK_SRC_PLL2_3;
break;
}
case OMAP_DSS_CHANNEL_LCD3:
{
if (dss_pll_find_by_src(dpi->dss, DSS_CLK_SRC_PLL2_1))
return DSS_CLK_SRC_PLL2_1;
if (dss_pll_find_by_src(dpi->dss, DSS_CLK_SRC_PLL1_3))
return DSS_CLK_SRC_PLL1_3;
break;
}
default:
break;
}
return DSS_CLK_SRC_FCK;
}
static enum dss_clk_source dpi_get_clk_src(struct dpi_data *dpi)
{
enum omap_channel channel = dpi->output.dispc_channel;
/*
* XXX we can't currently use DSI PLL for DPI with OMAP3, as the DSI PLL
* would also be used for DISPC fclk. Meaning, when the DPI output is
* disabled, DISPC clock will be disabled, and TV out will stop.
*/
switch (dpi->dss_model) {
case DSS_MODEL_OMAP2:
case DSS_MODEL_OMAP3:
return DSS_CLK_SRC_FCK;
case DSS_MODEL_OMAP4:
switch (channel) {
case OMAP_DSS_CHANNEL_LCD:
return DSS_CLK_SRC_PLL1_1;
case OMAP_DSS_CHANNEL_LCD2:
return DSS_CLK_SRC_PLL2_1;
default:
return DSS_CLK_SRC_FCK;
}
case DSS_MODEL_OMAP5:
switch (channel) {
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/err.h`, `linux/errno.h`, `linux/export.h`, `linux/kernel.h`, `linux/of.h`, `linux/of_graph.h`.
- Detected declarations: `struct dpi_data`, `struct dpi_clk_calc_ctx`, `function dpi_get_clk_src_dra7xx`, `function dpi_get_clk_src`, `function dpi_calc_dispc_cb`, `function dpi_calc_hsdiv_cb`, `function dpi_calc_pll_cb`, `function dpi_calc_dss_cb`, `function dpi_pll_clk_calc`, `function dpi_dss_clk_calc`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.