drivers/video/backlight/otm3225a.c
Source file repositories/reference/linux-study-clean/drivers/video/backlight/otm3225a.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/backlight/otm3225a.c- Extension
.c- Size
- 7152 bytes
- Lines
- 252
- 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/delay.hlinux/device.hlinux/kernel.hlinux/lcd.hlinux/module.hlinux/spi/spi.h
Detected Declarations
struct otm3225a_datastruct otm3225a_spi_instructionfunction otm3225a_writefunction otm3225a_set_powerfunction otm3225a_get_powerfunction otm3225a_probe
Annotated Snippet
struct otm3225a_data {
struct spi_device *spi;
struct lcd_device *ld;
int power;
};
struct otm3225a_spi_instruction {
unsigned char reg; /* register to write */
unsigned short value; /* data to write to 'reg' */
unsigned short delay; /* delay in ms after write */
};
static struct otm3225a_spi_instruction display_init[] = {
{ DRIVER_OUTPUT_CTRL_1, 0x0000, 0 },
{ DRIVER_WAVEFORM_CTRL, 0x0700, 0 },
{ ENTRY_MODE, 0x50A0, 0 },
{ SCALING_CTRL, 0x0000, 0 },
{ DISPLAY_CTRL_2, 0x0606, 0 },
{ DISPLAY_CTRL_3, 0x0000, 0 },
{ FRAME_CYCLE_CTRL, 0x0000, 0 },
{ EXT_DISP_IFACE_CTRL_1, 0x0000, 0 },
{ FRAME_MAKER_POS, 0x0000, 0 },
{ EXT_DISP_IFACE_CTRL_2, 0x0002, 0 },
{ POWER_CTRL_2, 0x0007, 0 },
{ POWER_CTRL_3, 0x0000, 0 },
{ POWER_CTRL_4, 0x0000, 200 },
{ DISPLAY_CTRL_1, 0x0101, 0 },
{ POWER_CTRL_1, 0x12B0, 0 },
{ POWER_CTRL_2, 0x0007, 0 },
{ POWER_CTRL_3, 0x01BB, 50 },
{ POWER_CTRL_4, 0x0013, 0 },
{ POWER_CTRL_7, 0x0010, 50 },
{ GAMMA_CTRL_1, 0x000A, 0 },
{ GAMMA_CTRL_2, 0x1326, 0 },
{ GAMMA_CTRL_3, 0x0A29, 0 },
{ GAMMA_CTRL_4, 0x0A0A, 0 },
{ GAMMA_CTRL_5, 0x1E03, 0 },
{ GAMMA_CTRL_6, 0x031E, 0 },
{ GAMMA_CTRL_7, 0x0706, 0 },
{ GAMMA_CTRL_8, 0x0303, 0 },
{ GAMMA_CTRL_9, 0x010E, 0 },
{ GAMMA_CTRL_10, 0x040E, 0 },
{ WINDOW_HORIZ_RAM_START, 0x0000, 0 },
{ WINDOW_HORIZ_RAM_END, 0x00EF, 0 },
{ WINDOW_VERT_RAM_START, 0x0000, 0 },
{ WINDOW_VERT_RAM_END, 0x013F, 0 },
{ DRIVER_OUTPUT_CTRL_2, 0x2700, 0 },
{ BASE_IMG_DISPLAY_CTRL, 0x0001, 0 },
{ VERT_SCROLL_CTRL, 0x0000, 0 },
{ PD1_DISPLAY_POS, 0x0000, 0 },
{ PD1_RAM_START, 0x0000, 0 },
{ PD1_RAM_END, 0x0000, 0 },
{ PD2_DISPLAY_POS, 0x0000, 0 },
{ PD2_RAM_START, 0x0000, 0 },
{ PD2_RAM_END, 0x0000, 0 },
{ PANEL_IFACE_CTRL_1, 0x0010, 0 },
{ PANEL_IFACE_CTRL_2, 0x0000, 0 },
{ PANEL_IFACE_CTRL_4, 0x0210, 0 },
{ PANEL_IFACE_CTRL_5, 0x0000, 0 },
{ DISPLAY_CTRL_1, 0x0133, 0 },
};
static struct otm3225a_spi_instruction display_enable_rgb_interface[] = {
{ ENTRY_MODE, 0x1080, 0 },
{ GRAM_ADDR_HORIZ_SET, 0x0000, 0 },
{ GRAM_ADDR_VERT_SET, 0x0000, 0 },
{ EXT_DISP_IFACE_CTRL_1, 0x0111, 500 },
};
static struct otm3225a_spi_instruction display_off[] = {
{ DISPLAY_CTRL_1, 0x0131, 100 },
{ DISPLAY_CTRL_1, 0x0130, 100 },
{ DISPLAY_CTRL_1, 0x0100, 0 },
{ POWER_CTRL_1, 0x0280, 0 },
{ POWER_CTRL_3, 0x018B, 0 },
};
static struct otm3225a_spi_instruction display_on[] = {
{ POWER_CTRL_1, 0x1280, 0 },
{ DISPLAY_CTRL_1, 0x0101, 100 },
{ DISPLAY_CTRL_1, 0x0121, 0 },
{ DISPLAY_CTRL_1, 0x0123, 100 },
{ DISPLAY_CTRL_1, 0x0133, 10 },
};
static void otm3225a_write(struct spi_device *spi,
struct otm3225a_spi_instruction *instruction,
unsigned int count)
{
unsigned char buf[3];
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/kernel.h`, `linux/lcd.h`, `linux/module.h`, `linux/spi/spi.h`.
- Detected declarations: `struct otm3225a_data`, `struct otm3225a_spi_instruction`, `function otm3225a_write`, `function otm3225a_set_power`, `function otm3225a_get_power`, `function otm3225a_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.