drivers/clk/starfive/clk-starfive-jh7110-isp.c
Source file repositories/reference/linux-study-clean/drivers/clk/starfive/clk-starfive-jh7110-isp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/starfive/clk-starfive-jh7110-isp.c- Extension
.c- Size
- 6477 bytes
- Lines
- 221
- 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.
- 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/clk.hlinux/clk-provider.hlinux/io.hlinux/platform_device.hlinux/pm_runtime.hlinux/reset.hdt-bindings/clock/starfive,jh7110-crg.hclk-starfive-jh7110.h
Detected Declarations
function jh7110_isp_top_rst_initfunction jh7110_ispcrg_suspendfunction jh7110_ispcrg_resumefunction jh7110_ispcrg_probefunction jh7110_ispcrg_remove
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* StarFive JH7110 Image-Signal-Process Clock Driver
*
* Copyright (C) 2022-2023 StarFive Technology Co., Ltd.
*/
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/io.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/reset.h>
#include <dt-bindings/clock/starfive,jh7110-crg.h>
#include "clk-starfive-jh7110.h"
/* external clocks */
#define JH7110_ISPCLK_ISP_TOP_CORE (JH7110_ISPCLK_END + 0)
#define JH7110_ISPCLK_ISP_TOP_AXI (JH7110_ISPCLK_END + 1)
#define JH7110_ISPCLK_NOC_BUS_ISP_AXI (JH7110_ISPCLK_END + 2)
#define JH7110_ISPCLK_DVP_CLK (JH7110_ISPCLK_END + 3)
#define JH7110_ISPCLK_EXT_END (JH7110_ISPCLK_END + 4)
static struct clk_bulk_data jh7110_isp_top_clks[] = {
{ .id = "isp_top_core" },
{ .id = "isp_top_axi" }
};
static const struct jh71x0_clk_data jh7110_ispclk_data[] = {
/* syscon */
JH71X0__DIV(JH7110_ISPCLK_DOM4_APB_FUNC, "dom4_apb_func", 15,
JH7110_ISPCLK_ISP_TOP_AXI),
JH71X0__DIV(JH7110_ISPCLK_MIPI_RX0_PXL, "mipi_rx0_pxl", 8,
JH7110_ISPCLK_ISP_TOP_CORE),
JH71X0__INV(JH7110_ISPCLK_DVP_INV, "dvp_inv", JH7110_ISPCLK_DVP_CLK),
/* vin */
JH71X0__DIV(JH7110_ISPCLK_M31DPHY_CFG_IN, "m31dphy_cfg_in", 16,
JH7110_ISPCLK_ISP_TOP_CORE),
JH71X0__DIV(JH7110_ISPCLK_M31DPHY_REF_IN, "m31dphy_ref_in", 16,
JH7110_ISPCLK_ISP_TOP_CORE),
JH71X0__DIV(JH7110_ISPCLK_M31DPHY_TX_ESC_LAN0, "m31dphy_tx_esc_lan0", 60,
JH7110_ISPCLK_ISP_TOP_CORE),
JH71X0_GATE(JH7110_ISPCLK_VIN_APB, "vin_apb", 0,
JH7110_ISPCLK_DOM4_APB_FUNC),
JH71X0__DIV(JH7110_ISPCLK_VIN_SYS, "vin_sys", 8, JH7110_ISPCLK_ISP_TOP_CORE),
JH71X0_GATE(JH7110_ISPCLK_VIN_PIXEL_IF0, "vin_pixel_if0", 0,
JH7110_ISPCLK_MIPI_RX0_PXL),
JH71X0_GATE(JH7110_ISPCLK_VIN_PIXEL_IF1, "vin_pixel_if1", 0,
JH7110_ISPCLK_MIPI_RX0_PXL),
JH71X0_GATE(JH7110_ISPCLK_VIN_PIXEL_IF2, "vin_pixel_if2", 0,
JH7110_ISPCLK_MIPI_RX0_PXL),
JH71X0_GATE(JH7110_ISPCLK_VIN_PIXEL_IF3, "vin_pixel_if3", 0,
JH7110_ISPCLK_MIPI_RX0_PXL),
JH71X0__MUX(JH7110_ISPCLK_VIN_P_AXI_WR, "vin_p_axi_wr", 0, 2,
JH7110_ISPCLK_MIPI_RX0_PXL,
JH7110_ISPCLK_DVP_INV),
/* ispv2_top_wrapper */
JH71X0_GMUX(JH7110_ISPCLK_ISPV2_TOP_WRAPPER_C, "ispv2_top_wrapper_c", 0, 2,
JH7110_ISPCLK_MIPI_RX0_PXL,
JH7110_ISPCLK_DVP_INV),
};
static inline int jh7110_isp_top_rst_init(struct jh71x0_clk_priv *priv)
{
struct reset_control *top_rsts;
/* The resets should be shared and other ISP modules will use its. */
top_rsts = devm_reset_control_array_get_shared(priv->dev);
if (IS_ERR(top_rsts))
return dev_err_probe(priv->dev, PTR_ERR(top_rsts),
"failed to get top resets\n");
return reset_control_deassert(top_rsts);
}
#ifdef CONFIG_PM
static int jh7110_ispcrg_suspend(struct device *dev)
{
struct jh7110_top_sysclk *top = dev_get_drvdata(dev);
clk_bulk_disable_unprepare(top->top_clks_num, top->top_clks);
return 0;
}
static int jh7110_ispcrg_resume(struct device *dev)
{
struct jh7110_top_sysclk *top = dev_get_drvdata(dev);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clk-provider.h`, `linux/io.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `linux/reset.h`, `dt-bindings/clock/starfive,jh7110-crg.h`, `clk-starfive-jh7110.h`.
- Detected declarations: `function jh7110_isp_top_rst_init`, `function jh7110_ispcrg_suspend`, `function jh7110_ispcrg_resume`, `function jh7110_ispcrg_probe`, `function jh7110_ispcrg_remove`.
- Atlas domain: Driver Families / drivers/clk.
- 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.