drivers/gpu/drm/panel/panel-orisetech-ota5601a.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-orisetech-ota5601a.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/panel/panel-orisetech-ota5601a.c
Extension
.c
Size
8637 bytes
Lines
361
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 ota5601a_panel_info {
	const struct drm_display_mode *display_modes;
	unsigned int num_modes;
	u16 width_mm, height_mm;
	u32 bus_format, bus_flags;
};

struct ota5601a {
	struct drm_panel drm_panel;
	struct regmap *map;
	struct regulator *supply;
	const struct ota5601a_panel_info *panel_info;

	struct gpio_desc *reset_gpio;
};

static inline struct ota5601a *to_ota5601a(struct drm_panel *panel)
{
	return container_of(panel, struct ota5601a, drm_panel);
}

static const struct reg_sequence ota5601a_panel_regs[] = {
	{ 0xfd, 0x00 }, /* Page Shift */
	{ 0x02, 0x00 }, /* Reset */

	{ 0x18, 0x00 }, /* Interface Sel: RGB 24 Bits */
	{ 0x34, 0x20 }, /* Undocumented */

	{ 0x0c, 0x01 }, /* Contrast set by CMD1 == within page 0x00 */
	{ 0x0d, 0x48 }, /* R Brightness */
	{ 0x0e, 0x48 }, /* G Brightness */
	{ 0x0f, 0x48 }, /* B Brightness */
	{ 0x07, 0x40 }, /* R Contrast */
	{ 0x08, 0x33 }, /* G Contrast */
	{ 0x09, 0x3a }, /* B Contrast */

	{ 0x16, 0x01 }, /* NTSC Sel */
	{ 0x19, 0x8d }, /* VBLK */
	{ 0x1a, 0x28 }, /* HBLK */
	{ 0x1c, 0x00 }, /* Scan Shift Dir. */

	{ 0xfd, 0xc5 }, /* Page Shift */
	{ 0x82, 0x0c }, /* PWR_CTRL Pump */
	{ 0xa2, 0xb4 }, /* PWR_CTRL VGH/VGL */

	{ 0xfd, 0xc4 }, /* Page Shift - What follows is listed as "RGB 24bit Timing Set" */
	{ 0x82, 0x45 },

	{ 0xfd, 0xc1 },
	{ 0x91, 0x02 },

	{ 0xfd, 0xc0 },
	{ 0xa1, 0x01 },
	{ 0xa2, 0x1f },
	{ 0xa3, 0x0b },
	{ 0xa4, 0x38 },
	{ 0xa5, 0x00 },
	{ 0xa6, 0x0a },
	{ 0xa7, 0x38 },
	{ 0xa8, 0x00 },
	{ 0xa9, 0x0a },
	{ 0xaa, 0x37 },

	{ 0xfd, 0xce },
	{ 0x81, 0x18 },
	{ 0x82, 0x43 },
	{ 0x83, 0x43 },
	{ 0x91, 0x06 },
	{ 0x93, 0x38 },
	{ 0x94, 0x02 },
	{ 0x95, 0x06 },
	{ 0x97, 0x38 },
	{ 0x98, 0x02 },
	{ 0x99, 0x06 },
	{ 0x9b, 0x38 },
	{ 0x9c, 0x02 },

	{ 0xfd, 0x00 }, /* Page Shift */
};

static const struct regmap_config ota5601a_regmap_config = {
	.reg_bits = 8,
	.val_bits = 8,
};

static int ota5601a_prepare(struct drm_panel *drm_panel)
{
	struct ota5601a *panel = to_ota5601a(drm_panel);
	int err;

Annotation

Implementation Notes