drivers/pmdomain/rockchip/pm-domains.c
Source file repositories/reference/linux-study-clean/drivers/pmdomain/rockchip/pm-domains.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pmdomain/rockchip/pm-domains.c- Extension
.c- Size
- 53012 bytes
- Lines
- 1660
- Domain
- Driver Families
- Bucket
- drivers/pmdomain
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/arm-smccc.hlinux/io.hlinux/iopoll.hlinux/err.hlinux/mutex.hlinux/platform_device.hlinux/pm_clock.hlinux/pm_domain.hlinux/property.hlinux/of.hlinux/of_address.hlinux/of_clk.hlinux/clk.hlinux/regmap.hlinux/regulator/consumer.hlinux/mfd/syscon.hsoc/rockchip/pm_domains.hsoc/rockchip/rockchip_sip.hdt-bindings/power/px30-power.hdt-bindings/power/rockchip,rv1126-power.hdt-bindings/power/rockchip,rv1126b-power-controller.hdt-bindings/power/rk3036-power.hdt-bindings/power/rk3066-power.hdt-bindings/power/rk3128-power.hdt-bindings/power/rk3188-power.hdt-bindings/power/rk3228-power.hdt-bindings/power/rk3288-power.hdt-bindings/power/rk3328-power.hdt-bindings/power/rk3366-power.hdt-bindings/power/rk3368-power.hdt-bindings/power/rk3399-power.hdt-bindings/power/rockchip,rk3528-power.h
Detected Declarations
struct rockchip_domain_infostruct rockchip_pmu_infostruct rockchip_pm_domainstruct rockchip_pmufunction rockchip_pmu_unblockfunction rockchip_pmu_unblockfunction rockchip_pmu_domain_is_idlefunction rockchip_pmu_read_ackfunction rockchip_pmu_ungate_clkfunction rockchip_pmu_set_idle_requestfunction rockchip_pmu_save_qosfunction rockchip_pmu_restore_qosfunction rockchip_pmu_domain_is_onfunction rockchip_pmu_domain_is_mem_onfunction rockchip_pmu_domain_is_chain_onfunction rockchip_pmu_domain_mem_resetfunction rockchip_do_pmu_set_power_domainfunction rockchip_pd_powerfunction rockchip_pd_regulator_disablefunction rockchip_pd_regulator_enablefunction rockchip_pd_power_onfunction rockchip_pd_power_offfunction rockchip_pd_attach_devfunction rockchip_pd_detach_devfunction rockchip_pm_add_one_domainfunction rockchip_pm_remove_one_domainfunction rockchip_pm_domain_cleanupfunction rockchip_configure_pd_cntfunction rockchip_pm_add_subdomainfunction for_each_child_of_node_scopedfunction rockchip_pm_domain_probefunction for_each_available_child_of_node_scopedfunction rockchip_pm_domain_drv_registerexport rockchip_pmu_blockexport rockchip_pmu_unblock
Annotated Snippet
struct rockchip_domain_info {
const char *name;
int pwr_mask;
int status_mask;
int req_mask;
int idle_mask;
int ack_mask;
bool active_wakeup;
bool need_regulator;
int pwr_w_mask;
int req_w_mask;
int clk_ungate_mask;
int mem_status_mask;
int repair_status_mask;
u32 pwr_offset;
u32 mem_offset;
u32 req_offset;
};
struct rockchip_pmu_info {
u32 pwr_offset;
u32 status_offset;
u32 req_offset;
u32 idle_offset;
u32 ack_offset;
u32 mem_pwr_offset;
u32 chain_status_offset;
u32 mem_status_offset;
u32 repair_status_offset;
u32 clk_ungate_offset;
u32 core_pwrcnt_offset;
u32 gpu_pwrcnt_offset;
unsigned int core_power_transition_time;
unsigned int gpu_power_transition_time;
int num_domains;
const struct rockchip_domain_info *domain_info;
};
#define MAX_QOS_REGS_NUM 5
#define QOS_PRIORITY 0x08
#define QOS_MODE 0x0c
#define QOS_BANDWIDTH 0x10
#define QOS_SATURATION 0x14
#define QOS_EXTCONTROL 0x18
struct rockchip_pm_domain {
struct generic_pm_domain genpd;
const struct rockchip_domain_info *info;
struct rockchip_pmu *pmu;
int num_qos;
struct regmap **qos_regmap;
u32 *qos_save_regs[MAX_QOS_REGS_NUM];
int num_clks;
struct clk_bulk_data *clks;
struct device_node *node;
struct regulator *supply;
};
struct rockchip_pmu {
struct device *dev;
struct regmap *regmap;
const struct rockchip_pmu_info *info;
struct mutex mutex; /* mutex lock for pmu */
struct genpd_onecell_data genpd_data;
struct generic_pm_domain *domains[];
};
#define to_rockchip_pd(gpd) container_of(gpd, struct rockchip_pm_domain, genpd)
#define DOMAIN(_name, pwr, status, req, idle, ack, wakeup) \
{ \
.name = _name, \
.pwr_mask = (pwr), \
.status_mask = (status), \
.req_mask = (req), \
.idle_mask = (idle), \
.ack_mask = (ack), \
.active_wakeup = (wakeup), \
}
#define DOMAIN_M(_name, pwr, status, req, idle, ack, wakeup) \
{ \
.name = _name, \
.pwr_w_mask = (pwr) << 16, \
.pwr_mask = (pwr), \
.status_mask = (status), \
.req_w_mask = (req) << 16, \
Annotation
- Immediate include surface: `linux/arm-smccc.h`, `linux/io.h`, `linux/iopoll.h`, `linux/err.h`, `linux/mutex.h`, `linux/platform_device.h`, `linux/pm_clock.h`, `linux/pm_domain.h`.
- Detected declarations: `struct rockchip_domain_info`, `struct rockchip_pmu_info`, `struct rockchip_pm_domain`, `struct rockchip_pmu`, `function rockchip_pmu_unblock`, `function rockchip_pmu_unblock`, `function rockchip_pmu_domain_is_idle`, `function rockchip_pmu_read_ack`, `function rockchip_pmu_ungate_clk`, `function rockchip_pmu_set_idle_request`.
- Atlas domain: Driver Families / drivers/pmdomain.
- Implementation status: integration 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.