summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2025-11-11 18:46:59 +0000
committerMark Brown <broonie@kernel.org>2025-11-11 18:46:59 +0000
commit2b0d5d9b39489b9d8171896e8e24d8632c3dc807 (patch)
treec2c39468423ec04ad38ccd05f806b14f0ee5ae78 /include
parent23523e9398efeee6a5741cf97052babf6fb2a808 (diff)
parent32172cf3cb543a04c41a1677c97a38e60cad05b6 (diff)
downloadlwn-2b0d5d9b39489b9d8171896e8e24d8632c3dc807.tar.gz
lwn-2b0d5d9b39489b9d8171896e8e24d8632c3dc807.zip
ASoC: cs35l56: Support for restoring calibration on
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: These two patches add ALSA controls to support restoring factory calibration during OS boot on ChromeOS. ChromeOS applies calibration during boot using a process that has restricted access permissions. This process needs ALSA controls for all settings that it must restore.
Diffstat (limited to 'include')
-rw-r--r--include/sound/cs35l56.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/sound/cs35l56.h b/include/sound/cs35l56.h
index 0a740a99ad31..883f6a7e50aa 100644
--- a/include/sound/cs35l56.h
+++ b/include/sound/cs35l56.h
@@ -16,6 +16,8 @@
#include <linux/spi/spi.h>
#include <sound/cs-amp-lib.h>
+struct snd_ctl_elem_value;
+
#define CS35L56_DEVID 0x0000000
#define CS35L56_REVID 0x0000004
#define CS35L56_RELID 0x000000C
@@ -268,6 +270,10 @@
#define CS35L56_CAL_STATUS_SUCCESS 1
#define CS35L56_CAL_STATUS_OUT_OF_RANGE 3
+#define CS35L56_CAL_SET_STATUS_UNKNOWN 0
+#define CS35L56_CAL_SET_STATUS_DEFAULT 1
+#define CS35L56_CAL_SET_STATUS_SET 2
+
#define CS35L56_CONTROL_PORT_READY_US 2200
#define CS35L56_HALO_STATE_POLL_US 1000
#define CS35L56_HALO_STATE_TIMEOUT_US 250000
@@ -363,6 +369,7 @@ extern const struct regmap_config cs35l63_regmap_i2c;
extern const struct regmap_config cs35l63_regmap_sdw;
extern const struct cirrus_amp_cal_controls cs35l56_calibration_controls;
+extern const char * const cs35l56_cal_set_status_text[3];
extern const char * const cs35l56_tx_input_texts[CS35L56_NUM_INPUT_SRC];
extern const unsigned int cs35l56_tx_input_values[CS35L56_NUM_INPUT_SRC];
@@ -381,6 +388,8 @@ int cs35l56_runtime_suspend_common(struct cs35l56_base *cs35l56_base);
int cs35l56_runtime_resume_common(struct cs35l56_base *cs35l56_base, bool is_soundwire);
void cs35l56_init_cs_dsp(struct cs35l56_base *cs35l56_base, struct cs_dsp *cs_dsp);
int cs35l56_get_calibration(struct cs35l56_base *cs35l56_base);
+int cs35l56_stash_calibration(struct cs35l56_base *cs35l56_base,
+ const struct cirrus_amp_cal_data *data);
ssize_t cs35l56_calibrate_debugfs_write(struct cs35l56_base *cs35l56_base,
const char __user *from, size_t count,
loff_t *ppos);
@@ -396,6 +405,8 @@ ssize_t cs35l56_cal_data_debugfs_write(struct cs35l56_base *cs35l56_base,
void cs35l56_create_cal_debugfs(struct cs35l56_base *cs35l56_base,
const struct cs35l56_cal_debugfs_fops *fops);
void cs35l56_remove_cal_debugfs(struct cs35l56_base *cs35l56_base);
+int cs35l56_cal_set_status_get(struct cs35l56_base *cs35l56_base,
+ struct snd_ctl_elem_value *uvalue);
int cs35l56_read_prot_status(struct cs35l56_base *cs35l56_base,
bool *fw_missing, unsigned int *fw_version);
void cs35l56_log_tuning(struct cs35l56_base *cs35l56_base, struct cs_dsp *cs_dsp);