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.
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/interrupt.hlinux/slab.hlinux/mm.hlinux/fb.hlinux/delay.hlinux/init.hlinux/ioport.hlinux/cpufreq.hlinux/clk.hlinux/platform_device.hlinux/dma-mapping.hlinux/io.hlinux/lcd.hlinux/math64.hlinux/of.hlinux/bitfield.hlinux/regulator/consumer.hvideo/of_display_timing.hvideo/of_videomode.hvideo/videomode.h
Detected Declarations
struct imx_fb_videomodestruct imxfb_rgbstruct imxfb_infoenum imxfb_typeenum imxfb_panel_typefunction is_imx1_fbfunction chan_to_fieldfunction imxfb_setpaletteregfunction imxfb_setcolregfunction imxfb_check_varfunction imxfb_set_parfunction imxfb_enable_controllerfunction imxfb_disable_controllerfunction imxfb_blankfunction imxfb_activate_varfunction imxfb_init_fbinfofunction imxfb_of_read_modefunction imxfb_lcd_get_contrastfunction imxfb_lcd_set_contrastfunction imxfb_lcd_get_powerfunction imxfb_regulator_setfunction imxfb_lcd_set_powerfunction imxfb_setupfunction imxfb_probefunction imxfb_removefunction imxfb_suspendfunction imxfb_resume
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
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/interrupt.h`, `linux/slab.h`, `linux/mm.h`, `linux/fb.h`.
- Detected declarations: `struct imx_fb_videomode`, `struct imxfb_rgb`, `struct imxfb_info`, `enum imxfb_type`, `enum imxfb_panel_type`, `function is_imx1_fb`, `function chan_to_field`, `function imxfb_setpalettereg`, `function imxfb_setcolreg`, `function imxfb_check_var`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.