drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/mmp/panel/tpo_tj032md01bw.c- Extension
.c- Size
- 3266 bytes
- Lines
- 173
- Domain
- Driver Families
- Bucket
- drivers/video
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/moduleparam.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/delay.hlinux/platform_device.hlinux/err.hlinux/spi/spi.hvideo/mmp_disp.h
Detected Declarations
struct tpohvga_plat_datafunction tpohvga_onofffunction tpohvga_get_modelistfunction tpohvga_probe
Annotated Snippet
struct tpohvga_plat_data {
void (*plat_onoff)(int status);
struct spi_device *spi;
};
static void tpohvga_onoff(struct mmp_panel *panel, int status)
{
struct tpohvga_plat_data *plat = panel->plat_data;
int ret;
if (status) {
plat->plat_onoff(1);
ret = spi_write(plat->spi, init, sizeof(init));
if (ret < 0)
dev_warn(panel->dev, "init cmd failed(%d)\n", ret);
} else {
ret = spi_write(plat->spi, poweroff, sizeof(poweroff));
if (ret < 0)
dev_warn(panel->dev, "poweroff cmd failed(%d)\n", ret);
plat->plat_onoff(0);
}
}
static struct mmp_mode mmp_modes_tpohvga[] = {
[0] = {
.pixclock_freq = 10394400,
.refresh = 60,
.xres = 320,
.yres = 480,
.hsync_len = 10,
.left_margin = 15,
.right_margin = 10,
.vsync_len = 2,
.upper_margin = 4,
.lower_margin = 2,
.invert_pixclock = 1,
.pix_fmt_out = PIXFMT_RGB565,
},
};
static int tpohvga_get_modelist(struct mmp_panel *panel,
struct mmp_mode **modelist)
{
*modelist = mmp_modes_tpohvga;
return 1;
}
static struct mmp_panel panel_tpohvga = {
.name = "tpohvga",
.panel_type = PANELTYPE_ACTIVE,
.get_modelist = tpohvga_get_modelist,
.set_onoff = tpohvga_onoff,
};
static int tpohvga_probe(struct spi_device *spi)
{
struct mmp_mach_panel_info *mi;
int ret;
struct tpohvga_plat_data *plat_data;
/* get configs from platform data */
mi = spi->dev.platform_data;
if (mi == NULL) {
dev_err(&spi->dev, "%s: no platform data defined\n", __func__);
return -EINVAL;
}
/* setup spi related info */
spi->bits_per_word = 16;
ret = spi_setup(spi);
if (ret < 0) {
dev_err(&spi->dev, "spi setup failed %d", ret);
return ret;
}
plat_data = kzalloc_obj(*plat_data);
if (plat_data == NULL)
return -ENOMEM;
plat_data->spi = spi;
plat_data->plat_onoff = mi->plat_set_onoff;
panel_tpohvga.plat_data = plat_data;
panel_tpohvga.plat_path_name = mi->plat_path_name;
panel_tpohvga.dev = &spi->dev;
mmp_register_panel(&panel_tpohvga);
return 0;
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/delay.h`, `linux/platform_device.h`, `linux/err.h`.
- Detected declarations: `struct tpohvga_plat_data`, `function tpohvga_onoff`, `function tpohvga_get_modelist`, `function tpohvga_probe`.
- Atlas domain: Driver Families / drivers/video.
- 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.