drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/atomisp_compat_css20.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/atomisp/pci/atomisp_compat_css20.c- Extension
.c- Size
- 100679 bytes
- Lines
- 3408
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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 user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
media/v4l2-dev.hmedia/v4l2-event.hmmu/isp_mmu.hmmu/sh_mmu_mrfld.hhmm/hmm_bo.hhmm/hmm.hatomisp_compat.hatomisp_internal.hatomisp_cmd.hatomisp-regs.hatomisp_fops.hatomisp_ioctl.hia_css_debug.hia_css_isp_param.hsh_css_hrt.hia_css_isys.hlinux/io.hlinux/pm_runtime.hlinux/string_choices.h
Detected Declarations
struct bayer_ds_factorenum frame_info_typefunction atomisp_css2_hw_store_8function atomisp_css2_hw_store_16function atomisp_css2_hw_store_32function atomisp_css2_hw_load_8function atomisp_css2_hw_load_16function atomisp_css2_hw_load_32function atomisp_css2_hw_storefunction atomisp_css2_hw_loadfunction __printffunction atomisp_load_uint32function hmm_get_mmu_base_addrfunction __dump_pipe_configfunction __dump_stream_configfunction __destroy_streamfunction __destroy_streamsfunction __create_streamfunction __create_streamsfunction __destroy_stream_pipesfunction __destroy_pipesfunction atomisp_destroy_pipes_streamfunction __apply_additional_pipe_configfunction is_pipe_valid_to_current_run_modefunction __create_pipefunction __create_pipesfunction atomisp_create_pipes_streamfunction atomisp_css_update_streamfunction atomisp_css_initfunction __set_css_print_envfunction atomisp_css_load_firmwarefunction atomisp_css_uninitfunction atomisp_css_irq_translatefunction atomisp_css_rx_get_irq_infofunction atomisp_css_rx_clear_irq_infofunction atomisp_css_irq_enablefunction atomisp_css_init_structfunction atomisp_q_video_buffer_to_cssfunction atomisp_q_metadata_buffer_to_cssfunction atomisp_q_s3a_buffer_to_cssfunction atomisp_q_dis_buffer_to_cssfunction atomisp_css_startfunction atomisp_css_update_isp_paramsfunction atomisp_css_update_isp_params_on_pipefunction atomisp_css_queue_bufferfunction atomisp_css_dequeue_bufferfunction atomisp_css_allocate_stat_buffersfunction atomisp_css_free_3a_buffer
Annotated Snippet
struct bayer_ds_factor {
unsigned int numerator;
unsigned int denominator;
};
static void atomisp_css2_hw_store_8(hrt_address addr, uint8_t data)
{
struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
unsigned long flags;
spin_lock_irqsave(&mmio_lock, flags);
writeb(data, isp->base + (addr & 0x003FFFFF));
spin_unlock_irqrestore(&mmio_lock, flags);
}
static void atomisp_css2_hw_store_16(hrt_address addr, uint16_t data)
{
struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
unsigned long flags;
spin_lock_irqsave(&mmio_lock, flags);
writew(data, isp->base + (addr & 0x003FFFFF));
spin_unlock_irqrestore(&mmio_lock, flags);
}
void atomisp_css2_hw_store_32(hrt_address addr, uint32_t data)
{
struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
unsigned long flags;
spin_lock_irqsave(&mmio_lock, flags);
writel(data, isp->base + (addr & 0x003FFFFF));
spin_unlock_irqrestore(&mmio_lock, flags);
}
static uint8_t atomisp_css2_hw_load_8(hrt_address addr)
{
struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
unsigned long flags;
u8 ret;
spin_lock_irqsave(&mmio_lock, flags);
ret = readb(isp->base + (addr & 0x003FFFFF));
spin_unlock_irqrestore(&mmio_lock, flags);
return ret;
}
static uint16_t atomisp_css2_hw_load_16(hrt_address addr)
{
struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
unsigned long flags;
u16 ret;
spin_lock_irqsave(&mmio_lock, flags);
ret = readw(isp->base + (addr & 0x003FFFFF));
spin_unlock_irqrestore(&mmio_lock, flags);
return ret;
}
static uint32_t atomisp_css2_hw_load_32(hrt_address addr)
{
struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
unsigned long flags;
u32 ret;
spin_lock_irqsave(&mmio_lock, flags);
ret = readl(isp->base + (addr & 0x003FFFFF));
spin_unlock_irqrestore(&mmio_lock, flags);
return ret;
}
static void atomisp_css2_hw_store(hrt_address addr, const void *from, uint32_t n)
{
struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
unsigned long flags;
unsigned int i;
addr &= 0x003FFFFF;
spin_lock_irqsave(&mmio_lock, flags);
for (i = 0; i < n; i++, from++)
writeb(*(s8 *)from, isp->base + addr + i);
spin_unlock_irqrestore(&mmio_lock, flags);
}
static void atomisp_css2_hw_load(hrt_address addr, void *to, uint32_t n)
{
struct atomisp_device *isp = dev_get_drvdata(atomisp_dev);
unsigned long flags;
unsigned int i;
Annotation
- Immediate include surface: `media/v4l2-dev.h`, `media/v4l2-event.h`, `mmu/isp_mmu.h`, `mmu/sh_mmu_mrfld.h`, `hmm/hmm_bo.h`, `hmm/hmm.h`, `atomisp_compat.h`, `atomisp_internal.h`.
- Detected declarations: `struct bayer_ds_factor`, `enum frame_info_type`, `function atomisp_css2_hw_store_8`, `function atomisp_css2_hw_store_16`, `function atomisp_css2_hw_store_32`, `function atomisp_css2_hw_load_8`, `function atomisp_css2_hw_load_16`, `function atomisp_css2_hw_load_32`, `function atomisp_css2_hw_store`, `function atomisp_css2_hw_load`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.