drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-tdo-tl070wsh30.c- Extension
.c- Size
- 5593 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/gpio/consumer.hlinux/module.hlinux/of.hlinux/regulator/consumer.hvideo/mipi_display.hdrm/drm_crtc.hdrm/drm_device.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.h
Detected Declarations
struct tdo_tl070wsh30_panelfunction tdo_tl070wsh30_panel_preparefunction tdo_tl070wsh30_panel_unpreparefunction tdo_tl070wsh30_panel_get_modesfunction tdo_tl070wsh30_panel_addfunction tdo_tl070wsh30_panel_probefunction tdo_tl070wsh30_panel_remove
Annotated Snippet
struct tdo_tl070wsh30_panel {
struct drm_panel base;
struct mipi_dsi_device *link;
struct regulator *supply;
struct gpio_desc *reset_gpio;
};
static inline
struct tdo_tl070wsh30_panel *to_tdo_tl070wsh30_panel(struct drm_panel *panel)
{
return container_of(panel, struct tdo_tl070wsh30_panel, base);
}
static int tdo_tl070wsh30_panel_prepare(struct drm_panel *panel)
{
struct tdo_tl070wsh30_panel *tdo_tl070wsh30 = to_tdo_tl070wsh30_panel(panel);
int err;
err = regulator_enable(tdo_tl070wsh30->supply);
if (err < 0)
return err;
usleep_range(10000, 11000);
gpiod_set_value_cansleep(tdo_tl070wsh30->reset_gpio, 1);
usleep_range(10000, 11000);
gpiod_set_value_cansleep(tdo_tl070wsh30->reset_gpio, 0);
msleep(200);
err = mipi_dsi_dcs_exit_sleep_mode(tdo_tl070wsh30->link);
if (err < 0) {
dev_err(panel->dev, "failed to exit sleep mode: %d\n", err);
regulator_disable(tdo_tl070wsh30->supply);
return err;
}
msleep(200);
err = mipi_dsi_dcs_set_display_on(tdo_tl070wsh30->link);
if (err < 0) {
dev_err(panel->dev, "failed to set display on: %d\n", err);
regulator_disable(tdo_tl070wsh30->supply);
return err;
}
msleep(20);
return 0;
}
static int tdo_tl070wsh30_panel_unprepare(struct drm_panel *panel)
{
struct tdo_tl070wsh30_panel *tdo_tl070wsh30 = to_tdo_tl070wsh30_panel(panel);
int err;
err = mipi_dsi_dcs_set_display_off(tdo_tl070wsh30->link);
if (err < 0)
dev_err(panel->dev, "failed to set display off: %d\n", err);
usleep_range(10000, 11000);
err = mipi_dsi_dcs_enter_sleep_mode(tdo_tl070wsh30->link);
if (err < 0) {
dev_err(panel->dev, "failed to enter sleep mode: %d\n", err);
return err;
}
usleep_range(10000, 11000);
regulator_disable(tdo_tl070wsh30->supply);
return 0;
}
static const struct drm_display_mode default_mode = {
.clock = 47250,
.hdisplay = 1024,
.hsync_start = 1024 + 46,
.hsync_end = 1024 + 46 + 80,
.htotal = 1024 + 46 + 80 + 100,
.vdisplay = 600,
.vsync_start = 600 + 5,
.vsync_end = 600 + 5 + 5,
.vtotal = 600 + 5 + 5 + 20,
.flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
};
Annotation
- Immediate include surface: `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `video/mipi_display.h`, `drm/drm_crtc.h`, `drm/drm_device.h`.
- Detected declarations: `struct tdo_tl070wsh30_panel`, `function tdo_tl070wsh30_panel_prepare`, `function tdo_tl070wsh30_panel_unprepare`, `function tdo_tl070wsh30_panel_get_modes`, `function tdo_tl070wsh30_panel_add`, `function tdo_tl070wsh30_panel_probe`, `function tdo_tl070wsh30_panel_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.