drivers/gpu/drm/msm/dsi/dsi_host.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/dsi/dsi_host.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/msm/dsi/dsi_host.c
Extension
.c
Size
72482 bytes
Lines
2705
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 msm_dsi_host {
	struct mipi_dsi_host base;

	struct platform_device *pdev;
	struct drm_device *dev;

	int id;

	void __iomem *ctrl_base;
	phys_addr_t ctrl_size;
	struct regulator_bulk_data *supplies;

	int num_bus_clks;
	struct clk_bulk_data bus_clks[DSI_BUS_CLK_MAX];

	struct clk *byte_clk;
	struct clk *esc_clk;
	struct clk *pixel_clk;
	struct clk *byte_intf_clk;

	/*
	 * Clocks which needs to be properly parented between DISPCC and DSI PHY
	 * PLL:
	 */
	struct clk *byte_src_clk;
	struct clk *pixel_src_clk;
	struct clk *dsi_pll_byte_clk;
	struct clk *dsi_pll_pixel_clk;

	unsigned long byte_clk_rate;
	unsigned long byte_intf_clk_rate;
	unsigned long pixel_clk_rate;
	unsigned long esc_clk_rate;

	/* DSI v2 specific clocks */
	struct clk *src_clk;

	unsigned long src_clk_rate;

	const struct msm_dsi_cfg_handler *cfg_hnd;

	struct completion dma_comp;
	struct completion video_comp;
	struct mutex dev_mutex;
	struct mutex cmd_mutex;
	spinlock_t intr_lock; /* Protect interrupt ctrl register */

	u32 err_work_state;
	struct work_struct err_work;
	struct workqueue_struct *workqueue;

	/* DSI 6G TX buffer*/
	struct drm_gem_object *tx_gem_obj;
	struct drm_gpuvm *vm;

	/* DSI v2 TX buffer */
	void *tx_buf;
	dma_addr_t tx_buf_paddr;

	int tx_size;

	u8 *rx_buf;

	struct regmap *sfpb;

	struct drm_display_mode *mode;
	struct drm_dsc_config *dsc;

	/* connected device info */
	unsigned int channel;
	unsigned int lanes;
	enum mipi_dsi_pixel_format format;
	unsigned long mode_flags;

	/* lane data parsed via DT */
	int dlane_swap;
	int num_data_lanes;

	/* from phy DT */
	bool cphy_mode;

	u32 dma_cmd_ctrl_restore;

	bool registered;
	bool power_on;
	bool enabled;
	int irq;
};

static inline u32 dsi_read(struct msm_dsi_host *msm_host, u32 reg)

Annotation

Implementation Notes