drivers/video/fbdev/omap/lcd_ams_delta.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/omap/lcd_ams_delta.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/omap/lcd_ams_delta.c- Extension
.c- Size
- 4111 bytes
- Lines
- 176
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/platform_device.hlinux/io.hlinux/delay.hlinux/gpio/consumer.hlinux/lcd.hlinux/soc/ti/omap1-io.homapfb.h
Detected Declarations
function ams_delta_lcd_set_powerfunction ams_delta_lcd_set_contrastfunction ams_delta_lcd_get_powerfunction ams_delta_lcd_get_contrastfunction ams_delta_panel_enablefunction ams_delta_panel_disablefunction ams_delta_panel_probe
Annotated Snippet
if (!(ams_delta_lcd & AMS_DELTA_LCD_POWER)) {
omap_writeb(ams_delta_lcd & AMS_DELTA_MAX_CONTRAST,
OMAP_PWL_ENABLE);
omap_writeb(1, OMAP_PWL_CLK_ENABLE);
ams_delta_lcd |= AMS_DELTA_LCD_POWER;
}
} else {
if (ams_delta_lcd & AMS_DELTA_LCD_POWER) {
omap_writeb(0, OMAP_PWL_ENABLE);
omap_writeb(0, OMAP_PWL_CLK_ENABLE);
ams_delta_lcd &= ~AMS_DELTA_LCD_POWER;
}
}
return 0;
}
static int ams_delta_lcd_set_contrast(struct lcd_device *dev, int value)
{
if ((value >= 0) && (value <= AMS_DELTA_MAX_CONTRAST)) {
omap_writeb(value, OMAP_PWL_ENABLE);
ams_delta_lcd &= ~AMS_DELTA_MAX_CONTRAST;
ams_delta_lcd |= value;
}
return 0;
}
#ifdef CONFIG_LCD_CLASS_DEVICE
static int ams_delta_lcd_get_power(struct lcd_device *dev)
{
if (ams_delta_lcd & AMS_DELTA_LCD_POWER)
return LCD_POWER_ON;
else
return LCD_POWER_OFF;
}
static int ams_delta_lcd_get_contrast(struct lcd_device *dev)
{
if (!(ams_delta_lcd & AMS_DELTA_LCD_POWER))
return 0;
return ams_delta_lcd & AMS_DELTA_MAX_CONTRAST;
}
static const struct lcd_ops ams_delta_lcd_ops = {
.get_power = ams_delta_lcd_get_power,
.set_power = ams_delta_lcd_set_power,
.get_contrast = ams_delta_lcd_get_contrast,
.set_contrast = ams_delta_lcd_set_contrast,
};
#endif
/* omapfb panel section */
static int ams_delta_panel_enable(struct lcd_panel *panel)
{
gpiod_set_value(gpiod_ndisp, 1);
gpiod_set_value(gpiod_vblen, 1);
return 0;
}
static void ams_delta_panel_disable(struct lcd_panel *panel)
{
gpiod_set_value(gpiod_vblen, 0);
gpiod_set_value(gpiod_ndisp, 0);
}
static struct lcd_panel ams_delta_panel = {
.name = "ams-delta",
.config = 0,
.bpp = 12,
.data_lines = 16,
.x_res = 480,
.y_res = 320,
.pixel_clock = 4687,
.hsw = 3,
.hfp = 1,
.hbp = 1,
.vsw = 1,
.vfp = 0,
.vbp = 0,
.pcd = 0,
.acb = 37,
.enable = ams_delta_panel_enable,
.disable = ams_delta_panel_disable,
};
Annotation
- Immediate include surface: `linux/module.h`, `linux/platform_device.h`, `linux/io.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/lcd.h`, `linux/soc/ti/omap1-io.h`, `omapfb.h`.
- Detected declarations: `function ams_delta_lcd_set_power`, `function ams_delta_lcd_set_contrast`, `function ams_delta_lcd_get_power`, `function ams_delta_lcd_get_contrast`, `function ams_delta_panel_enable`, `function ams_delta_panel_disable`, `function ams_delta_panel_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.