drivers/gpu/drm/panel/panel-novatek-nt37700f.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-novatek-nt37700f.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-novatek-nt37700f.c- Extension
.c- Size
- 8746 bytes
- Lines
- 301
- 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/delay.hlinux/gpio/consumer.hlinux/module.hlinux/regulator/consumer.hlinux/of.hvideo/mipi_display.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.hdrm/drm_probe_helper.h
Detected Declarations
struct nt37700f_tianmafunction nt37700f_tianma_resetfunction nt37700f_tianma_onfunction nt37700f_tianma_disablefunction nt37700f_tianma_preparefunction nt37700f_tianma_unpreparefunction nt37700f_tianma_get_modesfunction nt37700f_tianma_bl_update_statusfunction nt37700f_tianma_bl_get_brightnessfunction nt37700f_tianma_create_backlightfunction nt37700f_tianma_probefunction nt37700f_tianma_remove
Annotated Snippet
struct nt37700f_tianma {
struct drm_panel panel;
struct mipi_dsi_device *dsi;
struct regulator *supply;
struct gpio_desc *reset_gpio;
};
static inline
struct nt37700f_tianma *to_nt37700f_tianma(struct drm_panel *panel)
{
return container_of(panel, struct nt37700f_tianma, panel);
}
static void nt37700f_tianma_reset(struct nt37700f_tianma *ctx)
{
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
usleep_range(1000, 2000);
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
usleep_range(10000, 11000);
}
#define nt37700f_tianma_panel_switch_page(ctx, page) \
mipi_dsi_dcs_write_seq_multi((ctx), 0xf0, 0x55, 0xaa, 0x52, 0x08, (page))
static int nt37700f_tianma_on(struct nt37700f_tianma *ctx)
{
struct mipi_dsi_device *dsi = ctx->dsi;
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
nt37700f_tianma_panel_switch_page(&dsi_ctx, 0x00);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc0, 0x56);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xca, 0x52);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6f, 0x06);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb5, 0x2b, 0x1a);
nt37700f_tianma_panel_switch_page(&dsi_ctx, 0x01);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xcd, 0x04, 0x82);
nt37700f_tianma_panel_switch_page(&dsi_ctx, 0x02);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xcc, 0x00);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xff, 0xaa, 0x55, 0xa5, 0x80);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6f, 0x55);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf6, 0x00);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6f, 0x56);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf6, 0x00);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xff, 0xaa, 0x55, 0xa5, 0x81);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6f, 0x07);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf3, 0x07);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6f, 0x05);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf3, 0x25);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x90, 0x01);
mipi_dsi_dcs_set_column_address_multi(&dsi_ctx, 0x0000, 1080 - 1);
mipi_dsi_dcs_set_page_address_multi(&dsi_ctx, 0x0000, 2160 - 1);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, MIPI_DCS_WRITE_CONTROL_DISPLAY, 0x20);
mipi_dsi_dcs_set_tear_on_multi(&dsi_ctx, MIPI_DSI_DCS_TEAR_MODE_VBLANK);
nt37700f_tianma_panel_switch_page(&dsi_ctx, 0x00);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xc0, 0x56);
nt37700f_tianma_panel_switch_page(&dsi_ctx, 0x02);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xcd, 0x00);
nt37700f_tianma_panel_switch_page(&dsi_ctx, 0x04);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xd0, 0x11, 0x64);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x6f, 0x09);
mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb1, 0x20);
mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 120);
mipi_dsi_dcs_set_display_on_multi(&dsi_ctx);
return dsi_ctx.accum_err;
}
static int nt37700f_tianma_disable(struct drm_panel *panel)
{
struct nt37700f_tianma *ctx = to_nt37700f_tianma(panel);
struct mipi_dsi_device *dsi = ctx->dsi;
struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
mipi_dsi_dcs_set_display_off_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 50);
mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);
mipi_dsi_msleep(&dsi_ctx, 100);
return dsi_ctx.accum_err;
}
static int nt37700f_tianma_prepare(struct drm_panel *panel)
{
struct nt37700f_tianma *ctx = to_nt37700f_tianma(panel);
struct device *dev = &ctx->dsi->dev;
int ret;
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/regulator/consumer.h`, `linux/of.h`, `video/mipi_display.h`, `drm/drm_mipi_dsi.h`.
- Detected declarations: `struct nt37700f_tianma`, `function nt37700f_tianma_reset`, `function nt37700f_tianma_on`, `function nt37700f_tianma_disable`, `function nt37700f_tianma_prepare`, `function nt37700f_tianma_unprepare`, `function nt37700f_tianma_get_modes`, `function nt37700f_tianma_bl_update_status`, `function nt37700f_tianma_bl_get_brightness`, `function nt37700f_tianma_create_backlight`.
- 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.