drivers/video/fbdev/omap2/omapfb/dss/sdi.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/omap2/omapfb/dss/sdi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/omap2/omapfb/dss/sdi.c- Extension
.c- Size
- 9235 bytes
- Lines
- 443
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/delay.hlinux/err.hlinux/regulator/consumer.hlinux/platform_device.hlinux/string.hlinux/of.hlinux/of_graph.hlinux/component.hvideo/omapfb_dss.hdss.h
Detected Declarations
struct sdi_clk_calc_ctxfunction dpi_calc_dispc_cbfunction dpi_calc_dss_cbfunction sdi_calc_clock_divfunction sdi_config_lcd_managerfunction sdi_display_enablefunction sdi_display_disablefunction sdi_set_timingsfunction sdi_get_timingsfunction sdi_check_timingsfunction sdi_set_datapairsfunction sdi_init_regulatorfunction sdi_connectfunction sdi_disconnectfunction sdi_init_outputfunction sdi_uninit_outputfunction sdi_bindfunction sdi_unbindfunction sdi_probefunction sdi_removefunction sdi_init_platform_driverfunction sdi_uninit_platform_driverfunction sdi_init_portfunction sdi_uninit_port
Annotated Snippet
struct sdi_clk_calc_ctx {
unsigned long pck_min, pck_max;
unsigned long fck;
struct dispc_clock_info dispc_cinfo;
};
static bool dpi_calc_dispc_cb(int lckd, int pckd, unsigned long lck,
unsigned long pck, void *data)
{
struct sdi_clk_calc_ctx *ctx = data;
ctx->dispc_cinfo.lck_div = lckd;
ctx->dispc_cinfo.pck_div = pckd;
ctx->dispc_cinfo.lck = lck;
ctx->dispc_cinfo.pck = pck;
return true;
}
static bool dpi_calc_dss_cb(unsigned long fck, void *data)
{
struct sdi_clk_calc_ctx *ctx = data;
ctx->fck = fck;
return dispc_div_calc(fck, ctx->pck_min, ctx->pck_max,
dpi_calc_dispc_cb, ctx);
}
static int sdi_calc_clock_div(unsigned long pclk,
unsigned long *fck,
struct dispc_clock_info *dispc_cinfo)
{
int i;
struct sdi_clk_calc_ctx ctx;
/*
* DSS fclk gives us very few possibilities, so finding a good pixel
* clock may not be possible. We try multiple times to find the clock,
* each time widening the pixel clock range we look for, up to
* +/- 1MHz.
*/
for (i = 0; i < 10; ++i) {
bool ok;
memset(&ctx, 0, sizeof(ctx));
if (pclk > 1000 * i * i * i)
ctx.pck_min = max(pclk - 1000 * i * i * i, 0lu);
else
ctx.pck_min = 0;
ctx.pck_max = pclk + 1000 * i * i * i;
ok = dss_div_calc(pclk, ctx.pck_min, dpi_calc_dss_cb, &ctx);
if (ok) {
*fck = ctx.fck;
*dispc_cinfo = ctx.dispc_cinfo;
return 0;
}
}
return -EINVAL;
}
static void sdi_config_lcd_manager(struct omap_dss_device *dssdev)
{
struct omap_overlay_manager *mgr = sdi.output.manager;
sdi.mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS;
sdi.mgr_config.stallmode = false;
sdi.mgr_config.fifohandcheck = false;
sdi.mgr_config.video_port_width = 24;
sdi.mgr_config.lcden_sig_polarity = 1;
dss_mgr_set_lcd_config(mgr, &sdi.mgr_config);
}
static int sdi_display_enable(struct omap_dss_device *dssdev)
{
struct omap_dss_device *out = &sdi.output;
struct omap_video_timings *t = &sdi.timings;
unsigned long fck;
struct dispc_clock_info dispc_cinfo;
unsigned long pck;
int r;
if (out->manager == NULL) {
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/delay.h`, `linux/err.h`, `linux/regulator/consumer.h`, `linux/platform_device.h`, `linux/string.h`, `linux/of.h`, `linux/of_graph.h`.
- Detected declarations: `struct sdi_clk_calc_ctx`, `function dpi_calc_dispc_cb`, `function dpi_calc_dss_cb`, `function sdi_calc_clock_div`, `function sdi_config_lcd_manager`, `function sdi_display_enable`, `function sdi_display_disable`, `function sdi_set_timings`, `function sdi_get_timings`, `function sdi_check_timings`.
- Atlas domain: Driver Families / drivers/video.
- 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.