1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2024 Cirrus Logic, Inc. and
4 * Cirrus Logic International Semiconductor Ltd.
10 #include <linux/efi.h>
11 #include <linux/types.h>
15 struct cirrus_amp_cal_data
{
23 struct cirrus_amp_efi_data
{
26 struct cirrus_amp_cal_data data
[];
30 * struct cirrus_amp_cal_controls - definition of firmware calibration controls
31 * @alg_id: ID of algorithm containing the controls.
32 * @mem_region: DSP memory region containing the controls.
33 * @ambient: Name of control for calAmbient value.
34 * @calr: Name of control for calR value.
35 * @status: Name of control for calStatus value.
36 * @checksum: Name of control for checksum value.
38 struct cirrus_amp_cal_controls
{
47 int cs_amp_write_cal_coeffs(struct cs_dsp
*dsp
,
48 const struct cirrus_amp_cal_controls
*controls
,
49 const struct cirrus_amp_cal_data
*data
);
50 int cs_amp_get_efi_calibration_data(struct device
*dev
, u64 target_uid
, int amp_index
,
51 struct cirrus_amp_cal_data
*out_data
);
53 struct cs_amp_test_hooks
{
54 efi_status_t (*get_efi_variable
)(efi_char16_t
*name
,
59 int (*write_cal_coeff
)(struct cs_dsp
*dsp
,
60 const struct cirrus_amp_cal_controls
*controls
,
61 const char *ctl_name
, u32 val
);
64 extern const struct cs_amp_test_hooks
* const cs_amp_test_hooks
;
66 #endif /* CS_AMP_LIB_H */