drivers/clk/qcom/hfpll.c

Source file repositories/reference/linux-study-clean/drivers/clk/qcom/hfpll.c

File Facts

System
Linux kernel
Corpus path
drivers/clk/qcom/hfpll.c
Extension
.c
Size
3959 bytes
Lines
168
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.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2018, The Linux Foundation. All rights reserved.

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/regmap.h>

#include "clk-regmap.h"
#include "clk-hfpll.h"

static const struct hfpll_data qcs404 = {
	.mode_reg = 0x00,
	.l_reg = 0x04,
	.m_reg = 0x08,
	.n_reg = 0x0c,
	.user_reg = 0x10,
	.config_reg = 0x14,
	.config_val = 0x430405d,
	.status_reg = 0x1c,
	.lock_bit = 16,

	.user_val = 0x8,
	.user_vco_mask = 0x100000,
	.low_vco_max_rate = 1248000000,
	.min_rate = 537600000UL,
	.max_rate = 2900000000UL,
};

static const struct hfpll_data msm8976_a53 = {
	.mode_reg = 0x00,
	.l_reg = 0x04,
	.m_reg = 0x08,
	.n_reg = 0x0c,
	.user_reg = 0x10,
	.config_reg = 0x14,
	.config_val = 0x341600,
	.status_reg = 0x1c,
	.lock_bit = 16,

	.l_val = 0x35,
	.user_val = 0x109,
	.min_rate = 902400000UL,
	.max_rate = 1478400000UL,
};

static const struct hfpll_data msm8976_a72 = {
	.mode_reg = 0x00,
	.l_reg = 0x04,
	.m_reg = 0x08,
	.n_reg = 0x0c,
	.user_reg = 0x10,
	.config_reg = 0x14,
	.config_val = 0x4e0405d,
	.status_reg = 0x1c,
	.lock_bit = 16,

	.l_val = 0x3e,
	.user_val = 0x100109,
	.min_rate = 940800000UL,
	.max_rate = 2016000000UL,
};

static const struct hfpll_data msm8976_cci = {
	.mode_reg = 0x00,
	.l_reg = 0x04,
	.m_reg = 0x08,
	.n_reg = 0x0c,
	.user_reg = 0x10,
	.config_reg = 0x14,
	.config_val = 0x141400,
	.status_reg = 0x1c,
	.lock_bit = 16,

	.l_val = 0x20,
	.user_val = 0x100109,
	.min_rate = 556800000UL,
	.max_rate = 902400000UL,
};

static const struct of_device_id qcom_hfpll_match_table[] = {
	{ .compatible = "qcom,msm8976-hfpll-a53", .data = &msm8976_a53 },
	{ .compatible = "qcom,msm8976-hfpll-a72", .data = &msm8976_a72 },
	{ .compatible = "qcom,msm8976-hfpll-cci", .data = &msm8976_cci },
	{ .compatible = "qcom,qcs404-hfpll", .data = &qcs404 },

Annotation

Implementation Notes