drivers/gpu/drm/panel/panel-focaltech-ota7290b.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-focaltech-ota7290b.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-focaltech-ota7290b.c- Extension
.c- Size
- 5517 bytes
- Lines
- 226
- 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/delay.hlinux/device.hlinux/err.hlinux/errno.hlinux/kernel.hlinux/module.hlinux/of.hlinux/gpio/consumer.hlinux/regulator/consumer.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.hdrm/drm_probe_helper.h
Detected Declarations
struct ota7290bfunction ota7290b_preparefunction ota7290b_unpreparefunction ota7290b_get_modesfunction ota7290b_get_orientationfunction ota7290b_probe
Annotated Snippet
struct ota7290b {
struct drm_panel panel;
struct mipi_dsi_device *dsi;
struct regulator *power;
struct gpio_desc *reset;
struct regulator *avdd;
struct regulator *vdd;
struct regulator *vcc;
enum drm_panel_orientation orientation;
};
static inline struct ota7290b *panel_to_ota(struct drm_panel *panel)
{
return container_of(panel, struct ota7290b, panel);
}
static int ota7290b_prepare(struct drm_panel *panel)
{
struct ota7290b *ctx = panel_to_ota(panel);
struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
int ret;
if (ctx->vcc) {
ret = regulator_enable(ctx->vcc);
if (ret)
dev_err(panel->dev, "failed to enable VCC regulator: %d\n", ret);
}
if (ctx->reset) {
gpiod_set_value_cansleep(ctx->reset, 0);
msleep(60);
gpiod_set_value_cansleep(ctx->reset, 1);
msleep(60);
}
if (ctx->vdd) {
ret = regulator_enable(ctx->vdd);
if (ret)
dev_err(panel->dev, "failed to enable VDD regulator: %d\n", ret);
}
if (ctx->reset) {
gpiod_set_value_cansleep(ctx->reset, 0);
msleep(60);
}
if (ctx->avdd) {
ret = regulator_enable(ctx->avdd);
if (ret)
dev_err(panel->dev, "failed to enable AVDD regulator: %d\n", ret);
}
mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 120);
mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 50);
if (dsi_ctx.accum_err < 0)
dev_err(panel->dev, "failed to init panel: %d\n", dsi_ctx.accum_err);
return dsi_ctx.accum_err;
}
static int ota7290b_unprepare(struct drm_panel *panel)
{
struct ota7290b *ctx = panel_to_ota(panel);
struct mipi_dsi_multi_context dsi_ctx = { .dsi = ctx->dsi };
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
if (ctx->avdd)
regulator_disable(ctx->avdd);
if (ctx->reset) {
gpiod_set_value_cansleep(ctx->reset, 1);
msleep(5);
}
if (ctx->vdd)
regulator_disable(ctx->vdd);
if (ctx->vcc)
regulator_disable(ctx->vcc);
return 0;
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/err.h`, `linux/errno.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`, `linux/gpio/consumer.h`.
- Detected declarations: `struct ota7290b`, `function ota7290b_prepare`, `function ota7290b_unprepare`, `function ota7290b_get_modes`, `function ota7290b_get_orientation`, `function ota7290b_probe`.
- 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.