drivers/gpu/drm/panel/panel-abt-y030xx067a.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-abt-y030xx067a.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-abt-y030xx067a.c- Extension
.c- Size
- 9995 bytes
- Lines
- 384
- 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/delay.hlinux/device.hlinux/gpio/consumer.hlinux/media-bus-format.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/regmap.hlinux/regulator/consumer.hlinux/spi/spi.hdrm/drm_modes.hdrm/drm_panel.h
Detected Declarations
struct y030xx067a_infostruct y030xx067afunction y030xx067a_preparefunction y030xx067a_unpreparefunction y030xx067a_enablefunction y030xx067a_disablefunction y030xx067a_get_modesfunction y030xx067a_probefunction y030xx067a_remove
Annotated Snippet
struct y030xx067a_info {
const struct drm_display_mode *display_modes;
unsigned int num_modes;
u16 width_mm, height_mm;
u32 bus_format, bus_flags;
};
struct y030xx067a {
struct drm_panel panel;
struct spi_device *spi;
struct regmap *map;
const struct y030xx067a_info *panel_info;
struct regulator *supply;
struct gpio_desc *reset_gpio;
};
static inline struct y030xx067a *to_y030xx067a(struct drm_panel *panel)
{
return container_of(panel, struct y030xx067a, panel);
}
static const struct reg_sequence y030xx067a_init_sequence[] = {
{ 0x00, REG00_VBRT_CTRL(0x7f) },
{ 0x01, REG01_COM_DC(0x3c) },
{ 0x02, REG02_VESA_SEL(0x3) | REG02_DA_CONTRAST(0x1f) },
{ 0x03, REG03_VPOSITION(0x0a) },
{ 0x04, REG04_HPOSITION1(0xd2) },
{ 0x05, REG05_CLIP | REG05_NVM_VREFRESH | REG05_SLBRCHARGE(0x2) },
{ 0x06, REG06_NT },
{ 0x07, 0 },
{ 0x08, REG08_PANEL(0x1) | REG08_CLOCK_DIV(0x2) },
{ 0x09, REG09_SUB_BRIGHT_R(0x20) },
{ 0x0a, REG0A_SUB_BRIGHT_B(0x20) },
{ 0x0b, REG0B_HD_FREERUN | REG0B_VD_FREERUN },
{ 0x0c, REG0C_CONTRAST_R(0x00) },
{ 0x0d, REG0D_CONTRAST_G(0x00) },
{ 0x0e, REG0E_CONTRAST_B(0x10) },
{ 0x0f, 0 },
{ 0x10, REG10_BRIGHT(0x7f) },
{ 0x11, REG11_SIGC_CNTL | REG11_SIG_GAIN(0x3f) },
{ 0x12, REG12_COLOR(0x20) | REG12_PWCKSEL(0x1) },
{ 0x13, REG13_4096LEVEL_CNTL(0x8) },
{ 0x14, 0 },
{ 0x15, 0 },
};
static int y030xx067a_prepare(struct drm_panel *panel)
{
struct y030xx067a *priv = to_y030xx067a(panel);
struct device *dev = &priv->spi->dev;
int err;
err = regulator_enable(priv->supply);
if (err) {
dev_err(dev, "Failed to enable power supply: %d\n", err);
return err;
}
/* Reset the chip */
gpiod_set_value_cansleep(priv->reset_gpio, 1);
usleep_range(1000, 20000);
gpiod_set_value_cansleep(priv->reset_gpio, 0);
usleep_range(1000, 20000);
err = regmap_multi_reg_write(priv->map, y030xx067a_init_sequence,
ARRAY_SIZE(y030xx067a_init_sequence));
if (err) {
dev_err(dev, "Failed to init registers: %d\n", err);
goto err_disable_regulator;
}
return 0;
err_disable_regulator:
regulator_disable(priv->supply);
return err;
}
static int y030xx067a_unprepare(struct drm_panel *panel)
{
struct y030xx067a *priv = to_y030xx067a(panel);
gpiod_set_value_cansleep(priv->reset_gpio, 1);
regulator_disable(priv->supply);
return 0;
}
Annotation
- Immediate include surface: `linux/delay.h`, `linux/device.h`, `linux/gpio/consumer.h`, `linux/media-bus-format.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/regmap.h`.
- Detected declarations: `struct y030xx067a_info`, `struct y030xx067a`, `function y030xx067a_prepare`, `function y030xx067a_unprepare`, `function y030xx067a_enable`, `function y030xx067a_disable`, `function y030xx067a_get_modes`, `function y030xx067a_probe`, `function y030xx067a_remove`.
- 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.