acpi_pwm_get(9)
π acpi_pwm_get(9) β like, the Kernel API Manual page, bestie β¨
Okay so you're in the Kernel API Manual and the star of the show is acpi_pwm_get(9). Buckle up, this one's short but she's got lore π
β¨ NAME β¨
acpi_pwm_get β request a PWM via parsing "pwms" property in ACPI. That's the whole vibe, no cap π¦
πΈ SYNOPSIS πΈ
struct pwm_device * acpi_pwm_get (const struct fwnode_handle *fwnode );
Literally just hand her a firmware node and she'll go find your PWM, periodt π
π ARGUMENTS π
fwnodeβ the firmware node you want her to pull the"pwms"property out of. That's it. That's the assignment π«Ά
π§ DESCRIPTION π§
So here's the tea: she returns the PWM device that got parsed from the fwnode plus the index specified in the "pwms" property β¨ β or a negative error-code if it all went sideways π. Anything she parses out of the device tree gets stored in the returned PWM device object, so it's all bundled up cute and ready for you π
She's analogous to of_pwm_get β the way that family resemblance is giving main character energy β except con_id is not yet supported, so don't come for her about it π
And your ACPI entries? They gotta look exactly like this, no improvising β
Package () {"pwms", Package () { <PWM device reference>, <PWM index>, <PWM period> [, <PWM flags>]}}
Like, exactly that shape. The <PWM flags> part is optional but the rest is non-negotiable bestie π
π₯ RETURN π₯
A pointer to the requested PWM device π β or, if things went badly, an ERR_PTR-encoded error code. So yeah, vibe check your return value before you dereference it, fr fr π
π SEE ALSO π
Everything else in the PWM cinematic universe, all iconic, all worth a read π β and the kernel file ./drivers/pwm/core.c:
pwm_round_waveform_might_sleep(9)pwm_get_waveform_might_sleep(9)pwm_set_waveform_might_sleep(9)pwm_apply_might_sleep(9)pwm_apply_atomic(9)pwm_get_state_hw(9)pwm_adjust_config(9)pwm_capture(9)pwm_request_from_chip(9)of_pwm_get(9)pwm_get(9)pwm_put(9)devm_pwm_get(9)devm_fwnode_pwm_get(9)__pwmchip_add(9)pwmchip_remove(9)pwm_add_table(9)pwm_remove_table(9)
Okay that's the whole page, you ate that π
β¨ This cutie lives in ./drivers/pwm and she's dated October 2026 β go forth and request your PWMs responsibly, bestie π«Άππ¦
π¦ 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