drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c- Extension
.c- Size
- 22444 bytes
- Lines
- 829
- 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.
- 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/build_bug.hlinux/clk.hlinux/interrupt.hlinux/mfd/syscon.hlinux/module.hlinux/of.hlinux/of_graph.hlinux/platform_device.hlinux/pinctrl/consumer.hlinux/pm_domain.hlinux/pm_runtime.hmedia/v4l2-fwnode.hmedia/v4l2-mc.hrkisp1-common.hrkisp1-csi.h
Detected Declarations
struct rkisp1_isr_datafunction rkisp1_subdev_notifier_boundfunction rkisp1_subdev_notifier_completefunction rkisp1_subdev_notifier_destroyfunction rkisp1_subdev_notifier_registerfunction fwnode_graph_for_each_endpointfunction rkisp1_runtime_suspendfunction rkisp1_runtime_resumefunction rkisp1_create_linksfunction rkisp1_entities_unregisterfunction rkisp1_entities_registerfunction rkisp1_isrfunction rkisp1_init_clocksfunction rkisp1_init_pm_domainsfunction rkisp1_probefunction rkisp1_remove
Annotated Snippet
struct rkisp1_isr_data {
const char *name;
irqreturn_t (*isr)(int irq, void *ctx);
u32 line_mask;
};
/* ----------------------------------------------------------------------------
* Sensor DT bindings
*/
static int rkisp1_subdev_notifier_bound(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *sd,
struct v4l2_async_connection *asc)
{
struct rkisp1_device *rkisp1 =
container_of(notifier, struct rkisp1_device, notifier);
struct rkisp1_sensor_async *s_asd =
container_of(asc, struct rkisp1_sensor_async, asd);
int source_pad;
int ret;
s_asd->sd = sd;
source_pad = media_entity_get_fwnode_pad(&sd->entity, s_asd->source_ep,
MEDIA_PAD_FL_SOURCE);
if (source_pad < 0) {
dev_err(rkisp1->dev, "failed to find source pad for %s\n",
sd->name);
return source_pad;
}
if (s_asd->port == 0)
return rkisp1_csi_link_sensor(rkisp1, sd, s_asd, source_pad);
ret = media_create_pad_link(&sd->entity, source_pad,
&rkisp1->isp.sd.entity,
RKISP1_ISP_PAD_SINK_VIDEO,
!s_asd->index ? MEDIA_LNK_FL_ENABLED : 0);
if (ret) {
dev_err(rkisp1->dev, "failed to link source pad of %s\n",
sd->name);
return ret;
}
return 0;
}
static int rkisp1_subdev_notifier_complete(struct v4l2_async_notifier *notifier)
{
struct rkisp1_device *rkisp1 =
container_of(notifier, struct rkisp1_device, notifier);
return v4l2_device_register_subdev_nodes(&rkisp1->v4l2_dev);
}
static void rkisp1_subdev_notifier_destroy(struct v4l2_async_connection *asc)
{
struct rkisp1_sensor_async *rk_asd =
container_of(asc, struct rkisp1_sensor_async, asd);
fwnode_handle_put(rk_asd->source_ep);
}
static const struct v4l2_async_notifier_operations rkisp1_subdev_notifier_ops = {
.bound = rkisp1_subdev_notifier_bound,
.complete = rkisp1_subdev_notifier_complete,
.destroy = rkisp1_subdev_notifier_destroy,
};
static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1)
{
struct v4l2_async_notifier *ntf = &rkisp1->notifier;
struct fwnode_handle *fwnode = dev_fwnode(rkisp1->dev);
struct fwnode_handle *ep;
unsigned int index = 0;
int ret = 0;
v4l2_async_nf_init(ntf, &rkisp1->v4l2_dev);
ntf->ops = &rkisp1_subdev_notifier_ops;
fwnode_graph_for_each_endpoint(fwnode, ep) {
struct fwnode_handle *port;
struct v4l2_fwnode_endpoint vep = { };
struct rkisp1_sensor_async *rk_asd;
struct fwnode_handle *source;
u32 reg = 0;
/* Select the bus type based on the port. */
port = fwnode_get_parent(ep);
Annotation
- Immediate include surface: `linux/build_bug.h`, `linux/clk.h`, `linux/interrupt.h`, `linux/mfd/syscon.h`, `linux/module.h`, `linux/of.h`, `linux/of_graph.h`, `linux/platform_device.h`.
- Detected declarations: `struct rkisp1_isr_data`, `function rkisp1_subdev_notifier_bound`, `function rkisp1_subdev_notifier_complete`, `function rkisp1_subdev_notifier_destroy`, `function rkisp1_subdev_notifier_register`, `function fwnode_graph_for_each_endpoint`, `function rkisp1_runtime_suspend`, `function rkisp1_runtime_resume`, `function rkisp1_create_links`, `function rkisp1_entities_unregister`.
- 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.