drivers/gpu/drm/nouveau/nouveau_platform.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nouveau_platform.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/nouveau_platform.c- Extension
.c- Size
- 3060 bytes
- Lines
- 108
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
nouveau_platform.hnvkm/subdev/clk/gk20a_devfreq.h
Detected Declarations
function Copyrightfunction nouveau_platform_removefunction nouveau_platform_suspendfunction nouveau_platform_resume
Annotated Snippet
#include "nouveau_platform.h"
#include <nvkm/subdev/clk/gk20a_devfreq.h>
static int nouveau_platform_probe(struct platform_device *pdev)
{
const struct nvkm_device_tegra_func *func;
struct nvkm_device *device = NULL;
struct drm_device *drm;
func = of_device_get_match_data(&pdev->dev);
drm = nouveau_platform_device_create(func, pdev, &device);
return PTR_ERR_OR_ZERO(drm);
}
static void nouveau_platform_remove(struct platform_device *pdev)
{
struct nouveau_drm *drm = platform_get_drvdata(pdev);
nouveau_drm_device_remove(drm);
}
#ifdef CONFIG_PM_SLEEP
static int nouveau_platform_suspend(struct device *dev)
{
return gk20a_devfreq_suspend(dev);
}
static int nouveau_platform_resume(struct device *dev)
{
return gk20a_devfreq_resume(dev);
}
static SIMPLE_DEV_PM_OPS(nouveau_pm_ops, nouveau_platform_suspend,
nouveau_platform_resume);
#endif
#if IS_ENABLED(CONFIG_OF)
static const struct nvkm_device_tegra_func gk20a_platform_data = {
.iommu_bit = 34,
.require_vdd = true,
};
static const struct nvkm_device_tegra_func gm20b_platform_data = {
.iommu_bit = 34,
.require_vdd = true,
.require_ref_clk = true,
};
static const struct nvkm_device_tegra_func gp10b_platform_data = {
.iommu_bit = 36,
/* power provided by generic PM domains */
.require_vdd = false,
};
static const struct of_device_id nouveau_platform_match[] = {
{
.compatible = "nvidia,gk20a",
.data = &gk20a_platform_data,
},
{
.compatible = "nvidia,gm20b",
.data = &gm20b_platform_data,
},
{
.compatible = "nvidia,gp10b",
.data = &gp10b_platform_data,
},
{ }
};
MODULE_DEVICE_TABLE(of, nouveau_platform_match);
#endif
struct platform_driver nouveau_platform_driver = {
.driver = {
.name = "nouveau",
.of_match_table = of_match_ptr(nouveau_platform_match),
#ifdef CONFIG_PM_SLEEP
.pm = &nouveau_pm_ops,
#endif
},
.probe = nouveau_platform_probe,
.remove = nouveau_platform_remove,
};
Annotation
- Immediate include surface: `nouveau_platform.h`, `nvkm/subdev/clk/gk20a_devfreq.h`.
- Detected declarations: `function Copyright`, `function nouveau_platform_remove`, `function nouveau_platform_suspend`, `function nouveau_platform_resume`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.