cs_amp_set_...bration_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« cs_amp_set_efi_calibration_data β€” from the Kernel API Manual ✨

okay so bestie, this is from the Kernel API Manual (section 9, kernel API vibes πŸ’…) and it's literally the page for cs_amp_set_...bration_data(9) β€” yes the title is truncated like that, that's just how it's printed, don't come for me 🫢. Anyway, it's giving "write a calibration data entry to EFI" and honestly it slays.


✨ NAME ✨

cs_amp_set_efi_calibration_data β€” write a calibration data entry to EFI. that's it, that's the whole job, and she does it πŸ’–


🌸 SYNOPSIS 🌸

int cs_amp_set_efi_calibration_data (struct device *dev , int amp_index
, int num_amps , const struct cirrus_amp_cal_data *in_data );

like, four args, one int back, no cap πŸ¦‹


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the struct device of the caller. your device, your business ✨
  • amp_index β€” the entry index to use, or -1 to use any available slot. -1 is the "idc just find me a spot" energy πŸ™ˆ
  • num_amps β€” the maximum number of amps to reserve slots for, or -1 to ignore. so -1 means don't reserve, just vibe 🌈
  • in_data β€” the struct cirrus_amp_cal_data entry to be written to EFI. this is the actual data getting shipped off to EFI-land πŸ’Œ

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea, and it's a whole priority list πŸ‘‘

if a Vendor-specific variable exists, it will be updated. else if the Cirrus variable exists, it will be updated. else the Cirrus variable will be created. periodt β€” that's the order, don't mess with the order πŸ’…


now, if amp_index >= 0, the data gets placed in this entry of the calibration data array, overwriting what was in that entry 😭 (yes, straight up replacing it). and any other entries with the same calTarget will be marked empty. so like, one target, one slot, we don't do duplicates here 🫢


if amp_index < 0 and in_data->calTarget matches any existing entry, that entry will be overwritten. else, the first available free entry will be used β€” and if there are no free entries at all, it extends the size of the EFI variable πŸ”₯ iconic problem-solving honestly.


if num_amps > 0, the EFI variable will be sized to contain at least this many calibration entries, with any new entries marked empty. lowkey just setting aside the seats before the guests arrive πŸŽ€


⭐ RETURN ⭐

  • 0 β€” the write was successful. we love a clean win 🌟
  • -EFBIG β€” space could not be made in the EFI file to add the entry. tragic, genuinely 😭
  • -EACCES β€” it was not possible to read or write the EFI variable. access said no ma'am πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./sound/soc/codecs/cs-amp-lib.c β€” that's the home base bestie ✨

go read them, iykyk πŸ‘‘πŸ’œ


and that's the whole page, bestie 🫢 this cutie lives in ./sound/soc/codecs, dated October 2026, and she's listed under cs_amp_set_...bration_data(9) β€” stan her, she writes calibration data to EFI and she does it flawlessly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from