drm/panel-edp: Add STA 116QHD024002
[drm/drm-misc.git] / include / sound / cs-amp-lib.h
blobf481148735e104ccaec5500b9fcf7bcd034d10fb
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) 2024 Cirrus Logic, Inc. and
4 * Cirrus Logic International Semiconductor Ltd.
5 */
7 #ifndef CS_AMP_LIB_H
8 #define CS_AMP_LIB_H
10 #include <linux/efi.h>
11 #include <linux/types.h>
13 struct cs_dsp;
15 struct cirrus_amp_cal_data {
16 u32 calTarget[2];
17 u32 calTime[2];
18 s8 calAmbient;
19 u8 calStatus;
20 u16 calR;
21 } __packed;
23 struct cirrus_amp_efi_data {
24 u32 size;
25 u32 count;
26 struct cirrus_amp_cal_data data[];
27 } __packed;
29 /**
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 {
39 unsigned int alg_id;
40 int mem_region;
41 const char *ambient;
42 const char *calr;
43 const char *status;
44 const char *checksum;
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,
55 efi_guid_t *guid,
56 unsigned long *size,
57 void *buf);
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 */