drivers/gpu/drm/panel/panel-synaptics-tddi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-synaptics-tddi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-synaptics-tddi.c- Extension
.c- Size
- 7346 bytes
- Lines
- 278
- 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/backlight.hlinux/gpio/consumer.hlinux/module.hlinux/of.hlinux/regulator/consumer.hvideo/mipi_display.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.hdrm/drm_probe_helper.h
Detected Declarations
struct tddi_panel_datastruct tddi_ctxfunction tddi_update_statusfunction tddi_preparefunction tddi_unpreparefunction tddi_enablefunction tddi_disablefunction tddi_get_modesfunction tddi_probefunction tddi_remove
Annotated Snippet
struct tddi_panel_data {
u8 lanes;
/* wait timings for panel enable */
u8 delay_ms_sleep_exit;
u8 delay_ms_display_on;
/* wait timings for panel disable */
u8 delay_ms_display_off;
u8 delay_ms_sleep_enter;
};
struct tddi_ctx {
struct drm_panel panel;
struct mipi_dsi_device *dsi;
struct drm_display_mode mode;
struct backlight_device *backlight;
const struct tddi_panel_data *data;
struct regulator_bulk_data *supplies;
struct gpio_desc *reset_gpio;
struct gpio_desc *backlight_gpio;
};
static const struct regulator_bulk_data tddi_supplies[] = {
{ .supply = "vio" },
{ .supply = "vsn" },
{ .supply = "vsp" },
};
static inline struct tddi_ctx *to_tddi_ctx(struct drm_panel *panel)
{
return container_of(panel, struct tddi_ctx, panel);
}
static int tddi_update_status(struct backlight_device *backlight)
{
struct tddi_ctx *ctx = bl_get_data(backlight);
struct mipi_dsi_multi_context dsi = { .dsi = ctx->dsi };
u8 brightness = backlight_get_brightness(backlight);
if (!ctx->panel.enabled)
return 0;
mipi_dsi_dcs_set_display_brightness_multi(&dsi, brightness);
return dsi.accum_err;
}
static int tddi_prepare(struct drm_panel *panel)
{
struct tddi_ctx *ctx = to_tddi_ctx(panel);
struct device *dev = &ctx->dsi->dev;
int ret;
ret = regulator_bulk_enable(ARRAY_SIZE(tddi_supplies), ctx->supplies);
if (ret < 0) {
dev_err(dev, "failed to enable regulators: %d\n", ret);
return ret;
}
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
usleep_range(5000, 6000);
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
usleep_range(5000, 6000);
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
usleep_range(10000, 11000);
gpiod_set_value_cansleep(ctx->backlight_gpio, 0);
usleep_range(5000, 6000);
return 0;
}
static int tddi_unprepare(struct drm_panel *panel)
{
struct tddi_ctx *ctx = to_tddi_ctx(panel);
gpiod_set_value_cansleep(ctx->backlight_gpio, 1);
usleep_range(5000, 6000);
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
usleep_range(5000, 6000);
regulator_bulk_disable(ARRAY_SIZE(tddi_supplies), ctx->supplies);
return 0;
}
static int tddi_enable(struct drm_panel *panel)
{
struct tddi_ctx *ctx = to_tddi_ctx(panel);
struct mipi_dsi_multi_context dsi = { .dsi = ctx->dsi };
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `video/mipi_display.h`, `drm/drm_mipi_dsi.h`, `drm/drm_modes.h`.
- Detected declarations: `struct tddi_panel_data`, `struct tddi_ctx`, `function tddi_update_status`, `function tddi_prepare`, `function tddi_unprepare`, `function tddi_enable`, `function tddi_disable`, `function tddi_get_modes`, `function tddi_probe`, `function tddi_remove`.
- 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.