pwm_get(9)
π pwm_get(9) π
okay bestie, welcome to the Kernel API Manual β this is pwm_get(9) and it's literally the glow-up moment where your device finally gets its PWM. β¨
π NAME π
pwm_get β look up and request a PWM device
Like, you're not just looking at it, you're claiming it. main character energy fr fr.
πΈ SYNOPSIS πΈ
struct pwm_device * pwm_get (struct device *dev , const char *con_id );
π¦ ARGUMENTS π¦
devβ device for PWM consumer. yes bestie, that's you, the consumer, living your consumer era πcon_idβ consumer name
β¨ DESCRIPTION β¨
So here's the tea π΅ β the lookup is first attempted using DT. That's step one, no skipping ahead.
If the device was not instantiated from a device tree, then a PWM chip and a relative index get looked up via a table supplied by board setup code (peep pwm_add_table for that one π).
Once a PWM chip has been found, the specified PWM device will be requested and is ready to be used. slay. that's it. it's ready. π«Ά
π₯ RETURN π₯
A pointer to the requested PWM device β iconic, honestly π
β¦or an ERR_PTR-encoded error code on failure π (check it, bestie, don't just vibe with the pointer).
π SEE ALSO π
Kernel file ./drivers/pwm/core.c β plus the whole friend group:
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)acpi_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)
ngl, if you grabbed a PWM and you're done with it, go say hi to pwm_put(9) β don't just leave it hanging π
okay and before you close the tab β big kisses from the ./drivers/pwm girlies, this one's dated October 2026 βππ mwah!
π¦ 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