drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panel/panel-samsung-s6e8aa0.c- Extension
.c- Size
- 29437 bytes
- Lines
- 1062
- 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/gpio/consumer.hlinux/module.hlinux/of.hlinux/regulator/consumer.hvideo/mipi_display.hvideo/of_videomode.hvideo/videomode.hdrm/drm_mipi_dsi.hdrm/drm_modes.hdrm/drm_panel.h
Detected Declarations
struct s6e8aa0_variantstruct s6e8aa0function s6e8aa0_clear_errorfunction s6e8aa0_dcs_writefunction s6e8aa0_dcs_readfunction s6e8aa0_apply_level_1_keyfunction s6e8aa0_panel_cond_set_v142function s6e8aa0_panel_cond_setfunction s6e8aa0_display_condition_setfunction s6e8aa0_etc_source_controlfunction s6e8aa0_etc_pentile_controlfunction s6e8aa0_etc_power_controlfunction s6e8aa0_etc_elvss_controlfunction s6e8aa0_elvss_nvm_set_v142function s6e8aa0_elvss_nvm_setfunction s6e8aa0_apply_level_2_keyfunction s6e8aa0_brightness_setfunction s6e8aa0_panel_initfunction s6e8aa0_set_maximum_return_packet_sizefunction s6e8aa0_read_mtp_idfunction s6e8aa0_set_sequencefunction s6e8aa0_power_onfunction s6e8aa0_power_offfunction s6e8aa0_disablefunction s6e8aa0_unpreparefunction s6e8aa0_preparefunction s6e8aa0_enablefunction s6e8aa0_get_modesfunction s6e8aa0_parse_dtfunction s6e8aa0_probefunction s6e8aa0_remove
Annotated Snippet
struct s6e8aa0_variant {
u8 version;
const s6e8aa0_gamma_table *gamma_tables;
};
struct s6e8aa0 {
struct device *dev;
struct drm_panel panel;
struct regulator_bulk_data supplies[2];
struct gpio_desc *reset_gpio;
u32 power_on_delay;
u32 reset_delay;
u32 init_delay;
bool flip_horizontal;
bool flip_vertical;
struct videomode vm;
u32 width_mm;
u32 height_mm;
u8 version;
u8 id;
const struct s6e8aa0_variant *variant;
int brightness;
/* This field is tested by functions directly accessing DSI bus before
* transfer, transfer is skipped if it is set. In case of transfer
* failure or unexpected response the field is set to error value.
* Such construct allows to eliminate many checks in higher level
* functions.
*/
int error;
};
static inline struct s6e8aa0 *panel_to_s6e8aa0(struct drm_panel *panel)
{
return container_of(panel, struct s6e8aa0, panel);
}
static int s6e8aa0_clear_error(struct s6e8aa0 *ctx)
{
int ret = ctx->error;
ctx->error = 0;
return ret;
}
static void s6e8aa0_dcs_write(struct s6e8aa0 *ctx, const void *data, size_t len)
{
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
ssize_t ret;
if (ctx->error < 0)
return;
ret = mipi_dsi_dcs_write_buffer(dsi, data, len);
if (ret < 0) {
dev_err(ctx->dev, "error %zd writing dcs seq: %*ph\n", ret,
(int)len, data);
ctx->error = ret;
}
}
static int s6e8aa0_dcs_read(struct s6e8aa0 *ctx, u8 cmd, void *data, size_t len)
{
struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
int ret;
if (ctx->error < 0)
return ctx->error;
ret = mipi_dsi_dcs_read(dsi, cmd, data, len);
if (ret < 0) {
dev_err(ctx->dev, "error %d reading dcs seq(%#x)\n", ret, cmd);
ctx->error = ret;
}
return ret;
}
#define s6e8aa0_dcs_write_seq(ctx, seq...) \
({\
const u8 d[] = { seq };\
BUILD_BUG_ON_MSG(ARRAY_SIZE(d) > 64, "DCS sequence too big for stack");\
s6e8aa0_dcs_write(ctx, d, ARRAY_SIZE(d));\
})
#define s6e8aa0_dcs_write_seq_static(ctx, seq...) \
({\
static const u8 d[] = { seq };\
Annotation
- Immediate include surface: `linux/delay.h`, `linux/gpio/consumer.h`, `linux/module.h`, `linux/of.h`, `linux/regulator/consumer.h`, `video/mipi_display.h`, `video/of_videomode.h`, `video/videomode.h`.
- Detected declarations: `struct s6e8aa0_variant`, `struct s6e8aa0`, `function s6e8aa0_clear_error`, `function s6e8aa0_dcs_write`, `function s6e8aa0_dcs_read`, `function s6e8aa0_apply_level_1_key`, `function s6e8aa0_panel_cond_set_v142`, `function s6e8aa0_panel_cond_set`, `function s6e8aa0_display_condition_set`, `function s6e8aa0_etc_source_control`.
- 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.