drivers/pmdomain/imx/scu-pd.c
Source file repositories/reference/linux-study-clean/drivers/pmdomain/imx/scu-pd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pmdomain/imx/scu-pd.c- Extension
.c- Size
- 16635 bytes
- Lines
- 548
- Domain
- Driver Families
- Bucket
- drivers/pmdomain
- 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
dt-bindings/firmware/imx/rsrc.hlinux/console.hlinux/firmware/imx/sci.hlinux/firmware/imx/svc/rm.hlinux/io.hlinux/module.hlinux/of.hlinux/of_address.hlinux/of_platform.hlinux/platform_device.hlinux/pm.hlinux/pm_domain.hlinux/slab.h
Detected Declarations
struct imx_sc_msg_req_set_resource_power_modestruct req_get_resource_modestruct resp_get_resource_modestruct imx_sc_msg_req_get_resource_power_modestruct imx_sc_pm_domainstruct imx_sc_pd_rangestruct imx_sc_pd_socfunction to_imx_sc_pdfunction imx_sc_pd_get_console_rsrcfunction imx_sc_get_pd_powerfunction imx_sc_pd_powerfunction imx_sc_pd_power_onfunction imx_sc_pd_power_offfunction imx_scu_add_pm_domainfunction imx_scu_init_pm_domainsfunction imx_sc_pd_probe
Annotated Snippet
struct imx_sc_msg_req_set_resource_power_mode {
struct imx_sc_rpc_msg hdr;
u16 resource;
u8 mode;
} __packed __aligned(4);
struct req_get_resource_mode {
u16 resource;
};
struct resp_get_resource_mode {
u8 mode;
};
struct imx_sc_msg_req_get_resource_power_mode {
struct imx_sc_rpc_msg hdr;
union {
struct req_get_resource_mode req;
struct resp_get_resource_mode resp;
} data;
} __packed __aligned(4);
#define IMX_SCU_PD_NAME_SIZE 20
struct imx_sc_pm_domain {
struct generic_pm_domain pd;
char name[IMX_SCU_PD_NAME_SIZE];
u32 rsrc;
};
struct imx_sc_pd_range {
char *name;
u32 rsrc;
u8 num;
/* add domain index */
bool postfix;
u8 start_from;
};
struct imx_sc_pd_soc {
const struct imx_sc_pd_range *pd_ranges;
u8 num_ranges;
};
static int imx_con_rsrc;
/* Align with the IMX_SC_PM_PW_MODE_[OFF,STBY,LP,ON] macros */
static const char * const imx_sc_pm_mode[] = {
"IMX_SC_PM_PW_MODE_OFF",
"IMX_SC_PM_PW_MODE_STBY",
"IMX_SC_PM_PW_MODE_LP",
"IMX_SC_PM_PW_MODE_ON"
};
static const struct imx_sc_pd_range imx8qxp_scu_pd_ranges[] = {
/* LSIO SS */
{ "pwm", IMX_SC_R_PWM_0, 8, true, 0 },
{ "gpio", IMX_SC_R_GPIO_0, 8, true, 0 },
{ "gpt", IMX_SC_R_GPT_0, 5, true, 0 },
{ "kpp", IMX_SC_R_KPP, 1, false, 0 },
{ "fspi", IMX_SC_R_FSPI_0, 2, true, 0 },
{ "mu_a", IMX_SC_R_MU_0A, 14, true, 0 },
{ "mu_b", IMX_SC_R_MU_5B, 9, true, 5 },
/* CONN SS */
{ "usb", IMX_SC_R_USB_0, 2, true, 0 },
{ "usb0phy", IMX_SC_R_USB_0_PHY, 1, false, 0 },
{ "usb1phy", IMX_SC_R_USB_1_PHY, 1, false, 0},
{ "usb2", IMX_SC_R_USB_2, 1, false, 0 },
{ "usb2phy", IMX_SC_R_USB_2_PHY, 1, false, 0 },
{ "sdhc", IMX_SC_R_SDHC_0, 3, true, 0 },
{ "enet", IMX_SC_R_ENET_0, 2, true, 0 },
{ "nand", IMX_SC_R_NAND, 1, false, 0 },
{ "mlb", IMX_SC_R_MLB_0, 1, true, 0 },
/* AUDIO SS */
{ "audio-pll0", IMX_SC_R_AUDIO_PLL_0, 1, false, 0 },
{ "audio-pll1", IMX_SC_R_AUDIO_PLL_1, 1, false, 0 },
{ "audio-clk-0", IMX_SC_R_AUDIO_CLK_0, 1, false, 0 },
{ "audio-clk-1", IMX_SC_R_AUDIO_CLK_1, 1, false, 0 },
{ "mclk-out-0", IMX_SC_R_MCLK_OUT_0, 1, false, 0 },
{ "mclk-out-1", IMX_SC_R_MCLK_OUT_1, 1, false, 0 },
{ "dma0-ch", IMX_SC_R_DMA_0_CH0, 32, true, 0 },
{ "dma1-ch", IMX_SC_R_DMA_1_CH0, 16, true, 0 },
{ "dma2-ch-0", IMX_SC_R_DMA_2_CH0, 5, true, 0 },
{ "dma2-ch-1", IMX_SC_R_DMA_2_CH5, 27, true, 0 },
{ "dma3-ch", IMX_SC_R_DMA_3_CH0, 32, true, 0 },
{ "asrc0", IMX_SC_R_ASRC_0, 1, false, 0 },
{ "asrc1", IMX_SC_R_ASRC_1, 1, false, 0 },
{ "esai0", IMX_SC_R_ESAI_0, 1, false, 0 },
Annotation
- Immediate include surface: `dt-bindings/firmware/imx/rsrc.h`, `linux/console.h`, `linux/firmware/imx/sci.h`, `linux/firmware/imx/svc/rm.h`, `linux/io.h`, `linux/module.h`, `linux/of.h`, `linux/of_address.h`.
- Detected declarations: `struct imx_sc_msg_req_set_resource_power_mode`, `struct req_get_resource_mode`, `struct resp_get_resource_mode`, `struct imx_sc_msg_req_get_resource_power_mode`, `struct imx_sc_pm_domain`, `struct imx_sc_pd_range`, `struct imx_sc_pd_soc`, `function to_imx_sc_pd`, `function imx_sc_pd_get_console_rsrc`, `function imx_sc_get_pd_power`.
- Atlas domain: Driver Families / drivers/pmdomain.
- 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.