drivers/gpu/drm/solomon/ssd130x-i2c.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/solomon/ssd130x-i2c.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/solomon/ssd130x-i2c.c- Extension
.c- Size
- 2910 bytes
- Lines
- 127
- 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/i2c.hlinux/module.hssd130x.h
Detected Declarations
function ssd130x_i2c_probefunction ssd130x_i2c_removefunction ssd130x_i2c_shutdown
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* DRM driver for Solomon SSD13xx OLED displays (I2C bus)
*
* Copyright 2022 Red Hat Inc.
* Author: Javier Martinez Canillas <javierm@redhat.com>
*
* Based on drivers/video/fbdev/ssd1307fb.c
* Copyright 2012 Free Electrons
*/
#include <linux/i2c.h>
#include <linux/module.h>
#include "ssd130x.h"
#define DRIVER_NAME "ssd130x-i2c"
#define DRIVER_DESC "DRM driver for Solomon SSD13xx OLED displays (I2C)"
static const struct regmap_config ssd130x_i2c_regmap_config = {
.reg_bits = 8,
.val_bits = 8,
};
static int ssd130x_i2c_probe(struct i2c_client *client)
{
struct ssd130x_device *ssd130x;
struct regmap *regmap;
regmap = devm_regmap_init_i2c(client, &ssd130x_i2c_regmap_config);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
ssd130x = ssd130x_probe(&client->dev, regmap);
if (IS_ERR(ssd130x))
return PTR_ERR(ssd130x);
i2c_set_clientdata(client, ssd130x);
return 0;
}
static void ssd130x_i2c_remove(struct i2c_client *client)
{
struct ssd130x_device *ssd130x = i2c_get_clientdata(client);
ssd130x_remove(ssd130x);
}
static void ssd130x_i2c_shutdown(struct i2c_client *client)
{
struct ssd130x_device *ssd130x = i2c_get_clientdata(client);
ssd130x_shutdown(ssd130x);
}
static const struct of_device_id ssd130x_of_match[] = {
/* ssd130x family */
{
.compatible = "sinowealth,sh1106",
.data = &ssd130x_variants[SH1106_ID],
},
{
.compatible = "solomon,ssd1305",
.data = &ssd130x_variants[SSD1305_ID],
},
{
.compatible = "solomon,ssd1306",
.data = &ssd130x_variants[SSD1306_ID],
},
{
.compatible = "solomon,ssd1307",
.data = &ssd130x_variants[SSD1307_ID],
},
{
.compatible = "solomon,ssd1309",
.data = &ssd130x_variants[SSD1309_ID],
},
/* Deprecated but kept for backward compatibility */
{
.compatible = "solomon,ssd1305fb-i2c",
.data = &ssd130x_variants[SSD1305_ID],
},
{
.compatible = "solomon,ssd1306fb-i2c",
.data = &ssd130x_variants[SSD1306_ID],
},
{
.compatible = "solomon,ssd1307fb-i2c",
.data = &ssd130x_variants[SSD1307_ID],
},
Annotation
- Immediate include surface: `linux/i2c.h`, `linux/module.h`, `ssd130x.h`.
- Detected declarations: `function ssd130x_i2c_probe`, `function ssd130x_i2c_remove`, `function ssd130x_i2c_shutdown`.
- 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.