drivers/video/fbdev/sh_mobile_lcdcfb.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/sh_mobile_lcdcfb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/sh_mobile_lcdcfb.c- Extension
.c- Size
- 66980 bytes
- Lines
- 2652
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/atomic.hlinux/backlight.hlinux/clk.hlinux/console.hlinux/ctype.hlinux/dma-mapping.hlinux/delay.hlinux/init.hlinux/interrupt.hlinux/ioctl.hlinux/kernel.hlinux/mm.hlinux/module.hlinux/platform_device.hlinux/pm_runtime.hlinux/slab.hlinux/videodev2.hlinux/vmalloc.hvideo/sh_mobile_lcdc.hsh_mobile_lcdcfb.h
Detected Declarations
struct sh_mobile_lcdc_overlaystruct sh_mobile_lcdc_privstruct sh_mobile_lcdc_format_infoenum sh_mobile_lcdc_overlay_modefunction bankedfunction lcdc_chan_is_sublcdfunction lcdc_write_chanfunction lcdc_write_chan_mirrorfunction lcdc_read_chanfunction lcdc_write_overlayfunction lcdc_writefunction lcdc_readfunction lcdc_wait_bitfunction sh_mobile_lcdc_clk_onfunction sh_mobile_lcdc_clk_offfunction sh_mobile_lcdc_setup_clocksfunction lcdc_sys_write_indexfunction lcdc_sys_write_datafunction lcdc_sys_read_datafunction sh_mobile_lcdc_sginitfunction list_for_each_entryfunction sh_mobile_lcdc_deferred_iofunction sh_mobile_lcdc_deferred_io_touchfunction sh_mobile_lcdc_deferred_io_touchfunction sh_mobile_lcdc_display_onfunction sh_mobile_lcdc_display_offfunction sh_mobile_format_infofunction sh_mobile_format_fourccfunction sh_mobile_format_is_fourccfunction sh_mobile_lcdc_irqfunction sh_mobile_lcdc_wait_for_vsyncfunction sh_mobile_lcdc_start_stopfunction sh_mobile_lcdc_geometryfunction sh_mobile_lcdc_overlay_setupfunction devicesfunction sh_mobile_lcdc_startfunction sh_mobile_lcdc_stopfunction __sh_mobile_lcdc_check_varfunction overlay_alpha_showfunction overlay_alpha_storefunction overlay_mode_showfunction overlay_mode_storefunction overlay_position_showfunction overlay_position_storefunction overlay_rop3_showfunction overlay_rop3_storefunction sh_mobile_lcdc_overlay_panfunction sh_mobile_lcdc_overlay_ioctl
Annotated Snippet
struct sh_mobile_lcdc_overlay {
struct sh_mobile_lcdc_chan *channel;
const struct sh_mobile_lcdc_overlay_cfg *cfg;
struct fb_info *info;
unsigned int index;
unsigned long base;
bool enabled;
enum sh_mobile_lcdc_overlay_mode mode;
unsigned int alpha;
unsigned int rop3;
void *fb_mem;
unsigned long fb_size;
dma_addr_t dma_handle;
unsigned long base_addr_y;
unsigned long base_addr_c;
unsigned long pan_y_offset;
const struct sh_mobile_lcdc_format_info *format;
unsigned int xres;
unsigned int xres_virtual;
unsigned int yres;
unsigned int yres_virtual;
unsigned int pitch;
int pos_x;
int pos_y;
};
struct sh_mobile_lcdc_priv {
void __iomem *base;
int irq;
atomic_t hw_usecnt;
struct device *dev;
struct clk *dot_clk;
unsigned long lddckr;
struct sh_mobile_lcdc_chan ch[2];
struct sh_mobile_lcdc_overlay overlays[4];
int started;
int forced_fourcc; /* 2 channel LCDC must share fourcc setting */
};
/* -----------------------------------------------------------------------------
* Registers access
*/
static unsigned long lcdc_offs_mainlcd[NR_CH_REGS] = {
[LDDCKPAT1R] = 0x400,
[LDDCKPAT2R] = 0x404,
[LDMT1R] = 0x418,
[LDMT2R] = 0x41c,
[LDMT3R] = 0x420,
[LDDFR] = 0x424,
[LDSM1R] = 0x428,
[LDSM2R] = 0x42c,
[LDSA1R] = 0x430,
[LDSA2R] = 0x434,
[LDMLSR] = 0x438,
[LDHCNR] = 0x448,
[LDHSYNR] = 0x44c,
[LDVLNR] = 0x450,
[LDVSYNR] = 0x454,
[LDPMR] = 0x460,
[LDHAJR] = 0x4a0,
};
static unsigned long lcdc_offs_sublcd[NR_CH_REGS] = {
[LDDCKPAT1R] = 0x408,
[LDDCKPAT2R] = 0x40c,
[LDMT1R] = 0x600,
[LDMT2R] = 0x604,
[LDMT3R] = 0x608,
[LDDFR] = 0x60c,
[LDSM1R] = 0x610,
[LDSM2R] = 0x614,
[LDSA1R] = 0x618,
[LDMLSR] = 0x620,
[LDHCNR] = 0x624,
[LDHSYNR] = 0x628,
[LDVLNR] = 0x62c,
[LDVSYNR] = 0x630,
[LDPMR] = 0x63c,
};
static bool banked(int reg_nr)
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/backlight.h`, `linux/clk.h`, `linux/console.h`, `linux/ctype.h`, `linux/dma-mapping.h`, `linux/delay.h`, `linux/init.h`.
- Detected declarations: `struct sh_mobile_lcdc_overlay`, `struct sh_mobile_lcdc_priv`, `struct sh_mobile_lcdc_format_info`, `enum sh_mobile_lcdc_overlay_mode`, `function banked`, `function lcdc_chan_is_sublcd`, `function lcdc_write_chan`, `function lcdc_write_chan_mirror`, `function lcdc_read_chan`, `function lcdc_write_overlay`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.