-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ALSA: cs35l56: Apply calibration from EFI
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: Factory calibration of the speakers stores the calibration information into an EFI variable. This set of patches adds support for applying speaker calibration data from that EFI variable. The HDA patch (#5) depends on the ASoC patches #2 and #3
- Loading branch information
Showing
12 changed files
with
529 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* | ||
* Copyright (C) 2024 Cirrus Logic, Inc. and | ||
* Cirrus Logic International Semiconductor Ltd. | ||
*/ | ||
|
||
#ifndef CS_AMP_LIB_H | ||
#define CS_AMP_LIB_H | ||
|
||
#include <linux/efi.h> | ||
#include <linux/types.h> | ||
|
||
struct cs_dsp; | ||
|
||
struct cirrus_amp_cal_data { | ||
u32 calTarget[2]; | ||
u32 calTime[2]; | ||
s8 calAmbient; | ||
u8 calStatus; | ||
u16 calR; | ||
} __packed; | ||
|
||
struct cirrus_amp_efi_data { | ||
u32 size; | ||
u32 count; | ||
struct cirrus_amp_cal_data data[]; | ||
} __packed; | ||
|
||
/** | ||
* struct cirrus_amp_cal_controls - definition of firmware calibration controls | ||
* @alg_id: ID of algorithm containing the controls. | ||
* @mem_region: DSP memory region containing the controls. | ||
* @ambient: Name of control for calAmbient value. | ||
* @calr: Name of control for calR value. | ||
* @status: Name of control for calStatus value. | ||
* @checksum: Name of control for checksum value. | ||
*/ | ||
struct cirrus_amp_cal_controls { | ||
unsigned int alg_id; | ||
int mem_region; | ||
const char *ambient; | ||
const char *calr; | ||
const char *status; | ||
const char *checksum; | ||
}; | ||
|
||
int cs_amp_write_cal_coeffs(struct cs_dsp *dsp, | ||
const struct cirrus_amp_cal_controls *controls, | ||
const struct cirrus_amp_cal_data *data); | ||
int cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid, int amp_index, | ||
struct cirrus_amp_cal_data *out_data); | ||
#endif /* CS_AMP_LIB_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.