genpd_dev_pm_attach_by_id(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to genpd_dev_pm_attach_by_id(9) from the Kernel API Manual β€” this function is literally about associating a device with one of its PM domains, and it's lowkey iconic πŸ’…βœ¨


πŸ’– NAME πŸ’–

genpd_dev_pm_attach_by_id β€” associate a device with one of its PM domains. fr fr 🫢


✨ SYNOPSIS ✨

struct device * genpd_dev_pm_attach_by_id (struct device *dev , unsigned int index );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device used to lookup the PM domain. main character device energy πŸ‘‘
  • index β€” the index of the PM domain. it's giving "which one, bestie?" πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

So bestie, here's the vibe: it parses the device's OF node to find a PM domain specifier at the provided index. If such a specifier is found, it creates a virtual device and attaches it to the retrieved pm_domain ops. To deal with detaching of the virtual device, the ->detach callback in the struct dev_pm_domain are assigned to genpd_dev_pm_detach. no cap 🌸

It returns the created virtual device if successfully attached PM domain, NULL when the device don't need a PM domain, else an ERR_PTR in case of failures. And if a power-domain exists for the device, but cannot be found or turned on, then ERR_PTR(-EPROBE_DEFER) is returned to ensure that the device is not probed and to re-try again later. that deferral is doing important work, okay 😭πŸ”₯


🌈 SEE ALSO 🌈

Kernel file: ./drivers/pmdomain/core.c

dev_pm_genpd_set_performance_state(9), dev_pm_genpd_set_next_wakeup(9), dev_pm_genpd_get_next_hrtimer(9), dev_pm_genpd_set_hwmode(9), dev_pm_genpd_get_hwmode(9), dev_pm_genpd_rpm_always_on(9), dev_pm_genpd_is_on(9), pm_genpd_inc_rejected(9), genpd_queue_power_off_work(9), genpd_power_off(9), genpd_power_on(9), genpd_power_off_work_fn(9), __genpd_runtime_suspend(9), __genpd_runtime_resume(9), genpd_runtime_suspend(9), genpd_runtime_resume(9), genpd_power_off_unused(9), genpd_sync_power_off(9), genpd_sync_power_on(9), genpd_prepare(9), genpd_finish_suspend(9), genpd_suspend_noirq(9), genpd_finish_resume(9), genpd_resume_noirq(9), genpd_freeze_noirq(9), genpd_thaw_noirq(9), genpd_poweroff_noirq(9), genpd_restore_noirq(9), genpd_complete(9), dev_pm_genpd_suspend(9), dev_pm_genpd_resume(9), pm_genpd_add_device(9), pm_genpd_remove_device(9), dev_pm_genpd_add_notifier(9), dev_pm_genpd_remove_notifier(9), pm_genpd_add_subdomain(9), pm_genpd_remove_subdomain(9), pm_genpd_init(9), pm_genpd_remove(9), struct of_genpd_provider(9), genpd_xlate_simple(9), genpd_xlate_onecell(9), genpd_add_provider(9), of_genpd_add_provider_simple(9), of_genpd_add_provider_onecell(9), of_genpd_del_provider(9), genpd_get_from_provider(9), of_genpd_add_child_ids(9), of_genpd_remove_child_ids(9), of_genpd_add_device(9), of_genpd_add_subdomain(9), of_genpd_remove_subdomain(9), of_genpd_remove_last(9), genpd_dev_pm_detach(9), genpd_dev_pm_attach(9), genpd_dev_pm_attach_by_name(9), of_genpd_parse_idle_states(9), of_genpd_sync_state(9)


source/version: ./drivers/pmdomain β€’ dated October 2026 β€’ manual: genpd_dev_pm_attach_by_id(9) β€” bye bestie, go attach those domains responsibly πŸ«Άβœ¨πŸ’–

πŸ“¦ where this page comes from