drivers/gpu/drm/solomon/ssd130x.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/solomon/ssd130x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/solomon/ssd130x.c- Extension
.c- Size
- 58627 bytes
- Lines
- 2039
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/backlight.hlinux/bitfield.hlinux/bits.hlinux/delay.hlinux/gpio/consumer.hlinux/property.hlinux/pwm.hlinux/regulator/consumer.hdrm/clients/drm_client_setup.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_crtc_helper.hdrm/drm_damage_helper.hdrm/drm_edid.hdrm/drm_fbdev_shmem.hdrm/drm_format_helper.hdrm/drm_framebuffer.hdrm/drm_gem_atomic_helper.hdrm/drm_gem_framebuffer_helper.hdrm/drm_gem_shmem_helper.hdrm/drm_managed.hdrm/drm_modes.hdrm/drm_rect.hdrm/drm_print.hdrm/drm_probe_helper.hssd130x.h
Detected Declarations
struct ssd130x_crtc_statestruct ssd130x_plane_statefunction datafunction commandfunction ssd130x_set_col_rangefunction ssd130x_set_page_rangefunction ssd130x_set_page_posfunction ssd130x_pwm_enablefunction ssd130x_resetfunction ssd130x_power_onfunction ssd130x_power_offfunction ssd130x_initfunction ssd132x_initfunction ssd133x_initfunction ssd130x_update_rectfunction ssd132x_update_rectfunction ssd133x_update_rectfunction ssd130x_clear_screenfunction ssd132x_clear_screenfunction ssd133x_clear_screenfunction ssd130x_fb_blit_rectfunction ssd132x_fb_blit_rectfunction ssd133x_fb_blit_rectfunction ssd130x_primary_plane_atomic_checkfunction ssd132x_primary_plane_atomic_checkfunction ssd133x_primary_plane_atomic_checkfunction ssd130x_primary_plane_atomic_updatefunction ssd132x_primary_plane_atomic_updatefunction ssd133x_primary_plane_atomic_updatefunction ssd130x_primary_plane_atomic_disablefunction ssd132x_primary_plane_atomic_disablefunction ssd133x_primary_plane_atomic_disablefunction ssd130x_primary_plane_resetfunction ssd130x_primary_plane_destroy_statefunction ssd130x_crtc_mode_validfunction ssd130x_crtc_atomic_checkfunction ssd132x_crtc_atomic_checkfunction ssd133x_crtc_atomic_checkfunction ssd130x_crtc_resetfunction ssd130x_crtc_destroy_statefunction ssd130x_encoder_atomic_enablefunction ssd132x_encoder_atomic_enablefunction ssd133x_encoder_atomic_enablefunction ssd130x_encoder_atomic_disablefunction ssd130x_connector_get_modesfunction ssd130x_update_blfunction ssd130x_parse_propertiesfunction ssd130x_init_modeset
Annotated Snippet
struct ssd130x_crtc_state {
struct drm_crtc_state base;
/* Buffer to store pixels in HW format and written to the panel */
u8 *data_array;
};
struct ssd130x_plane_state {
struct drm_shadow_plane_state base;
/* Intermediate buffer to convert pixels from XRGB8888 to HW format */
u8 *buffer;
};
static inline struct ssd130x_crtc_state *to_ssd130x_crtc_state(struct drm_crtc_state *state)
{
return container_of(state, struct ssd130x_crtc_state, base);
}
static inline struct ssd130x_plane_state *to_ssd130x_plane_state(struct drm_plane_state *state)
{
return container_of(state, struct ssd130x_plane_state, base.base);
}
static inline struct ssd130x_device *drm_to_ssd130x(struct drm_device *drm)
{
return container_of(drm, struct ssd130x_device, drm);
}
/*
* Helper to write data (SSD13XX_DATA) to the device.
*/
static int ssd130x_write_data(struct ssd130x_device *ssd130x, u8 *values, int count)
{
return regmap_bulk_write(ssd130x->regmap, SSD13XX_DATA, values, count);
}
/*
* Helper to write command (SSD13XX_COMMAND). The fist variadic argument
* is the command to write and the following are the command options.
*
* Note that the ssd13xx protocol requires each command and option to be
* written as a SSD13XX_COMMAND device register value. That is why a call
* to regmap_write(..., SSD13XX_COMMAND, ...) is done for each argument.
*/
static int ssd130x_write_cmd(struct ssd130x_device *ssd130x, int count,
/* u8 cmd, u8 option, ... */...)
{
va_list ap;
u8 value;
int ret;
va_start(ap, count);
do {
value = va_arg(ap, int);
ret = regmap_write(ssd130x->regmap, SSD13XX_COMMAND, value);
if (ret)
goto out_end;
} while (--count);
out_end:
va_end(ap);
return ret;
}
/* Set address range for horizontal/vertical addressing modes */
static int ssd130x_set_col_range(struct ssd130x_device *ssd130x,
u8 col_start, u8 cols)
{
u8 col_end = col_start + cols - 1;
int ret;
if (col_start == ssd130x->col_start && col_end == ssd130x->col_end)
return 0;
ret = ssd130x_write_cmd(ssd130x, 3, SSD130X_SET_COL_RANGE, col_start, col_end);
if (ret < 0)
return ret;
ssd130x->col_start = col_start;
ssd130x->col_end = col_end;
return 0;
}
static int ssd130x_set_page_range(struct ssd130x_device *ssd130x,
u8 page_start, u8 pages)
{
u8 page_end = page_start + pages - 1;
int ret;
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/bitfield.h`, `linux/bits.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/property.h`, `linux/pwm.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct ssd130x_crtc_state`, `struct ssd130x_plane_state`, `function data`, `function command`, `function ssd130x_set_col_range`, `function ssd130x_set_page_range`, `function ssd130x_set_page_pos`, `function ssd130x_pwm_enable`, `function ssd130x_reset`, `function ssd130x_power_on`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.