STRUCT DRM_AUDIO_COMPONENT_OPS(9)
π 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 thePOWER_DOMAIN_AUDIOpower 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 thePOWER_DOMAIN_AUDIOpower 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β setn/ctsbased 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
- 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