drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/omap2/omapfb/displays/panel-tpo-td043mtea1.c- Extension
.c- Size
- 14199 bytes
- Lines
- 612
- 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/delay.hlinux/spi/spi.hlinux/regulator/consumer.hlinux/gpio/consumer.hlinux/err.hlinux/slab.hvideo/omapfb_dss.h
Detected Declarations
struct panel_drv_datafunction tpo_td043_writefunction tpo_td043_write_gammafunction tpo_td043_write_mirrorfunction tpo_td043_set_hmirrorfunction tpo_td043_get_hmirrorfunction tpo_td043_vmirror_showfunction tpo_td043_vmirror_storefunction tpo_td043_mode_showfunction tpo_td043_mode_storefunction tpo_td043_gamma_showfunction tpo_td043_gamma_storefunction tpo_td043_power_onfunction tpo_td043_power_offfunction tpo_td043_connectfunction tpo_td043_disconnectfunction tpo_td043_enablefunction tpo_td043_disablefunction tpo_td043_set_timingsfunction tpo_td043_get_timingsfunction tpo_td043_check_timingsfunction tpo_td043_probefunction tpo_td043_removefunction tpo_td043_spi_suspendfunction tpo_td043_spi_resume
Annotated Snippet
struct panel_drv_data {
struct omap_dss_device dssdev;
struct omap_dss_device *in;
struct omap_video_timings videomode;
int data_lines;
struct spi_device *spi;
struct regulator *vcc_reg;
struct gpio_desc *reset_gpio;
u16 gamma[12];
u32 mode;
u32 hmirror:1;
u32 vmirror:1;
u32 powered_on:1;
u32 spi_suspended:1;
u32 power_on_resume:1;
};
static const struct omap_video_timings tpo_td043_timings = {
.x_res = 800,
.y_res = 480,
.pixelclock = 36000000,
.hsw = 1,
.hfp = 68,
.hbp = 214,
.vsw = 1,
.vfp = 39,
.vbp = 34,
.vsync_level = OMAPDSS_SIG_ACTIVE_LOW,
.hsync_level = OMAPDSS_SIG_ACTIVE_LOW,
.data_pclk_edge = OMAPDSS_DRIVE_SIG_FALLING_EDGE,
.de_level = OMAPDSS_SIG_ACTIVE_HIGH,
.sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE,
};
#define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)
static int tpo_td043_write(struct spi_device *spi, u8 addr, u8 data)
{
struct spi_message m;
struct spi_transfer xfer;
u16 w;
int r;
spi_message_init(&m);
memset(&xfer, 0, sizeof(xfer));
w = ((u16)addr << 10) | (1 << 8) | data;
xfer.tx_buf = &w;
xfer.bits_per_word = 16;
xfer.len = 2;
spi_message_add_tail(&xfer, &m);
r = spi_sync(spi, &m);
if (r < 0)
dev_warn(&spi->dev, "failed to write to LCD reg (%d)\n", r);
return r;
}
static void tpo_td043_write_gamma(struct spi_device *spi, u16 gamma[12])
{
u8 i, val;
/* gamma bits [9:8] */
for (val = i = 0; i < 4; i++)
val |= (gamma[i] & 0x300) >> ((i + 1) * 2);
tpo_td043_write(spi, 0x11, val);
for (val = i = 0; i < 4; i++)
val |= (gamma[i+4] & 0x300) >> ((i + 1) * 2);
tpo_td043_write(spi, 0x12, val);
for (val = i = 0; i < 4; i++)
val |= (gamma[i+8] & 0x300) >> ((i + 1) * 2);
tpo_td043_write(spi, 0x13, val);
/* gamma bits [7:0] */
for (val = i = 0; i < 12; i++)
tpo_td043_write(spi, 0x14 + i, gamma[i] & 0xff);
}
static int tpo_td043_write_mirror(struct spi_device *spi, bool h, bool v)
{
Annotation
- Immediate include surface: `linux/module.h`, `linux/delay.h`, `linux/spi/spi.h`, `linux/regulator/consumer.h`, `linux/gpio/consumer.h`, `linux/err.h`, `linux/slab.h`, `video/omapfb_dss.h`.
- Detected declarations: `struct panel_drv_data`, `function tpo_td043_write`, `function tpo_td043_write_gamma`, `function tpo_td043_write_mirror`, `function tpo_td043_set_hmirror`, `function tpo_td043_get_hmirror`, `function tpo_td043_vmirror_show`, `function tpo_td043_vmirror_store`, `function tpo_td043_mode_show`, `function tpo_td043_mode_store`.
- 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.