cs_amp_get_...bration_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay bestie, welcome to the Kernel API Manual πŸ’– β€” not me hyping up a kernel function, but this is the page for cs_amp_get_...bration_data(9), and the actual function is cs_amp_get_efi_calibration_data. Its whole job? get an entry from calibration data in EFI. lowkey iconic, highkey useful. πŸŽ€

🌸 SYNOPSIS 🌸

here's the signature, copy it exactly and don't let autocorrect touch it:

int cs_amp_get_efi_calibration_data (struct device *dev , u64 target_uid
, int amp_index , struct cirrus_amp_cal_data *out_data );

πŸ¦‹ ARGUMENTS πŸ¦‹

these are the four args, no cap:

  • dev β€” struct device of the caller. that's your device bestie. πŸ’…
  • target_uid β€” UID to match, or 0 to ignore UID matching.
  • amp_index β€” entry index to use, or -1 to prevent lookup by index.
  • out_data β€” struct cirrus_amp_cal_data where the entry will be copied. it's the output spot. 🫢

πŸ”₯ DESCRIPTION πŸ”₯

this function can perform 3 types of lookup, and yes we're listing all three because details are the moment:

  1. (target_uid > 0, amp_index >= 0) β€” UID search with fallback to using the array index. Search the calibration data for a non-zero calTarget that matches target_uid, and if found return that entry. Else, if the entry at [amp_index] has calTarget == 0, return that entry. Else fail.
  2. (target_uid > 0, amp_index < 0) β€” UID search only. Search the calibration data for a non-zero calTarget that matches target_uid, and if found return that entry. Else fail.
  3. (target_uid == 0, amp_index >= 0) β€” Array index fetch only. Return the entry at [amp_index].

An array lookup will be skipped if amp_index exceeds the number of entries in the calibration array, and in this case the return will be -ENOENT. An out-of-range amp_index does not prevent matching by target_uid β€” it has the same effect as passing amp_index < 0. 🫢

If the EFI data is too short to be a valid entry, or the entry count in the EFI data overflows the actual length of the data, this function returns -EOVERFLOW. πŸ’€

⭐ RETURN ⭐

the return values are giving clean error-code realness:

  • 0 if the entry was found
  • -ENOENT if no entry was found
  • -EOVERFLOW if the EFI file is corrupt
  • else other error value

🌈 SEE ALSO 🌈

Kernel file ./sound/soc/codecs/cs-amp-lib.c β€” plus these besties:

mwah πŸ’‹ β€” signed off from ./sound/soc/codecs, dated October 2026, for the page cs_amp_get_...bration_data(9). periodt. πŸ’–

πŸ“¦ where this page comes from