drivers/gpu/drm/panel/panel-samsung-s6e8aa5x01-ams561ra01.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-samsung-s6e8aa5x01-ams561ra01.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-samsung-s6e8aa5x01-ams561ra01.c- Extension
.c- Size
- 28890 bytes
- Lines
- 982
- 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/backlight.hlinux/gpio/consumer.hlinux/module.hlinux/of.hlinux/regulator/consumer.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.hdrm/drm_probe_helper.h
Detected Declarations
struct s6e8aa5x01_ams561ra01_ctxfunction s6e8aa5x01_ams561ra01_update_statusfunction s6e8aa5x01_ams561ra01_preparefunction s6e8aa5x01_ams561ra01_unpreparefunction s6e8aa5x01_ams561ra01_enablefunction s6e8aa5x01_ams561ra01_disablefunction s6e8aa5x01_ams561ra01_get_modesfunction s6e8aa5x01_ams561ra01_probefunction s6e8aa5x01_ams561ra01_remove
Annotated Snippet
struct s6e8aa5x01_ams561ra01_ctx {
struct drm_panel panel;
struct mipi_dsi_device *dsi;
struct backlight_device *bl;
struct gpio_desc *reset_gpio;
struct regulator_bulk_data *supplies;
u32 nr_supplies;
};
static const struct regulator_bulk_data s6e8aa5x01_ams561ra01_supplies[] = {
{ .supply = "vdd" },
{ .supply = "vci" },
};
static inline struct s6e8aa5x01_ams561ra01_ctx *to_ctx(struct drm_panel *panel)
{
return container_of(panel, struct s6e8aa5x01_ams561ra01_ctx, panel);
}
static int s6e8aa5x01_ams561ra01_update_status(struct backlight_device *bl)
{
struct s6e8aa5x01_ams561ra01_ctx *ctx = bl_get_data(bl);
struct mipi_dsi_multi_context dsi = { .dsi = ctx->dsi };
u16 lvl = backlight_get_brightness(bl);
if (!ctx->panel.enabled)
return 0;
mipi_dsi_dcs_write_seq_multi(&dsi, MCS_ACCESSPROT, 0x5a, 0x5a);
mipi_dsi_dcs_write_buffer_multi(&dsi,
s6e8aa5x01_ams561ra01_cmds[lvl].gamma,
GAMMA_CMD_LEN);
mipi_dsi_dcs_write_buffer_multi(&dsi,
s6e8aa5x01_ams561ra01_cmds[lvl].aid,
AID_CMD_LEN);
mipi_dsi_dcs_write_seq_multi(&dsi, MCS_GAMMAUPD, 0x03);
mipi_dsi_dcs_write_seq_multi(&dsi, MCS_ACCESSPROT, 0xa5, 0xa5);
return dsi.accum_err;
}
static int s6e8aa5x01_ams561ra01_prepare(struct drm_panel *panel)
{
struct s6e8aa5x01_ams561ra01_ctx *ctx = to_ctx(panel);
struct device *dev = &ctx->dsi->dev;
int ret;
ret = regulator_bulk_enable(ctx->nr_supplies, ctx->supplies);
if (ret < 0) {
dev_err(dev, "failed to enable regulators: %d\n", ret);
return ret;
}
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
usleep_range(5000, 6000);
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
usleep_range(5000, 6000);
gpiod_set_value_cansleep(ctx->reset_gpio, 0);
usleep_range(10000, 11000);
return 0;
}
static int s6e8aa5x01_ams561ra01_unprepare(struct drm_panel *panel)
{
struct s6e8aa5x01_ams561ra01_ctx *ctx = to_ctx(panel);
gpiod_set_value_cansleep(ctx->reset_gpio, 1);
usleep_range(5000, 6000);
regulator_bulk_disable(ctx->nr_supplies, ctx->supplies);
return 0;
}
static int s6e8aa5x01_ams561ra01_enable(struct drm_panel *panel)
{
struct s6e8aa5x01_ams561ra01_ctx *ctx = to_ctx(panel);
struct mipi_dsi_multi_context dsi = { .dsi = ctx->dsi };
mipi_dsi_dcs_exit_sleep_mode_multi(&dsi);
mipi_dsi_msleep(&dsi, 100);
mipi_dsi_dcs_write_seq_multi(&dsi, MCS_ACCESSPROT, 0x5a, 0x5a);
mipi_dsi_dcs_write_seq_multi(&dsi, MCS_PENTILE, 0xd8, 0xd8, 0x00);
mipi_dsi_dcs_write_seq_multi(&dsi, MCS_PCD, 0x5c);
mipi_dsi_dcs_write_seq_multi(&dsi, MCS_ERRFLAG, 0xed, 0xc7, 0x23, 0x67);
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `drm/drm_mipi_dsi.h`, `drm/drm_modes.h`, `drm/drm_panel.h`.
- Detected declarations: `struct s6e8aa5x01_ams561ra01_ctx`, `function s6e8aa5x01_ams561ra01_update_status`, `function s6e8aa5x01_ams561ra01_prepare`, `function s6e8aa5x01_ams561ra01_unprepare`, `function s6e8aa5x01_ams561ra01_enable`, `function s6e8aa5x01_ams561ra01_disable`, `function s6e8aa5x01_ams561ra01_get_modes`, `function s6e8aa5x01_ams561ra01_probe`, `function s6e8aa5x01_ams561ra01_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.