STRUCT DRM_AUDIO_COMPONENT_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct drm_audio_component_ops(9) πŸ’…

okay so bestie, this one is from the Kernel API Manual, and it's genuinely one of those "the two halves of your laptop finally talk to each other" situations. Let's get into it ✨


🌸 NAME 🌸

struct drm_audio_component_ops β€” the ops that the DRM driver implements, and that the hda driver calls. like, DRM writes the menu, hda places the order. iykyk 🫢


✨ SYNOPSIS ✨

struct drm_audio_component_ops {
    struct module *owner;
    unsigned long (*get_power)(struct device *);
    void (*put_power)(struct device *, unsigned long);
    void (*codec_wake_override)(struct device *, bool enable);
    int (*get_cdclk_freq)(struct device *);
    int (*sync_audio_rate)(struct device *, int port, int pipe, int rate);
    int (*get_eld)(struct device *, int port, int pipe, bool *enabled,
                   unsigned char *buf, int max_bytes);
 };

like, there she is. the whole squad of function pointers πŸ’–


πŸŽ€ Members πŸŽ€

  • owner β€” the drm module to pin down πŸ”’
  • get_power β€” grab the POWER_DOMAIN_AUDIO power well ⚑

It politely requests that the power well be turned on ✨

Returns a wakeref cookie β€” and bestie, you must pass that cookie back to the matching call to put_power. no stealing cookies and running away, that's not the vibe πŸ™ˆ

  • put_power β€” release the POWER_DOMAIN_AUDIO power well πŸŒ™

Lets the power well be turned off. bye energy bill, slay πŸ’Έ

  • codec_wake_override β€” enable/disable the codec wake signal πŸ“‘
  • get_cdclk_freq β€” get the Core Display Clock in kHz ⏰
  • sync_audio_rate β€” set n/cts based on the sample rate 🎡

This one gets called from the audio driver. so the audio driver sets the sample rate, and then it calls this function to set n/cts. teamwork, no cap 🫢

  • get_eld β€” fill the audio state and ELD bytes for the given port 🎧

Called from the audio driver to get the HDMI/DP audio state of the given digital port β€” and while it's at it, it fetches ELD bytes into the given pointer. two-for-one, we love efficiency ✨

Returns the byte size of the original ELD (not the actually copied size!), zero for an invalid ELD, or a negative error code. so like, three possible moods 😭

heads up babe: the returned size may be over max_bytes β€” and if that happens, it means only a part of the ELD actually got copied to the buffer. so don't go reading past what you got πŸ‘€

πŸ” SEE ALSO πŸ”

Kernel file ./include/drm/drm_audio_component.h, struct drm_audio_component_audio_ops(9), struct drm_audio_component(9) 🌈


okay that's the whole page, you ate that πŸ’… go read the header file next bestie, it's iconic πŸ‘‘

signed, sealed, delivered from ./include/drm β€” October 2026 β€” Kernel API Manual gang πŸŽ€

πŸ“¦ where this page comes from