drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.h
Source file repositories/reference/linux-study-clean/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-common.h- Extension
.h- Size
- 7522 bytes
- Lines
- 218
- Domain
- Driver Families
- Bucket
- drivers/media
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/interrupt.hlinux/slab.hmedia/media-device.hmedia/v4l2-device.hmedia/v4l2-fwnode.h
Detected Declarations
struct dcmipp_ent_devicefunction Copyrightfunction dcmipp_pads_cleanupfunction __reg_readfunction __reg_writefunction __reg_setfunction __reg_clear
Annotated Snippet
struct dcmipp_ent_device {
struct media_entity *ent;
struct media_pad *pads;
/* Parallel input device */
struct v4l2_mbus_config_parallel bus;
enum v4l2_mbus_type bus_type;
irq_handler_t handler;
irqreturn_t handler_ret;
irq_handler_t thread_fn;
};
/**
* dcmipp_pads_init - initialize pads
*
* @num_pads: number of pads to initialize
* @pads_flags: flags to use in each pad
*
* Helper functions to allocate/initialize pads
*/
struct media_pad *dcmipp_pads_init(u16 num_pads,
const unsigned long *pads_flags);
/**
* dcmipp_pads_cleanup - free pads
*
* @pads: pointer to the pads
*
* Helper function to free the pads initialized with dcmipp_pads_init
*/
static inline void dcmipp_pads_cleanup(struct media_pad *pads)
{
kfree(pads);
}
/**
* dcmipp_ent_sd_register - initialize and register a subdev node
*
* @ved: the dcmipp_ent_device struct to be initialize
* @sd: the v4l2_subdev struct to be initialize and registered
* @v4l2_dev: the v4l2 device to register the v4l2_subdev
* @name: name of the sub-device. Please notice that the name must be
* unique.
* @function: media entity function defined by MEDIA_ENT_F_* macros
* @num_pads: number of pads to initialize
* @pads_flag: flags to use in each pad
* @sd_int_ops: pointer to &struct v4l2_subdev_internal_ops
* @sd_ops: pointer to &struct v4l2_subdev_ops.
* @handler: func pointer of the irq handler
* @thread_fn: func pointer of the threaded irq handler
*
* Helper function initialize and register the struct dcmipp_ent_device and
* struct v4l2_subdev which represents a subdev node in the topology
*/
int dcmipp_ent_sd_register(struct dcmipp_ent_device *ved,
struct v4l2_subdev *sd,
struct v4l2_device *v4l2_dev,
const char *const name,
u32 function,
u16 num_pads,
const unsigned long *pads_flag,
const struct v4l2_subdev_internal_ops *sd_int_ops,
const struct v4l2_subdev_ops *sd_ops,
irq_handler_t handler,
irq_handler_t thread_fn);
/**
* dcmipp_ent_sd_unregister - cleanup and unregister a subdev node
*
* @ved: the dcmipp_ent_device struct to be cleaned up
* @sd: the v4l2_subdev struct to be unregistered
*
* Helper function cleanup and unregister the struct dcmipp_ent_device and
* struct v4l2_subdev which represents a subdev node in the topology
*/
void dcmipp_ent_sd_unregister(struct dcmipp_ent_device *ved,
struct v4l2_subdev *sd);
#define reg_write(device, reg, val) \
(__reg_write((device)->dev, (device)->regs, (reg), (val)))
#define reg_read(device, reg) \
(__reg_read((device)->dev, (device)->regs, (reg)))
#define reg_set(device, reg, mask) \
(__reg_set((device)->dev, (device)->regs, (reg), (mask)))
#define reg_clear(device, reg, mask) \
(__reg_clear((device)->dev, (device)->regs, (reg), (mask)))
static inline u32 __reg_read(struct device *dev, void __iomem *base, u32 reg)
{
u32 val = readl_relaxed(base + reg);
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/slab.h`, `media/media-device.h`, `media/v4l2-device.h`, `media/v4l2-fwnode.h`.
- Detected declarations: `struct dcmipp_ent_device`, `function Copyright`, `function dcmipp_pads_cleanup`, `function __reg_read`, `function __reg_write`, `function __reg_set`, `function __reg_clear`.
- Atlas domain: Driver Families / drivers/media.
- 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.