drivers/gpu/drm/panel/panel-hydis-hv101hd1.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-hydis-hv101hd1.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-hydis-hv101hd1.c- Extension
.c- Size
- 4550 bytes
- Lines
- 189
- 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/array_size.hlinux/delay.hlinux/err.hlinux/gpio/consumer.hlinux/mod_devicetable.hlinux/module.hlinux/property.hlinux/regulator/consumer.hvideo/mipi_display.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.h
Detected Declarations
struct hv101hd1function hv101hd1_preparefunction hv101hd1_disablefunction hv101hd1_unpreparefunction hv101hd1_get_modesfunction hv101hd1_probefunction hv101hd1_remove
Annotated Snippet
struct hv101hd1 {
struct drm_panel panel;
struct mipi_dsi_device *dsi;
struct regulator_bulk_data *supplies;
};
static const struct regulator_bulk_data hv101hd1_supplies[] = {
{ .supply = "vdd" },
{ .supply = "vio" },
};
static inline struct hv101hd1 *to_hv101hd1(struct drm_panel *panel)
{
return container_of(panel, struct hv101hd1, panel);
}
static int hv101hd1_prepare(struct drm_panel *panel)
{
struct hv101hd1 *hv = to_hv101hd1(panel);
struct mipi_dsi_multi_context ctx = { .dsi = hv->dsi };
struct device *dev = &hv->dsi->dev;
int ret;
ret = regulator_bulk_enable(ARRAY_SIZE(hv101hd1_supplies), hv->supplies);
if (ret) {
dev_err(dev, "error enabling regulators (%d)\n", ret);
return ret;
}
mipi_dsi_dcs_exit_sleep_mode_multi(&ctx);
mipi_dsi_msleep(&ctx, 20);
mipi_dsi_dcs_set_display_on_multi(&ctx);
mipi_dsi_msleep(&ctx, 20);
return 0;
}
static int hv101hd1_disable(struct drm_panel *panel)
{
struct hv101hd1 *hv = to_hv101hd1(panel);
struct mipi_dsi_multi_context ctx = { .dsi = hv->dsi };
mipi_dsi_dcs_set_display_off_multi(&ctx);
mipi_dsi_msleep(&ctx, 120);
mipi_dsi_dcs_enter_sleep_mode_multi(&ctx);
mipi_dsi_msleep(&ctx, 20);
return 0;
}
static int hv101hd1_unprepare(struct drm_panel *panel)
{
struct hv101hd1 *hv = to_hv101hd1(panel);
return regulator_bulk_disable(ARRAY_SIZE(hv101hd1_supplies),
hv->supplies);
}
static const struct drm_display_mode hv101hd1_mode = {
.clock = (1366 + 74 + 36 + 24) * (768 + 21 + 7 + 4) * 60 / 1000,
.hdisplay = 1366,
.hsync_start = 1366 + 74,
.hsync_end = 1366 + 74 + 36,
.htotal = 1366 + 74 + 36 + 24,
.vdisplay = 768,
.vsync_start = 768 + 21,
.vsync_end = 768 + 21 + 7,
.vtotal = 768 + 21 + 7 + 4,
.width_mm = 140,
.height_mm = 220,
};
static int hv101hd1_get_modes(struct drm_panel *panel, struct drm_connector *connector)
{
struct drm_display_mode *mode;
mode = drm_mode_duplicate(connector->dev, &hv101hd1_mode);
if (!mode)
return -ENOMEM;
drm_mode_set_name(mode);
mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
connector->display_info.width_mm = mode->width_mm;
connector->display_info.height_mm = mode->height_mm;
drm_mode_probed_add(connector, mode);
Annotation
- Immediate include surface: `linux/array_size.h`, `linux/delay.h`, `linux/err.h`, `linux/gpio/consumer.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/property.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct hv101hd1`, `function hv101hd1_prepare`, `function hv101hd1_disable`, `function hv101hd1_unprepare`, `function hv101hd1_get_modes`, `function hv101hd1_probe`, `function hv101hd1_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.