drivers/gpu/drm/panel/panel-himax-hx8279.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panel/panel-himax-hx8279.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/panel/panel-himax-hx8279.c
Extension
.c
Size
38495 bytes
Lines
1297
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 hx8279 {
	struct drm_panel panel;
	struct mipi_dsi_device *dsi[2];
	struct regulator_bulk_data vregs[2];
	struct gpio_desc *enable_gpio;
	struct gpio_desc *reset_gpio;
	const struct hx8279_panel_desc *desc;
	u8 last_page;
	bool skip_voltage_config;
	bool skip_goa_config;
	bool skip_goa_timing;
	bool skip_goa_even_timing;
	bool skip_mipi_timing;
};

struct hx8279_panel_mode {
	const struct drm_display_mode mode;
	u8 bpc;
	bool is_video_mode;
};

/**
 * struct hx8279_goa_mux - Gate driver On Array Muxer
 * @gout_l: Mux GOA signal to GOUT Left pin
 * @gout_r: Mux GOA signal to GOUT Right pin
 */
struct hx8279_goa_mux {
	u8 gout_l[20];
	u8 gout_r[20];
};

/**
 * struct hx8279_analog_gamma - Analog Gamma Adjustment
 * @pos: Positive gamma op's input voltage, adjusted by VGP(H/L)
 * @neg: Negative gamma op's input voltage, adjusted by VGN(H/L)
 *
 * Analog Gamma correction is performed with 17+17 reference voltages,
 * changed with resistor streams, and defined with 17 register values
 * for positive and 17 for negative.
 *
 * Each register holds resistance values, in 8.5ohms per unit, for the
 * following gamma levels:
 * 0, 8, 16, 28, 40, 56, 80, 128, 176, 200, 216, 228, 240, 248, 252, 255.
 */
struct hx8279_analog_gamma {
	u8 pos[17];
	u8 neg[17];
};

/**
 * struct hx8279_digital_gamma - Digital Gamma Adjustment
 * @r: Adjustment for red component
 * @g: Adjustment for green component
 * @b: Adjustment for blue component
 *
 * The layout of this structure follows the register layout to simplify
 * both the handling and the declaration of those values in the driver.
 * Gamma correction is internally done with a 24 segment piecewise
 * linear interpolation; those segments are defined with 24 ten bits
 * values of which:
 *   - The LOW eight bits for the first 24 registers start at the first
 *     register (at 0xb1) of the Digital Gamma Adjustment page;
 *   - The HIGH two bits for each of the 24 registers are contained
 *     in the last six registers;
 *   - The last six registers contain four groups of two-bits HI values
 *     for each of the first 24 registers, but in an inverted fashion,
 *     this means that the first two bits relate to the last register
 *     of a set of four.
 *
 * The 24 segments refer to the following gamma levels:
 * 0, 1, 3, 7, 11, 15, 23, 31, 47, 63, 95, 127, 128, 160,
 * 192, 208, 224, 232, 240, 244, 248, 252, 254, 255
 */
struct hx8279_digital_gamma {
	u8 r[HX8279_PG_DGAMMA_NUM_LO_BYTES + HX8279_PG_DGAMMA_NUM_HI_BYTES];
	u8 g[HX8279_PG_DGAMMA_NUM_LO_BYTES + HX8279_PG_DGAMMA_NUM_HI_BYTES];
	u8 b[HX8279_PG_DGAMMA_NUM_LO_BYTES + HX8279_PG_DGAMMA_NUM_HI_BYTES];
};

struct hx8279_panel_desc {
	const struct mipi_dsi_device_info dsi_info;
	const struct hx8279_panel_mode *mode_data;
	u8 num_lanes;
	u8 num_modes;

	/* Page 0 */
	unsigned int vgh_mv;
	unsigned int vgl_mv;
	unsigned int vgph_mv;
	unsigned int vgnh_mv;

Annotation

Implementation Notes