ahci_platform_get_resources(9)
π ahci_platform_get_resources(9) π
okay so this is a page straight out of the Kernel API Manual, bestie, and it's about grabbing up all the platform resources an AHCI host is gonna need. it's giving "setup era" and honestly? iconic.
β¨ NAME β¨
ahci_platform_get_resources β Get platform resources π
πΈ SYNOPSIS πΈ
struct ahci_host_priv * ahci_platform_get_resources (struct
platform_device *pdev , unsigned int flags );
like literally that's the whole signature, no cap π«Ά
π¦ ARGUMENTS π¦
pdevβ the platform device you're getting resources for. it's the main character here, we're doing this all for them πflagsβ a bitmap representing the resource(s) to get. bitmask vibes β¨
π DESCRIPTION π
so what this function does is: it allocates an ahci_host_priv struct, and then it goes and gets the following resources, storing a reference to each one inside that returned struct. it's like packing a little resource lunchbox π
- mmio registers (
IORESOURCE_MEM 0, mandatory) β non-negotiable, this one is not optional bestie, it's required periodt. - regulator for controlling the targets power (optional) and a regulator for controlling the AHCI controller (optional) β two regulators, both optional, both living their best life π
- all clocks specified in the devicetree node, or a single clock for non-OF platforms (optional) β so it's either the whole clock squad or just the one, depending on whether you're OF or not π§
- resets, if
flagshasAHCI_PLATFORM_GET_RESETS(optional) β and only if that flag is set, iykyk π - phys (optional) β last but not least, also optional π«
ngl the "optional" tag is doing a lot of heavy lifting on this page and we respect it π
π₯ RETURN π₯
The allocated ahci_host_priv on success β slay π
β otherwise an ERR_PTR value. so always check, bestie, fr fr π
π SEE ALSO π
Kernel file ./drivers/ata/libahci_platform.c β that's the source of truth, go read it π
then the whole friend group, in order:
ahci_platform_enable_phys(9)ahci_platform_disable_phys(9)ahci_platform_find_clk(9)ahci_platform_enable_clks(9)ahci_platform_disable_clks(9)ahci_platform_deassert_rsts(9)ahci_platform_assert_rsts(9)ahci_platform_enable_regulators(9)ahci_platform_disable_regulators(9)ahci_platform_enable_resources(9)ahci_platform_disable_resources(9)ahci_platform_init_host(9)ahci_platform_shutdown(9)ahci_platform_suspend_host(9)ahci_platform_resume_host(9)ahci_platform_suspend(9)ahci_platform_resume(9)
and that's the whole page!! π«Ά shoutout to the ./drivers/ata source and the October 2026 date stamp β this one was served fresh πβ¨ go get those resources, queen π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms