drivers/gpu/drm/panel/panel-novatek-nt36672a.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-novatek-nt36672a.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-novatek-nt36672a.c- Extension
.c- Size
- 17257 bytes
- Lines
- 651
- 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/kernel.hlinux/module.hlinux/of.hlinux/gpio/consumer.hlinux/pinctrl/consumer.hlinux/regulator/consumer.hdrm/drm_device.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.hvideo/mipi_display.h
Detected Declarations
struct nt36672a_panel_cmdstruct nt36672a_panel_descstruct nt36672a_panelfunction nt36672a_send_cmdsfunction nt36672a_panel_power_offfunction nt36672a_panel_unpreparefunction nt36672a_panel_power_onfunction nt36672a_panel_preparefunction nt36672a_panel_get_modesfunction nt36672a_panel_addfunction nt36672a_panel_probefunction nt36672a_panel_remove
Annotated Snippet
struct nt36672a_panel_cmd {
const char data[2];
};
static const char * const nt36672a_regulator_names[] = {
"vddio",
"vddpos",
"vddneg",
};
static unsigned long const nt36672a_regulator_enable_loads[] = {
62000,
100000,
100000
};
struct nt36672a_panel_desc {
const struct drm_display_mode *display_mode;
const char *panel_name;
unsigned int width_mm;
unsigned int height_mm;
unsigned long mode_flags;
enum mipi_dsi_pixel_format format;
unsigned int lanes;
unsigned int num_on_cmds_1;
const struct nt36672a_panel_cmd *on_cmds_1;
unsigned int num_on_cmds_2;
const struct nt36672a_panel_cmd *on_cmds_2;
unsigned int num_off_cmds;
const struct nt36672a_panel_cmd *off_cmds;
};
struct nt36672a_panel {
struct drm_panel base;
struct mipi_dsi_device *link;
const struct nt36672a_panel_desc *desc;
struct regulator_bulk_data supplies[ARRAY_SIZE(nt36672a_regulator_names)];
struct gpio_desc *reset_gpio;
};
static inline struct nt36672a_panel *to_nt36672a_panel(struct drm_panel *panel)
{
return container_of(panel, struct nt36672a_panel, base);
}
static void nt36672a_send_cmds(struct mipi_dsi_multi_context *dsi_ctx,
const struct nt36672a_panel_cmd *cmds, int num)
{
unsigned int i;
for (i = 0; i < num; i++) {
const struct nt36672a_panel_cmd *cmd = &cmds[i];
/* cmd->data[0] is the DCS command, cmd->data[1] is the parameter */
mipi_dsi_dcs_write_buffer_multi(dsi_ctx, cmd->data, sizeof(cmd->data));
}
}
static void nt36672a_panel_power_off(struct drm_panel *panel)
{
struct nt36672a_panel *pinfo = to_nt36672a_panel(panel);
int ret;
gpiod_set_value(pinfo->reset_gpio, 1);
ret = regulator_bulk_disable(ARRAY_SIZE(pinfo->supplies), pinfo->supplies);
if (ret)
dev_err(panel->dev, "regulator_bulk_disable failed %d\n", ret);
}
static int nt36672a_panel_unprepare(struct drm_panel *panel)
{
struct nt36672a_panel *pinfo = to_nt36672a_panel(panel);
struct mipi_dsi_multi_context dsi_ctx = { .dsi = pinfo->link };
/* send off cmds */
nt36672a_send_cmds(&dsi_ctx, pinfo->desc->off_cmds,
pinfo->desc->num_off_cmds);
/* Reset error to continue with display off even if send_cmds failed */
dsi_ctx.accum_err = 0;
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
/* Reset error to continue power-down even if display off failed */
dsi_ctx.accum_err = 0;
Annotation
- Immediate include surface: `linux/delay.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`, `linux/gpio/consumer.h`, `linux/pinctrl/consumer.h`, `linux/regulator/consumer.h`, `drm/drm_device.h`.
- Detected declarations: `struct nt36672a_panel_cmd`, `struct nt36672a_panel_desc`, `struct nt36672a_panel`, `function nt36672a_send_cmds`, `function nt36672a_panel_power_off`, `function nt36672a_panel_unprepare`, `function nt36672a_panel_power_on`, `function nt36672a_panel_prepare`, `function nt36672a_panel_get_modes`, `function nt36672a_panel_add`.
- 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.