cs_amp_get_...bration_data(9)
β¨ 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 deviceof the caller. that's your device bestie. πtarget_uidβ UID to match, or0to ignore UID matching.amp_indexβ entry index to use, or-1to prevent lookup by index.out_dataβstruct cirrus_amp_cal_datawhere 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:
- (
target_uid > 0,amp_index >= 0) β UID search with fallback to using the array index. Search the calibration data for a non-zerocalTargetthat matchestarget_uid, and if found return that entry. Else, if the entry at[amp_index]hascalTarget == 0, return that entry. Else fail. - (
target_uid > 0,amp_index < 0) β UID search only. Search the calibration data for a non-zerocalTargetthat matchestarget_uid, and if found return that entry. Else fail. - (
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:
0if the entry was found-ENOENTif no entry was found-EOVERFLOWif the EFI file is corrupt- else other error value
π SEE ALSO π
Kernel file ./sound/soc/codecs/cs-amp-lib.c β plus these besties:
cs_amp_write_cal_coeffs(9)cs_amp_read_cal_coeffs(9)cs_amp_write_ambient_temp(9)cs_amp_set_efi_calibration_data(9)cs_amp_get_vendor_spkid(9)cs_amp_devm_get_vendor_specific_variant_id(9)cs_amp_create_debugfs(9)
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
- 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