drivers/video/fbdev/omap/omapfb.h

Source file repositories/reference/linux-study-clean/drivers/video/fbdev/omap/omapfb.h

File Facts

System
Linux kernel
Corpus path
drivers/video/fbdev/omap/omapfb.h
Extension
.h
Size
6830 bytes
Lines
231
Domain
Driver Families
Bucket
drivers/video
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 omapfb_mem_region {
	u32		paddr;
	void __iomem	*vaddr;
	unsigned long	size;
	u8		type;		/* OMAPFB_PLANE_MEM_* */
	enum omapfb_color_format format;/* OMAPFB_COLOR_* */
	unsigned	format_used:1;	/* Must be set when format is set.
					 * Needed b/c of the badly chosen 0
					 * base for OMAPFB_COLOR_* values
					 */
	unsigned	alloc:1;	/* allocated by the driver */
	unsigned	map:1;		/* kernel mapped by the driver */
};

struct omapfb_mem_desc {
	int				region_cnt;
	struct omapfb_mem_region	region[OMAPFB_PLANE_NUM];
};

struct lcd_panel {
	const char	*name;
	int		config;		/* TFT/STN, signal inversion */
	int		bpp;		/* Pixel format in fb mem */
	int		data_lines;	/* Lines on LCD HW interface */

	int		x_res, y_res;
	int		pixel_clock;	/* In kHz */
	int		hsw;		/* Horizontal synchronization
					   pulse width */
	int		hfp;		/* Horizontal front porch */
	int		hbp;		/* Horizontal back porch */
	int		vsw;		/* Vertical synchronization
					   pulse width */
	int		vfp;		/* Vertical front porch */
	int		vbp;		/* Vertical back porch */
	int		acb;		/* ac-bias pin frequency */
	int		pcd;		/* pixel clock divider.
					   Obsolete use pixel_clock instead */

	int		(*init)		(struct lcd_panel *panel,
					 struct omapfb_device *fbdev);
	void		(*cleanup)	(struct lcd_panel *panel);
	int		(*enable)	(struct lcd_panel *panel);
	void		(*disable)	(struct lcd_panel *panel);
	unsigned long	(*get_caps)	(struct lcd_panel *panel);
	int		(*set_bklight_level)(struct lcd_panel *panel,
					     unsigned int level);
	unsigned int	(*get_bklight_level)(struct lcd_panel *panel);
	unsigned int	(*get_bklight_max)  (struct lcd_panel *panel);
	int		(*run_test)	(struct lcd_panel *panel, int test_num);
};

struct extif_timings {
	int cs_on_time;
	int cs_off_time;
	int we_on_time;
	int we_off_time;
	int re_on_time;
	int re_off_time;
	int we_cycle_time;
	int re_cycle_time;
	int cs_pulse_width;
	int access_time;

	int clk_div;

	u32 tim[5];		/* set by extif->convert_timings */

	int converted;
};

struct lcd_ctrl_extif {
	int  (*init)		(struct omapfb_device *fbdev);
	void (*cleanup)		(void);
	void (*get_clk_info)	(u32 *clk_period, u32 *max_clk_div);
	unsigned long (*get_max_tx_rate)(void);
	int  (*convert_timings)	(struct extif_timings *timings);
	void (*set_timings)	(const struct extif_timings *timings);
	void (*set_bits_per_cycle)(int bpc);
	void (*write_command)	(const void *buf, unsigned int len);
	void (*read_data)	(void *buf, unsigned int len);
	void (*write_data)	(const void *buf, unsigned int len);
	void (*transfer_area)	(int width, int height,
				 void (callback)(void *data), void *data);
	int  (*setup_tearsync)	(unsigned pin_cnt,
				 unsigned hs_pulse_time, unsigned vs_pulse_time,
				 int hs_pol_inv, int vs_pol_inv, int div);
	int  (*enable_tearsync) (int enable, unsigned line);

	unsigned long		max_transmit_size;

Annotation

Implementation Notes