drivers/video/fbdev/atmel_lcdfb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/atmel_lcdfb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/atmel_lcdfb.c- Extension
.c- Size
- 36438 bytes
- Lines
- 1313
- 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/kernel.hlinux/platform_device.hlinux/dma-mapping.hlinux/interrupt.hlinux/clk.hlinux/fb.hlinux/init.hlinux/delay.hlinux/backlight.hlinux/gfp.hlinux/gpio/consumer.hlinux/module.hlinux/of.hvideo/of_videomode.hvideo/of_display_timing.hlinux/regulator/consumer.hvideo/videomode.hvideo/atmel_lcdc.h
Detected Declarations
struct atmel_lcdfb_configstruct atmel_lcdfb_infostruct atmel_lcdfb_power_ctrl_gpiofunction atmel_bl_update_statusfunction atmel_bl_get_brightnessfunction init_backlightfunction exit_backlightfunction init_backlightfunction exit_backlightfunction atmel_lcdfb_power_controlfunction compute_hozvalfunction atmel_lcdfb_stop_nowaitfunction atmel_lcdfb_stopfunction atmel_lcdfb_startfunction atmel_lcdfb_update_dmafunction atmel_lcdfb_free_video_memoryfunction atmel_lcdfb_probefunction atmel_lcdfb_check_varfunction atmel_lcdfb_resetfunction atmel_lcdfb_set_parfunction chan_to_fieldfunction atmel_lcdfb_setcolregfunction atmel_lcdfb_pan_displayfunction atmel_lcdfb_blankfunction atmel_lcdfb_interruptfunction taskfunction atmel_lcdfb_init_fbinfofunction atmel_lcdfb_start_clockfunction atmel_lcdfb_stop_clockfunction atmel_lcdfb_get_of_wiring_modesfunction atmel_lcdfb_power_control_gpiofunction atmel_lcdfb_of_initfunction atmel_lcdfb_probefunction atmel_lcdfb_removefunction atmel_lcdfb_suspendfunction atmel_lcdfb_resume
Annotated Snippet
struct atmel_lcdfb_config {
bool have_alt_pixclock;
bool have_hozval;
bool have_intensity_bit;
};
/* LCD Controller info data structure, stored in device platform_data */
struct atmel_lcdfb_info {
spinlock_t lock;
struct fb_info *info;
void __iomem *mmio;
int irq_base;
struct work_struct task;
unsigned int smem_len;
struct platform_device *pdev;
struct clk *bus_clk;
struct clk *lcdc_clk;
struct backlight_device *backlight;
u8 saved_lcdcon;
u32 pseudo_palette[16];
bool have_intensity_bit;
struct atmel_lcdfb_pdata pdata;
const struct atmel_lcdfb_config *config;
struct regulator *reg_lcd;
};
struct atmel_lcdfb_power_ctrl_gpio {
struct gpio_desc *gpiod;
struct list_head list;
};
#define lcdc_readl(sinfo, reg) __raw_readl((sinfo)->mmio+(reg))
#define lcdc_writel(sinfo, reg, val) __raw_writel((val), (sinfo)->mmio+(reg))
/* configurable parameters */
#define ATMEL_LCDC_CVAL_DEFAULT 0xc8
#define ATMEL_LCDC_DMA_BURST_LEN 8 /* words */
#define ATMEL_LCDC_FIFO_SIZE 512 /* words */
static struct atmel_lcdfb_config at91sam9261_config = {
.have_hozval = true,
.have_intensity_bit = true,
};
static struct atmel_lcdfb_config at91sam9263_config = {
.have_intensity_bit = true,
};
static struct atmel_lcdfb_config at91sam9g10_config = {
.have_hozval = true,
};
static struct atmel_lcdfb_config at91sam9g45_config = {
.have_alt_pixclock = true,
};
static struct atmel_lcdfb_config at91sam9g45es_config = {
};
static struct atmel_lcdfb_config at91sam9rl_config = {
.have_intensity_bit = true,
};
static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8
| ATMEL_LCDC_POL_POSITIVE
| ATMEL_LCDC_ENA_PWMENABLE;
#ifdef CONFIG_BACKLIGHT_ATMEL_LCDC
/* some bl->props field just changed */
static int atmel_bl_update_status(struct backlight_device *bl)
{
struct atmel_lcdfb_info *sinfo = bl_get_data(bl);
int brightness = backlight_get_brightness(bl);
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_VAL, brightness);
if (contrast_ctr & ATMEL_LCDC_POL_POSITIVE)
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR,
brightness ? contrast_ctr : 0);
else
lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, contrast_ctr);
return 0;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/platform_device.h`, `linux/dma-mapping.h`, `linux/interrupt.h`, `linux/clk.h`, `linux/fb.h`, `linux/init.h`, `linux/delay.h`.
- Detected declarations: `struct atmel_lcdfb_config`, `struct atmel_lcdfb_info`, `struct atmel_lcdfb_power_ctrl_gpio`, `function atmel_bl_update_status`, `function atmel_bl_get_brightness`, `function init_backlight`, `function exit_backlight`, `function init_backlight`, `function exit_backlight`, `function atmel_lcdfb_power_control`.
- 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.