drivers/clk/spear/spear1340_clock.c
Source file repositories/reference/linux-study-clean/drivers/clk/spear/spear1340_clock.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/clk/spear/spear1340_clock.c- Extension
.c- Size
- 40003 bytes
- Lines
- 1013
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clkdev.hlinux/clk/spear.hlinux/err.hlinux/io.hlinux/spinlock_types.hclk.h
Detected Declarations
function spear1340_clk_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* arch/arm/mach-spear13xx/spear1340_clock.c
*
* SPEAr1340 machine clock framework source file
*
* Copyright (C) 2012 ST Microelectronics
* Viresh Kumar <vireshk@kernel.org>
*/
#include <linux/clkdev.h>
#include <linux/clk/spear.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/spinlock_types.h>
#include "clk.h"
/* Clock Configuration Registers */
#define SPEAR1340_SYS_CLK_CTRL (misc_base + 0x200)
#define SPEAR1340_HCLK_SRC_SEL_SHIFT 27
#define SPEAR1340_HCLK_SRC_SEL_MASK 1
#define SPEAR1340_SCLK_SRC_SEL_SHIFT 23
#define SPEAR1340_SCLK_SRC_SEL_MASK 3
/* PLL related registers and bit values */
#define SPEAR1340_PLL_CFG (misc_base + 0x210)
/* PLL_CFG bit values */
#define SPEAR1340_CLCD_SYNT_CLK_MASK 1
#define SPEAR1340_CLCD_SYNT_CLK_SHIFT 31
#define SPEAR1340_GEN_SYNT2_3_CLK_SHIFT 29
#define SPEAR1340_GEN_SYNT_CLK_MASK 2
#define SPEAR1340_GEN_SYNT0_1_CLK_SHIFT 27
#define SPEAR1340_PLL_CLK_MASK 2
#define SPEAR1340_PLL3_CLK_SHIFT 24
#define SPEAR1340_PLL2_CLK_SHIFT 22
#define SPEAR1340_PLL1_CLK_SHIFT 20
#define SPEAR1340_PLL1_CTR (misc_base + 0x214)
#define SPEAR1340_PLL1_FRQ (misc_base + 0x218)
#define SPEAR1340_PLL2_CTR (misc_base + 0x220)
#define SPEAR1340_PLL2_FRQ (misc_base + 0x224)
#define SPEAR1340_PLL3_CTR (misc_base + 0x22C)
#define SPEAR1340_PLL3_FRQ (misc_base + 0x230)
#define SPEAR1340_PLL4_CTR (misc_base + 0x238)
#define SPEAR1340_PLL4_FRQ (misc_base + 0x23C)
#define SPEAR1340_PERIP_CLK_CFG (misc_base + 0x244)
/* PERIP_CLK_CFG bit values */
#define SPEAR1340_SPDIF_CLK_MASK 1
#define SPEAR1340_SPDIF_OUT_CLK_SHIFT 15
#define SPEAR1340_SPDIF_IN_CLK_SHIFT 14
#define SPEAR1340_GPT3_CLK_SHIFT 13
#define SPEAR1340_GPT2_CLK_SHIFT 12
#define SPEAR1340_GPT_CLK_MASK 1
#define SPEAR1340_GPT1_CLK_SHIFT 9
#define SPEAR1340_GPT0_CLK_SHIFT 8
#define SPEAR1340_UART_CLK_MASK 2
#define SPEAR1340_UART1_CLK_SHIFT 6
#define SPEAR1340_UART0_CLK_SHIFT 4
#define SPEAR1340_CLCD_CLK_MASK 2
#define SPEAR1340_CLCD_CLK_SHIFT 2
#define SPEAR1340_C3_CLK_MASK 1
#define SPEAR1340_C3_CLK_SHIFT 1
#define SPEAR1340_GMAC_CLK_CFG (misc_base + 0x248)
#define SPEAR1340_GMAC_PHY_CLK_MASK 1
#define SPEAR1340_GMAC_PHY_CLK_SHIFT 2
#define SPEAR1340_GMAC_PHY_INPUT_CLK_MASK 2
#define SPEAR1340_GMAC_PHY_INPUT_CLK_SHIFT 0
#define SPEAR1340_I2S_CLK_CFG (misc_base + 0x24C)
/* I2S_CLK_CFG register mask */
#define SPEAR1340_I2S_SCLK_X_MASK 0x1F
#define SPEAR1340_I2S_SCLK_X_SHIFT 27
#define SPEAR1340_I2S_SCLK_Y_MASK 0x1F
#define SPEAR1340_I2S_SCLK_Y_SHIFT 22
#define SPEAR1340_I2S_SCLK_EQ_SEL_SHIFT 21
#define SPEAR1340_I2S_SCLK_SYNTH_ENB 20
#define SPEAR1340_I2S_PRS1_CLK_X_MASK 0xFF
#define SPEAR1340_I2S_PRS1_CLK_X_SHIFT 12
#define SPEAR1340_I2S_PRS1_CLK_Y_MASK 0xFF
#define SPEAR1340_I2S_PRS1_CLK_Y_SHIFT 4
#define SPEAR1340_I2S_PRS1_EQ_SEL_SHIFT 3
#define SPEAR1340_I2S_REF_SEL_MASK 1
#define SPEAR1340_I2S_REF_SHIFT 2
#define SPEAR1340_I2S_SRC_CLK_MASK 2
#define SPEAR1340_I2S_SRC_CLK_SHIFT 0
#define SPEAR1340_C3_CLK_SYNT (misc_base + 0x250)
#define SPEAR1340_UART0_CLK_SYNT (misc_base + 0x254)
#define SPEAR1340_UART1_CLK_SYNT (misc_base + 0x258)
Annotation
- Immediate include surface: `linux/clkdev.h`, `linux/clk/spear.h`, `linux/err.h`, `linux/io.h`, `linux/spinlock_types.h`, `clk.h`.
- Detected declarations: `function spear1340_clk_init`.
- 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.