drivers/clk/uniphier/clk-uniphier-fixed-factor.c
Source file repositories/reference/linux-study-clean/drivers/clk/uniphier/clk-uniphier-fixed-factor.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/uniphier/clk-uniphier-fixed-factor.c- Extension
.c- Size
- 949 bytes
- Lines
- 40
- Domain
- Driver Families
- Bucket
- drivers/clk
- 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.
- 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/clk-provider.hlinux/device.hclk-uniphier.h
Detected Declarations
function Copyright
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright (C) 2016 Socionext Inc.
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
*/
#include <linux/clk-provider.h>
#include <linux/device.h>
#include "clk-uniphier.h"
struct clk_hw *uniphier_clk_register_fixed_factor(struct device *dev,
const char *name,
const struct uniphier_clk_fixed_factor_data *data)
{
struct clk_fixed_factor *fix;
struct clk_init_data init;
int ret;
fix = devm_kzalloc(dev, sizeof(*fix), GFP_KERNEL);
if (!fix)
return ERR_PTR(-ENOMEM);
init.name = name;
init.ops = &clk_fixed_factor_ops;
init.flags = data->parent_name ? CLK_SET_RATE_PARENT : 0;
init.parent_names = data->parent_name ? &data->parent_name : NULL;
init.num_parents = data->parent_name ? 1 : 0;
fix->mult = data->mult;
fix->div = data->div;
fix->hw.init = &init;
ret = devm_clk_hw_register(dev, &fix->hw);
if (ret)
return ERR_PTR(ret);
return &fix->hw;
}
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/device.h`, `clk-uniphier.h`.
- Detected declarations: `function Copyright`.
- Atlas domain: Driver Families / drivers/clk.
- 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.