drivers/video/fbdev/imxfb.c

Source file repositories/reference/linux-study-clean/drivers/video/fbdev/imxfb.c

File Facts

System
Linux kernel
Corpus path
drivers/video/fbdev/imxfb.c
Extension
.c
Size
26113 bytes
Lines
1107
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 imx_fb_videomode {
	struct fb_videomode mode;
	u32 pcr;
	bool aus_mode;
	unsigned char	bpp;
};

/*
 * Complain if VAR is out of range.
 */
#define DEBUG_VAR 1

#define DRIVER_NAME "imx-fb"

#define LCDC_SSA	0x00

#define LCDC_SIZE	0x04
#define SIZE_XMAX_MASK	GENMASK(25, 20)

#define YMAX_MASK_IMX1	GENMASK(8, 0)
#define YMAX_MASK_IMX21	GENMASK(9, 0)

#define LCDC_VPW	0x08
#define VPW_VPW_MASK	GENMASK(9, 0)

#define LCDC_CPOS	0x0C
#define CPOS_CC1	BIT(31)
#define CPOS_CC0	BIT(30)
#define CPOS_OP		BIT(28)
#define CPOS_CXP_MASK	GENMASK(25, 16)

#define LCDC_LCWHB	0x10
#define LCWHB_BK_EN	BIT(31)
#define LCWHB_CW_MASK	GENMASK(28, 24)
#define LCWHB_CH_MASK	GENMASK(20, 16)
#define LCWHB_BD_MASK	GENMASK(7, 0)

#define LCDC_LCHCC	0x14

#define LCDC_PCR	0x18
#define PCR_TFT		BIT(31)
#define PCR_COLOR	BIT(30)
#define PCR_BPIX_MASK	GENMASK(27, 25)
#define PCR_BPIX_8	3
#define PCR_BPIX_12	4
#define PCR_BPIX_16	5
#define PCR_BPIX_18	6
#define PCR_PCD_MASK	GENMASK(5, 0)

#define LCDC_HCR	0x1C
#define HCR_H_WIDTH_MASK	GENMASK(31, 26)
#define HCR_H_WAIT_1_MASK	GENMASK(15, 8)
#define HCR_H_WAIT_2_MASK	GENMASK(7, 0)

#define LCDC_VCR	0x20
#define VCR_V_WIDTH_MASK	GENMASK(31, 26)
#define VCR_V_WAIT_1_MASK	GENMASK(15, 8)
#define VCR_V_WAIT_2_MASK	GENMASK(7, 0)

#define LCDC_POS	0x24
#define POS_POS_MASK	GENMASK(4, 0)

#define LCDC_LSCR1	0x28
/* bit fields in imxfb.h */

#define LCDC_PWMR	0x2C
/* bit fields in imxfb.h */

#define LCDC_DMACR	0x30
/* bit fields in imxfb.h */

#define LCDC_RMCR	0x34

#define RMCR_LCDC_EN_MX1	BIT(1)

#define RMCR_SELF_REF	BIT(0)

#define LCDC_LCDICR	0x38
#define LCDICR_INT_SYN	BIT(2)
#define LCDICR_INT_CON	BIT(0)

#define LCDC_LCDISR	0x40
#define LCDISR_UDR_ERR	BIT(3)
#define LCDISR_ERR_RES	BIT(2)
#define LCDISR_EOF	BIT(1)
#define LCDISR_BOF	BIT(0)

#define IMXFB_LSCR1_DEFAULT 0x00120300

#define LCDC_LAUSCR	0x80

Annotation

Implementation Notes