drivers/reset/reset-th1520.c
Source file repositories/reference/linux-study-clean/drivers/reset/reset-th1520.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/reset/reset-th1520.c- Extension
.c- Size
- 23623 bytes
- Lines
- 984
- Domain
- Driver Families
- Bucket
- drivers/reset
- 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/of.hlinux/platform_device.hlinux/reset-controller.hlinux/regmap.hdt-bindings/reset/thead,th1520-reset.h
Detected Declarations
struct th1520_reset_mapstruct th1520_reset_privstruct th1520_reset_datafunction to_th1520_resetfunction th1520_reset_assertfunction th1520_reset_deassertfunction th1520_reset_probe
Annotated Snippet
struct th1520_reset_map {
u32 bit;
u32 reg;
};
struct th1520_reset_priv {
struct reset_controller_dev rcdev;
struct regmap *map;
const struct th1520_reset_map *resets;
};
struct th1520_reset_data {
const struct th1520_reset_map *resets;
size_t num;
};
static const struct th1520_reset_map th1520_resets[] = {
[TH1520_RESET_ID_GPU] = {
.bit = TH1520_GPU_SW_GPU_RST,
.reg = TH1520_GPU_RST_CFG,
},
[TH1520_RESET_ID_GPU_CLKGEN] = {
.bit = TH1520_GPU_SW_CLKGEN_RST,
.reg = TH1520_GPU_RST_CFG,
},
[TH1520_RESET_ID_DPU_AHB] = {
.bit = TH1520_DPU_SW_DPU_HRST,
.reg = TH1520_DPU_RST_CFG,
},
[TH1520_RESET_ID_DPU_AXI] = {
.bit = TH1520_DPU_SW_DPU_ARST,
.reg = TH1520_DPU_RST_CFG,
},
[TH1520_RESET_ID_DPU_CORE] = {
.bit = TH1520_DPU_SW_DPU_CRST,
.reg = TH1520_DPU_RST_CFG,
},
[TH1520_RESET_ID_DSI0_APB] = {
.bit = TH1520_DSI_SW_DSI_PRST,
.reg = TH1520_DSI0_RST_CFG,
},
[TH1520_RESET_ID_DSI1_APB] = {
.bit = TH1520_DSI_SW_DSI_PRST,
.reg = TH1520_DSI1_RST_CFG,
},
[TH1520_RESET_ID_HDMI] = {
.bit = TH1520_HDMI_SW_MAIN_RST,
.reg = TH1520_HDMI_RST_CFG,
},
[TH1520_RESET_ID_HDMI_APB] = {
.bit = TH1520_HDMI_SW_PRST,
.reg = TH1520_HDMI_RST_CFG,
},
[TH1520_RESET_ID_VOAXI] = {
.bit = BIT(0),
.reg = TH1520_AXI4_VO_DW_AXI_RST_CFG,
},
[TH1520_RESET_ID_VOAXI_APB] = {
.bit = BIT(1),
.reg = TH1520_AXI4_VO_DW_AXI_RST_CFG,
},
[TH1520_RESET_ID_X2H_DPU_AXI] = {
.bit = BIT(0),
.reg = TH1520_X2H_X4_VOSYS_DW_RST_CFG,
},
[TH1520_RESET_ID_X2H_DPU_AHB] = {
.bit = BIT(1),
.reg = TH1520_X2H_X4_VOSYS_DW_RST_CFG,
},
[TH1520_RESET_ID_X2H_DPU1_AXI] = {
.bit = BIT(2),
.reg = TH1520_X2H_X4_VOSYS_DW_RST_CFG,
},
[TH1520_RESET_ID_X2H_DPU1_AHB] = {
.bit = BIT(3),
.reg = TH1520_X2H_X4_VOSYS_DW_RST_CFG,
},
};
static const struct th1520_reset_map th1520_ap_resets[] = {
[TH1520_RESET_ID_BROM] = {
.bit = BIT(0),
.reg = TH1520_BROM_RST_CFG,
},
[TH1520_RESET_ID_C910_TOP] = {
.bit = BIT(0),
.reg = TH1520_C910_RST_CFG,
},
[TH1520_RESET_ID_NPU] = {
.bit = BIT(0),
Annotation
- Immediate include surface: `linux/of.h`, `linux/platform_device.h`, `linux/reset-controller.h`, `linux/regmap.h`, `dt-bindings/reset/thead,th1520-reset.h`.
- Detected declarations: `struct th1520_reset_map`, `struct th1520_reset_priv`, `struct th1520_reset_data`, `function to_th1520_reset`, `function th1520_reset_assert`, `function th1520_reset_deassert`, `function th1520_reset_probe`.
- Atlas domain: Driver Families / drivers/reset.
- 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.