drivers/staging/media/ipu7/ipu7-bus.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/ipu7/ipu7-bus.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/ipu7/ipu7-bus.c- Extension
.c- Size
- 3344 bytes
- Lines
- 159
- 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.
- 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
linux/auxiliary_bus.hlinux/device.hlinux/dma-mapping.hlinux/err.hlinux/list.hlinux/mutex.hlinux/pci.hlinux/pm_domain.hlinux/pm_runtime.hlinux/slab.hipu7.hipu7-bus.hipu7-boot.hipu7-dma.h
Detected Declarations
function Copyrightfunction bus_pm_runtime_resumefunction ipu7_bus_releasefunction ipu7_bus_initialize_devicefunction ipu7_bus_add_devicefunction ipu7_bus_del_devicesfunction list_for_each_entry_safe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2013 - 2025 Intel Corporation
*/
#include <linux/auxiliary_bus.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/pci.h>
#include <linux/pm_domain.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include "ipu7.h"
#include "ipu7-bus.h"
#include "ipu7-boot.h"
#include "ipu7-dma.h"
static int bus_pm_runtime_suspend(struct device *dev)
{
struct ipu7_bus_device *adev = to_ipu7_bus_device(dev);
int ret;
ret = pm_generic_runtime_suspend(dev);
if (ret)
return ret;
ret = ipu_buttress_powerdown(dev, adev->ctrl);
if (!ret)
return 0;
dev_err(dev, "power down failed!\n");
/* Powering down failed, attempt to resume device now */
ret = pm_generic_runtime_resume(dev);
if (!ret)
return -EBUSY;
return -EIO;
}
static int bus_pm_runtime_resume(struct device *dev)
{
struct ipu7_bus_device *adev = to_ipu7_bus_device(dev);
int ret;
ret = ipu_buttress_powerup(dev, adev->ctrl);
if (ret)
return ret;
ret = pm_generic_runtime_resume(dev);
if (ret)
goto out_err;
return 0;
out_err:
ipu_buttress_powerdown(dev, adev->ctrl);
return -EBUSY;
}
static struct dev_pm_domain ipu7_bus_pm_domain = {
.ops = {
.runtime_suspend = bus_pm_runtime_suspend,
.runtime_resume = bus_pm_runtime_resume,
},
};
static DEFINE_MUTEX(ipu7_bus_mutex);
static void ipu7_bus_release(struct device *dev)
{
struct ipu7_bus_device *adev = to_ipu7_bus_device(dev);
kfree(adev->pdata);
kfree(adev);
}
struct ipu7_bus_device *
ipu7_bus_initialize_device(struct pci_dev *pdev, struct device *parent,
void *pdata, const struct ipu_buttress_ctrl *ctrl,
const char *name)
{
struct auxiliary_device *auxdev;
struct ipu7_bus_device *adev;
struct ipu7_device *isp = pci_get_drvdata(pdev);
int ret;
Annotation
- Immediate include surface: `linux/auxiliary_bus.h`, `linux/device.h`, `linux/dma-mapping.h`, `linux/err.h`, `linux/list.h`, `linux/mutex.h`, `linux/pci.h`, `linux/pm_domain.h`.
- Detected declarations: `function Copyright`, `function bus_pm_runtime_resume`, `function ipu7_bus_release`, `function ipu7_bus_initialize_device`, `function ipu7_bus_add_device`, `function ipu7_bus_del_devices`, `function list_for_each_entry_safe`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: source implementation candidate.
- 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.