drivers/gpu/drm/panel/panel-synaptics-r63353.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-synaptics-r63353.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/panel/panel-synaptics-r63353.c
Extension
.c
Size
7899 bytes
Lines
332
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct r63353_instr {
	size_t len;
	const u8 *data;
};

static const struct r63353_instr sharp_ls068b3sx02_init[] = {
	R63353_INSTR(0x51, 0xff),
	R63353_INSTR(0x53, 0x0c),
	R63353_INSTR(0x55, 0x00),
	R63353_INSTR(0x84, 0x00),
	R63353_INSTR(0x29),
};

struct r63353_desc {
	const char *name;
	const struct r63353_instr *init;
	const size_t init_length;
	const struct drm_display_mode *mode;
	u32 width_mm;
	u32 height_mm;
};

struct r63353_panel {
	struct drm_panel base;
	struct mipi_dsi_device *dsi;

	struct gpio_desc *reset_gpio;
	struct regulator *dvdd;
	struct regulator *avdd;

	struct r63353_desc *pdata;
};

static inline struct r63353_panel *to_r63353_panel(struct drm_panel *panel)
{
	return container_of(panel, struct r63353_panel, base);
}

static int r63353_panel_power_on(struct r63353_panel *rpanel)
{
	struct mipi_dsi_device *dsi = rpanel->dsi;
	struct device *dev = &dsi->dev;
	int ret;

	ret = regulator_enable(rpanel->avdd);
	if (ret) {
		dev_err(dev, "Failed to enable avdd regulator (%d)\n", ret);
		return ret;
	}

	usleep_range(15000, 25000);

	ret = regulator_enable(rpanel->dvdd);
	if (ret) {
		dev_err(dev, "Failed to enable dvdd regulator (%d)\n", ret);
		regulator_disable(rpanel->avdd);
		return ret;
	}

	usleep_range(300000, 350000);
	gpiod_set_value(rpanel->reset_gpio, 1);
	usleep_range(15000, 25000);

	return 0;
}

static int r63353_panel_power_off(struct r63353_panel *rpanel)
{
	gpiod_set_value(rpanel->reset_gpio, 0);
	regulator_disable(rpanel->dvdd);
	regulator_disable(rpanel->avdd);

	return 0;
}

static int r63353_panel_activate(struct r63353_panel *rpanel)
{
	struct mipi_dsi_device *dsi = rpanel->dsi;
	struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
	int i;

	mipi_dsi_dcs_soft_reset_multi(&dsi_ctx);

	mipi_dsi_usleep_range(&dsi_ctx, 15000, 17000);

	mipi_dsi_dcs_enter_sleep_mode_multi(&dsi_ctx);

	for (i = 0; i < rpanel->pdata->init_length; i++) {
		const struct r63353_instr *instr = &rpanel->pdata->init[i];

Annotation

Implementation Notes