drivers/video/fbdev/omap2/omapfb/dss/dpi.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/omap2/omapfb/dss/dpi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/omap2/omapfb/dss/dpi.c- Extension
.c- Size
- 18402 bytes
- Lines
- 888
- Domain
- Driver Families
- Bucket
- drivers/video
- 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
linux/kernel.hlinux/delay.hlinux/err.hlinux/errno.hlinux/platform_device.hlinux/regulator/consumer.hlinux/string.hlinux/of.hlinux/of_graph.hlinux/clk.hlinux/component.hvideo/omapfb_dss.hdss.hdss_features.h
Detected Declarations
struct dpi_datastruct dpi_clk_calc_ctxfunction dpi_get_alt_clk_srcfunction dpi_calc_dispc_cbfunction dpi_calc_hsdiv_cbfunction dpi_calc_pll_cbfunction dpi_calc_dss_cbfunction dpi_dsi_clk_calcfunction dpi_dss_clk_calcfunction dpi_set_dsi_clkfunction dpi_set_dispc_clkfunction dpi_set_modefunction dpi_config_lcd_managerfunction dpi_display_enablefunction dpi_display_disablefunction dpi_set_timingsfunction dpi_get_timingsfunction dpi_check_timingsfunction dpi_set_data_linesfunction dpi_verify_dsi_pllfunction dpi_init_regulatorfunction dpi_init_pllfunction dpi_get_channelfunction dpi_connectfunction dpi_disconnectfunction dpi_init_outputfunction dpi_uninit_outputfunction dpi_init_output_portfunction dpi_uninit_output_portfunction dpi_bindfunction dpi_unbindfunction dpi_probefunction dpi_removefunction dpi_init_platform_driverfunction dpi_uninit_platform_driverfunction dpi_init_portfunction dpi_uninit_port
Annotated Snippet
struct dpi_data {
struct platform_device *pdev;
struct regulator *vdds_dsi_reg;
struct dss_pll *pll;
struct mutex lock;
struct omap_video_timings timings;
struct dss_lcd_mgr_config mgr_config;
int data_lines;
struct omap_dss_device output;
bool port_initialized;
};
static struct dpi_data *dpi_get_data_from_dssdev(struct omap_dss_device *dssdev)
{
return container_of(dssdev, struct dpi_data, output);
}
/* only used in non-DT mode */
static struct dpi_data *dpi_get_data_from_pdev(struct platform_device *pdev)
{
return platform_get_drvdata(pdev);
}
static struct dss_pll *dpi_get_pll(enum omap_channel 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 (omapdss_get_version()) {
case OMAPDSS_VER_OMAP24xx:
case OMAPDSS_VER_OMAP34xx_ES1:
case OMAPDSS_VER_OMAP34xx_ES3:
case OMAPDSS_VER_OMAP3630:
case OMAPDSS_VER_AM35xx:
case OMAPDSS_VER_AM43xx:
return NULL;
case OMAPDSS_VER_OMAP4430_ES1:
case OMAPDSS_VER_OMAP4430_ES2:
case OMAPDSS_VER_OMAP4:
switch (channel) {
case OMAP_DSS_CHANNEL_LCD:
return dss_pll_find("dsi0");
case OMAP_DSS_CHANNEL_LCD2:
return dss_pll_find("dsi1");
default:
return NULL;
}
case OMAPDSS_VER_OMAP5:
switch (channel) {
case OMAP_DSS_CHANNEL_LCD:
return dss_pll_find("dsi0");
case OMAP_DSS_CHANNEL_LCD3:
return dss_pll_find("dsi1");
default:
return NULL;
}
case OMAPDSS_VER_DRA7xx:
switch (channel) {
case OMAP_DSS_CHANNEL_LCD:
case OMAP_DSS_CHANNEL_LCD2:
return dss_pll_find("video0");
case OMAP_DSS_CHANNEL_LCD3:
return dss_pll_find("video1");
default:
return NULL;
}
default:
return NULL;
}
}
static enum omap_dss_clk_source dpi_get_alt_clk_src(enum omap_channel channel)
{
switch (channel) {
case OMAP_DSS_CHANNEL_LCD:
return OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC;
case OMAP_DSS_CHANNEL_LCD2:
return OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC;
case OMAP_DSS_CHANNEL_LCD3:
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/delay.h`, `linux/err.h`, `linux/errno.h`, `linux/platform_device.h`, `linux/regulator/consumer.h`, `linux/string.h`, `linux/of.h`.
- Detected declarations: `struct dpi_data`, `struct dpi_clk_calc_ctx`, `function dpi_get_alt_clk_src`, `function dpi_calc_dispc_cb`, `function dpi_calc_hsdiv_cb`, `function dpi_calc_pll_cb`, `function dpi_calc_dss_cb`, `function dpi_dsi_clk_calc`, `function dpi_dss_clk_calc`, `function dpi_set_dsi_clk`.
- Atlas domain: Driver Families / drivers/video.
- 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.