drivers/gpu/drm/tegra/dsi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/tegra/dsi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/tegra/dsi.c- Extension
.c- Size
- 43158 bytes
- Lines
- 1708
- 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
linux/clk.hlinux/debugfs.hlinux/delay.hlinux/host1x.hlinux/module.hlinux/of.hlinux/of_platform.hlinux/platform_device.hlinux/pm_runtime.hlinux/regulator/consumer.hlinux/reset.hlinux/tegra-mipi-cal.hvideo/mipi_display.hdrm/drm_atomic_helper.hdrm/drm_debugfs.hdrm/drm_file.hdrm/drm_mipi_dsi.hdrm/drm_panel.hdrm/drm_print.hdrm/drm_simple_kms_helper.hdc.hdrm.hdsi.hmipi-phy.htrace.h
Detected Declarations
struct tegra_dsi_statestruct tegra_dsifunction to_dsi_statefunction host1x_client_to_dsifunction tegra_dsi_readlfunction tegra_dsi_writelfunction tegra_dsi_show_regsfunction tegra_dsi_late_registerfunction tegra_dsi_early_unregisterfunction tegra_dsi_set_phy_timingfunction tegra_dsi_get_muldivfunction tegra_dsi_get_formatfunction tegra_dsi_ganged_enablefunction tegra_dsi_enablefunction tegra_dsi_get_lanesfunction tegra_dsi_configurefunction tegra_dsi_wait_idlefunction tegra_dsi_video_disablefunction tegra_dsi_ganged_disablefunction tegra_dsi_pad_enablefunction tegra_dsi_pad_calibratefunction tegra_dsi_set_timeoutfunction tegra_dsi_disablefunction tegra_dsi_soft_resetfunction tegra_dsi_connector_resetfunction tegra_dsi_connector_duplicate_statefunction tegra_dsi_connector_mode_validfunction tegra_dsi_unpreparefunction tegra_dsi_encoder_disablefunction tegra_dsi_preparefunction tegra_dsi_encoder_enablefunction tegra_dsi_encoder_atomic_checkfunction tegra_dsi_initfunction tegra_dsi_exitfunction tegra_dsi_runtime_suspendfunction tegra_dsi_runtime_resumefunction tegra_dsi_setup_clocksfunction tegra_dsi_read_responsefunction tegra_dsi_transmitfunction tegra_dsi_wait_for_responsefunction tegra_dsi_writeslfunction tegra_dsi_host_transferfunction tegra_dsi_ganged_setupfunction tegra_dsi_host_attachfunction tegra_dsi_host_detachfunction tegra_dsi_ganged_probefunction tegra_dsi_probefunction tegra_dsi_remove
Annotated Snippet
struct tegra_dsi_state {
struct drm_connector_state base;
struct mipi_dphy_timing timing;
unsigned long period;
unsigned int vrefresh;
unsigned int lanes;
unsigned long pclk;
unsigned long bclk;
enum tegra_dsi_format format;
unsigned int mul;
unsigned int div;
};
static inline struct tegra_dsi_state *
to_dsi_state(struct drm_connector_state *state)
{
return container_of(state, struct tegra_dsi_state, base);
}
struct tegra_dsi {
struct host1x_client client;
struct tegra_output output;
struct device *dev;
void __iomem *regs;
struct reset_control *rst;
struct clk *clk_parent;
struct clk *clk_lp;
struct clk *clk;
struct drm_info_list *debugfs_files;
unsigned long flags;
enum mipi_dsi_pixel_format format;
unsigned int lanes;
struct tegra_mipi_device *mipi;
struct mipi_dsi_host host;
struct regulator *vdd;
unsigned int video_fifo_depth;
unsigned int host_fifo_depth;
/* for ganged-mode support */
struct tegra_dsi *master;
struct tegra_dsi *slave;
};
static inline struct tegra_dsi *
host1x_client_to_dsi(struct host1x_client *client)
{
return container_of(client, struct tegra_dsi, client);
}
static inline struct tegra_dsi *host_to_tegra(struct mipi_dsi_host *host)
{
return container_of(host, struct tegra_dsi, host);
}
static inline struct tegra_dsi *to_dsi(struct tegra_output *output)
{
return container_of(output, struct tegra_dsi, output);
}
static struct tegra_dsi_state *tegra_dsi_get_state(struct tegra_dsi *dsi)
{
return to_dsi_state(dsi->output.connector.state);
}
static inline u32 tegra_dsi_readl(struct tegra_dsi *dsi, unsigned int offset)
{
u32 value = readl(dsi->regs + (offset << 2));
trace_dsi_readl(dsi->dev, offset, value);
return value;
}
static inline void tegra_dsi_writel(struct tegra_dsi *dsi, u32 value,
unsigned int offset)
{
trace_dsi_writel(dsi->dev, offset, value);
writel(value, dsi->regs + (offset << 2));
}
Annotation
- Immediate include surface: `linux/clk.h`, `linux/debugfs.h`, `linux/delay.h`, `linux/host1x.h`, `linux/module.h`, `linux/of.h`, `linux/of_platform.h`, `linux/platform_device.h`.
- Detected declarations: `struct tegra_dsi_state`, `struct tegra_dsi`, `function to_dsi_state`, `function host1x_client_to_dsi`, `function tegra_dsi_readl`, `function tegra_dsi_writel`, `function tegra_dsi_show_regs`, `function tegra_dsi_late_register`, `function tegra_dsi_early_unregister`, `function tegra_dsi_set_phy_timing`.
- 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.