Skip to contentSkip to conversation

ALSA: cs35l56: Add support for factory calibration

PATCH Superseded Richard Fitzgerald 3 participants 17 messages Oct 16, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Richard Fitzgerald

author maintainer
#0 lore raw

cover ALSA: cs35l56: Add support for factory calibration

Until now, all products with an amplifier supported by the cs35l56 driver have shipped with Microsoft Windows pre-installed. The factory calibration of speaker protection has therefore been done using the Windows driver.

However, products that ship with a Linux-based distro must be able to perform the factory calibration procedure from within the Linux-based environment. This patch series adds that support.

NOTE: unfortunately this is yet another series that is mainly ASoC but also needs some changes to the HDA driver, and they have build dependencies on the ASoC code. I suggest taking this all through Mark's tree and we'll avoid sending any other commits to the HDA driver until it has all landed in Takashi's tree.

Richard Fitzgerald (11):
ASoC: cs35l56: Read silicon ID during initialization and save it
ASoC: cs-amp-lib: Add helpers for factory calibration
ASoC: cs35l56: Add common code for factory calibration
ASoC: cs35l56: Create sysfs files for factory calibration
ALSA: hda/cs35l56: Create sysfs files for factory calibration
ASoC: cs-amp-lib-test: Add cases for factory calibration helpers
ASoC: cs-amp-lib: Return attributes from cs_amp_get_efi_variable()
ASoC: cs-amp-lib: Add function to write calibration to EFI
ASoC: cs35l56: Add calibration command to store into UEFI
ALSA: hda/cs35l56: Set cal_index to the amp index
ASoC: cs-amp-lib-test: Add test cases for
cs_amp_set_efi_calibration_data()

 include/sound/cs-amp-lib.h                 |   24 +-
 include/sound/cs35l56.h                    |   20 +
 sound/hda/codecs/side-codecs/Kconfig       |   15 +
 sound/hda/codecs/side-codecs/cs35l56_hda.c |  141 +-
 sound/soc/codecs/Kconfig                   |   18 +
 sound/soc/codecs/cs-amp-lib-test.c         | 1491 +++++++++++++++++++-
 sound/soc/codecs/cs-amp-lib.c              |  319 ++++-
 sound/soc/codecs/cs35l56-shared.c          |  321 ++++-
 sound/soc/codecs/cs35l56.c                 |  182 +++
 9 files changed, 2477 insertions(+), 54 deletions(-)
Signature · 1 line
2.47.3
author maintainer
#1 lore raw

PATCH 1/11 ASoC: cs35l56: Read silicon ID during initialization and save it

Read the silicon ID from the amp during one-time cs35l56_hw_init() and store it in struct cs35l56_base, instead of reading it from registers every time it is needed.

Note that marking it non-volatile without a default in regmap isn't a suitable alternative because this causes regcache_sync() to always write the cached value out to the registers. This could trigger a bus fault interrupt inside the amp, which we want to avoid.

---
 include/sound/cs35l56.h           |  1 +
 sound/soc/codecs/cs35l56-shared.c | 53 +++++++++++++++----------------
 2 files changed, 27 insertions(+), 27 deletions(-)
include/sound/cs35l56.h +1 -0
index ab044ce2aa8b..ec9b1072d6be 100644
@@ -309,6 +309,7 @@ struct cs35l56_base {
 	struct cs35l56_spi_payload *spi_payload_buf;
 	const struct cs35l56_fw_reg *fw_reg;
 	const struct cirrus_amp_cal_controls *calibration_controls;
+	u64 silicon_uid;
 };
 
 static inline bool cs35l56_is_otp_register(unsigned int reg)
sound/soc/codecs/cs35l56-shared.c +26 -27

95 lines not on this page · raw message

Signature · 1 line
2.47.3
author maintainer
#2 lore raw

PATCH 2/11 ASoC: cs-amp-lib: Add helpers for factory calibration

In reply to Richard Fitzgerald

Add two helper functions for performing factory calibration.

cs_amp_read_cal_coeffs() reads the results of a calibration into a struct cirrus_amp_cal_data. The calTime member is also filled in with the current time (which is defined to be in Windows format).

cs_amp_write_ambient_temp() writes a given temperature value to the firmware control for ambient temperature.

The cs_amp_cal_target_u64() has been moved into the header file so that it can be used by the calling code and by KUnit tests.

---
 include/sound/cs-amp-lib.h    |  11 +++
 sound/soc/codecs/cs-amp-lib.c | 122 ++++++++++++++++++++++++++++++++--
 2 files changed, 128 insertions(+), 5 deletions(-)
include/sound/cs-amp-lib.h +11 -0
index 43a87a39110c..e4df0736039a 100644
@@ -47,10 +47,21 @@ struct cirrus_amp_cal_controls {
 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_read_cal_coeffs(struct cs_dsp *dsp,
+			   const struct cirrus_amp_cal_controls *controls,
+			   struct cirrus_amp_cal_data *data);
+int cs_amp_write_ambient_temp(struct cs_dsp *dsp,
+			      const struct cirrus_amp_cal_controls *controls,
+			      u32 temp);
 int cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid, int amp_index,
 				    struct cirrus_amp_cal_data *out_data);
 int cs_amp_get_vendor_spkid(struct device *dev);
 
+static inline u64 cs_amp_cal_target_u64(const struct cirrus_amp_cal_data *data)
+{
+	return ((u64)data->calTarget[1] << 32) | data->calTarget[0];
+}
+
 struct cs_amp_test_hooks {
 	efi_status_t (*get_efi_variable)(efi_char16_t *name,
 					 efi_guid_t *guid,
sound/soc/codecs/cs-amp-lib.c +117 -5

161 lines not on this page · raw message

Signature · 1 line
2.47.3
author maintainer
#3 lore raw

PATCH 3/11 ASoC: cs35l56: Add common code for factory calibration

In reply to Richard Fitzgerald

Add core code to support factory calibration. This can be used by both the ASoC and HDA drivers.

This code consists of implementations of sysfs handlers for three sysfs files used to start factory calibration and read the results.

Sysfs is used here so that access will be restricted. These are mainly intended to be used by manufacturers and in service centres after a repair. It is not something that a normal user should ever touch.

Calibration affects the matching of the amp hardware to the external speakers. If not done correctly (either accidentally or maliciously) it can cause the speakers to be under-protected. The PC manufacturer's tunings can limit the allowed range of a calibration result but some speakers have very wide manufacturing tolerances, so the allowed range could be wide.

This is not a full implementation of sysfs files. There are some requirements to synchronize with the rest of the amp driver, and the way this is done is significantly different between ASoC and HDA. Therefore cs35l56-shared.c provides the main part of the sysfs file handlers, but the files themselves are defined in the ASoC and HDA drivers with suitable handling before calling into this shared code.

The cal_data sysfs allows the calibration to be read and also for a previous calibration to be written (for systems where the storage is not something directly accessible to drivers, such as on filesystems). As a precaution cal_data can only be written if the driver does not already have valid calibration. Code outside the kernel should treat the content of cal_data as an opaque blob, so the struct definition is not exported as a user API.

---
 include/sound/cs35l56.h           |  18 +++
 sound/soc/codecs/Kconfig          |   3 +
 sound/soc/codecs/cs35l56-shared.c | 253 +++++++++++++++++++++++++++++-
 3 files changed, 269 insertions(+), 5 deletions(-)
include/sound/cs35l56.h +18 -0
index ec9b1072d6be..4ed738615021 100644
@@ -62,6 +62,8 @@
 #define CS35L56_IRQ1_MASK_8				0x000E0AC
 #define CS35L56_IRQ1_MASK_18				0x000E0D4
 #define CS35L56_IRQ1_MASK_20				0x000E0DC
+#define CS35L56_MIXER_NGATE_CH1_CFG			0x0010004
+#define CS35L56_MIXER_NGATE_CH2_CFG			0x0010008
 #define CS35L56_DSP_MBOX_1_RAW				0x0011000
 #define CS35L56_DSP_VIRTUAL1_MBOX_1			0x0011020
 #define CS35L56_DSP_VIRTUAL1_MBOX_2			0x0011024
@@ -177,6 +179,9 @@
 /* IRQ1_EINT_8 */
 #define CS35L56_TEMP_ERR_EINT1_MASK			0x80000000
 
+/* MIXER_NGATE_CHn_CFG */
+#define CS35L56_AUX_NGATE_CHn_EN			0x00000001
+
 /* Mixer input sources */
 #define CS35L56_INPUT_SRC_NONE				0x00
 #define CS35L56_INPUT_SRC_ASP1RX1			0x08
@@ -243,6 +248,7 @@
 #define CS35L56_MBOX_CMD_AUDIO_PLAY			0x0B000001
 #define CS35L56_MBOX_CMD_AUDIO_PAUSE			0x0B000002
 #define CS35L56_MBOX_CMD_AUDIO_REINIT			0x0B000003
+#define CS35L56_MBOX_CMD_AUDIO_CALIBRATION		0x0B000006
 #define CS35L56_MBOX_CMD_HIBERNATE_NOW			0x02000001
 #define CS35L56_MBOX_CMD_WAKEUP				0x02000002
 #define CS35L56_MBOX_CMD_PREVENT_AUTO_HIBERNATE		0x02000003
@@ -264,6 +270,9 @@
 #define CS35L56_RESET_PULSE_MIN_US			1100
 #define CS35L56_WAKE_HOLD_TIME_US			1000
 
+#define CS35L56_CALIBRATION_POLL_US			(100 * USEC_PER_MSEC)
+#define CS35L56_CALIBRATION_TIMEOUT_US			(5 * USEC_PER_SEC)
+
 #define CS35L56_SDW1_PLAYBACK_PORT			1
 #define CS35L56_SDW1_CAPTURE_PORT			3
 
@@ -294,6 +303,7 @@ struct cs35l56_fw_reg {
 struct cs35l56_base {
 	struct device *dev;
 	struct regmap *regmap;
+	struct cs_dsp *dsp;
 	int irq;
 	struct mutex irq_lock;
 	u8 type;
@@ -359,6 +369,14 @@ 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);
+ssize_t cs35l56_calibrate_sysfs_store(struct cs35l56_base *cs35l56_base,
+				      const char *buf, size_t count);
+ssize_t cs35l56_cal_ambient_sysfs_store(struct cs35l56_base *cs35l56_base,
+					const char *buf, size_t count);
+ssize_t cs35l56_cal_data_sysfs_read(struct cs35l56_base *cs35l56_base,
+				    char *buf, loff_t pos, size_t count);
+ssize_t cs35l56_cal_data_sysfs_write(struct cs35l56_base *cs35l56_base,
+				     const char *buf, loff_t pos, size_t count);
 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);
sound/soc/codecs/Kconfig +3 -0
index 160c07699a8b..5917bf5a72f8 100644
@@ -896,6 +896,9 @@ config SND_SOC_CS35L56_SDW
 	help
 	  Enable support for Cirrus Logic CS35L56 boosted amplifier with SoundWire control
 
+config SND_SOC_CS35L56_CAL_SYSFS_COMMON
+	bool
+
 config SND_SOC_CS40L50
 	tristate "Cirrus Logic CS40L50 CODEC"
 	depends on MFD_CS40L50_CORE
sound/soc/codecs/cs35l56-shared.c +248 -5

304 lines not on this page · raw message

Signature · 1 line
2.47.3
author maintainer
#4 lore raw

PATCH 4/11 ASoC: cs35l56: Create sysfs files for factory calibration

In reply to Richard Fitzgerald

Create sysfs files that can be used to perform factory calibration.

During manufacture, the production line must perform a factory calibration of the amps. This patch adds this functionality via sysfs files.

Sysfs is used here to restrict access to the factory calibration. It is only intended to be used during manufacture. It is not something that a normal user should ever touch. Calibration affects the matching of the amp hardware to the external speakers. If not done correctly it can cause the speakers to be under-protected.

As this is only needed during manufacture, there is no need for this to be available in a normal system so a Kconfig item has been added to enable this. The new Kconfig option is inside a sub-menu because items do not group and indent if the parent is invisible or there are multiple parent dependencies. Anyway the sub-menu reduces the clutter.

---
 sound/soc/codecs/Kconfig   |  15 +++
 sound/soc/codecs/cs35l56.c | 182 +++++++++++++++++++++++++++++++++++++
 2 files changed, 197 insertions(+)
sound/soc/codecs/Kconfig +15 -0
index 5917bf5a72f8..4bb57223ef82 100644
@@ -899,6 +899,21 @@ config SND_SOC_CS35L56_SDW
 config SND_SOC_CS35L56_CAL_SYSFS_COMMON
 	bool
 
+menu "CS35L56 driver options"
+	depends on SND_SOC_CS35L56
+
+config SND_SOC_CS35L56_CAL_SYSFS
+	bool "CS35L56 create sysfs for factory calibration"
+	default N
+	select SND_SOC_CS35L56_CAL_SYSFS_COMMON
+	help
+	  Create sysfs entries used during factory-line manufacture
+	  for factory calibration.
+	  This is not needed for normal use.
+
+	  If unsure select "N".
+endmenu
+
 config SND_SOC_CS40L50
 	tristate "Cirrus Logic CS40L50 CODEC"
 	depends on MFD_CS40L50_CORE
sound/soc/codecs/cs35l56.c +182 -0

224 lines not on this page · raw message

Signature · 1 line
2.47.3
author maintainer
#5 lore raw

PATCH 5/11 ALSA: hda/cs35l56: Create sysfs files for factory calibration

In reply to Richard Fitzgerald

Create sysfs files that can be used to perform factory calibration.

During manufacture, the production line must perform a factory calibration of the amps. This patch adds this functionality via sysfs files.

Sysfs is used here to restrict access to the factory calibration. It is only intended to be used during manufacture. It is not something that a normal user should ever touch. Calibration affects the matching of the amp hardware to the external speakers. If not done correctly it can cause the speakers to be under-protected.

As this is only needed during manufacture, there is no need for this to be available in a normal system so a Kconfig item has been added to enable this. The new Kconfig option is inside a sub-menu because items do not group and indent if the parent is invisible or there are multiple parent dependencies. Anyway the sub-menu reduces the clutter.

cs35l56_hda_apply_calibration() has been changed to return an error code that can be reported back through the sysfs write. The original call to this function doesn't check the return code because in normal use it doesn't matter whether this fails - the firmware will default to a safe calibration for the platform. But tooling using sysfs might want to know if there was an error.

---
 sound/hda/codecs/side-codecs/Kconfig       |  15 +++
 sound/hda/codecs/side-codecs/cs35l56_hda.c | 139 ++++++++++++++++++++-
 2 files changed, 149 insertions(+), 5 deletions(-)
sound/hda/codecs/side-codecs/Kconfig +15 -0
index cbf1847896bc..0218aa41bba2 100644
@@ -88,6 +88,21 @@ config SND_HDA_SCODEC_CS35L56_SPI
 	  Say Y or M here to include CS35L56 amplifier support with
 	  SPI control.
 
+menu "CS35L56 driver options"
+	depends on SND_HDA_SCODEC_CS35L56
+
+config SND_HDA_SCODEC_CS35L56_CAL_SYSFS
+	bool "CS35L56 create sysfs for factory calibration"
+	default N
+	select SND_SOC_CS35L56_CAL_SYSFS_COMMON
+	help
+	  Create sysfs entries used during factory-line manufacture
+	  for factory calibration.
+	  This is not needed for normal use.
+
+	  If unsure select "N".
+endmenu
+
 config SND_HDA_SCODEC_TAS2781
 	tristate
 	select SND_HDA_GENERIC
sound/hda/codecs/side-codecs/cs35l56_hda.c +134 -5

179 lines not on this page · raw message

Signature · 1 line
2.47.3
#6 lore raw

Re: [PATCH 05/11] ALSA: hda/cs35l56: Create sysfs files for factory calibration

Quoted 18 lines · Richard Fitzgerald

Create sysfs files that can be used to perform factory calibration.

During manufacture, the production line must perform a factory calibration of the amps. This patch adds this functionality via sysfs files.

Sysfs is used here to restrict access to the factory calibration. It is only intended to be used during manufacture. It is not something that a normal user should ever touch. Calibration affects the matching of the amp hardware to the external speakers. If not done correctly it can cause the speakers to be under-protected.

As this is only needed during manufacture, there is no need for this to be available in a normal system so a Kconfig item has been added to enable this. The new Kconfig option is inside a sub-menu because items do not group and indent if the parent is invisible or there are multiple parent dependencies. Anyway the sub-menu reduces the clutter.

Quoted 8 lines

cs35l56_hda_apply_calibration() has been changed to return an error code that can be reported back through the sysfs write. The original call to this function doesn't check the return code because in normal use it doesn't matter whether this fails - the firmware will default to a safe calibration for the platform. But tooling using sysfs might want to know if there was an error.

What kind of data format should be written to calibrate sysfs entry? Since those are no trivial files, we may need to document the formats.

Also, the scenario isn't clear -- who should write this sysfs at which moment? e.g. is this supposed to be set up at each boot?

thanks,

Takashi

Quoted 222 lines
---
 sound/hda/codecs/side-codecs/Kconfig       |  15 +++
 sound/hda/codecs/side-codecs/cs35l56_hda.c | 139 ++++++++++++++++++++-
 2 files changed, 149 insertions(+), 5 deletions(-)
sound/hda/codecs/side-codecs/Kconfig +15 -0
index cbf1847896bc..0218aa41bba2 100644
@@ -88,6 +88,21 @@ config SND_HDA_SCODEC_CS35L56_SPI
 	  Say Y or M here to include CS35L56 amplifier support with
 	  SPI control.
 
+menu "CS35L56 driver options"
+	depends on SND_HDA_SCODEC_CS35L56
+
+config SND_HDA_SCODEC_CS35L56_CAL_SYSFS
+	bool "CS35L56 create sysfs for factory calibration"
+	default N
+	select SND_SOC_CS35L56_CAL_SYSFS_COMMON
+	help
+	  Create sysfs entries used during factory-line manufacture
+	  for factory calibration.
+	  This is not needed for normal use.
+
+	  If unsure select "N".
+endmenu
+
 config SND_HDA_SCODEC_TAS2781
 	tristate
 	select SND_HDA_GENERIC
sound/hda/codecs/side-codecs/cs35l56_hda.c +134 -5
index 5bb1c4ebeaf3..4a1bd934887a 100644
@@ -548,20 +548,24 @@ static void cs35l56_hda_release_firmware_files(const struct firmware *wmfw_firmw
 	kfree(coeff_filename);
 }
 
-static void cs35l56_hda_apply_calibration(struct cs35l56_hda *cs35l56)
+static int cs35l56_hda_apply_calibration(struct cs35l56_hda *cs35l56)
 {
 	int ret;
 
 	if (!cs35l56->base.cal_data_valid || cs35l56->base.secured)
-		return;
+		return -EACCES;
 
 	ret = cs_amp_write_cal_coeffs(&cs35l56->cs_dsp,
 				      &cs35l56_calibration_controls,
 				      &cs35l56->base.cal_data);
-	if (ret < 0)
+	if (ret < 0) {
 		dev_warn(cs35l56->base.dev, "Failed to write calibration: %d\n", ret);
-	else
-		dev_info(cs35l56->base.dev, "Calibration applied\n");
+		return ret;
+	}
+
+	dev_info(cs35l56->base.dev, "Calibration applied\n");
+
+	return 0;
 }
 
 static void cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
@@ -669,7 +673,9 @@ static void cs35l56_hda_fw_load(struct cs35l56_hda *cs35l56)
 	if (ret)
 		dev_dbg(cs35l56->base.dev, "%s: cs_dsp_run ret %d\n", __func__, ret);
 
+	/* Don't need to check return code, it's not fatal if this fails */
 	cs35l56_hda_apply_calibration(cs35l56);
+
 	ret = cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_AUDIO_REINIT);
 	if (ret)
 		cs_dsp_stop(&cs35l56->cs_dsp);
@@ -695,6 +701,126 @@ static void cs35l56_hda_dsp_work(struct work_struct *work)
 	cs35l56_hda_fw_load(cs35l56);
 }
 
+static ssize_t calibrate_store(struct device *dev, struct device_attribute *attr,
+			       const char *buf, size_t count)
+{
+	struct cs35l56_hda *cs35l56 = dev_get_drvdata(dev);
+	ssize_t ret;
+
+	ret = pm_runtime_resume_and_get(cs35l56->base.dev);
+	if (ret)
+		return ret;
+
+	ret = cs35l56_calibrate_sysfs_store(&cs35l56->base, buf, count);
+	pm_runtime_autosuspend(cs35l56->base.dev);
+
+	return ret;
+}
+
+static ssize_t cal_temperature_store(struct device *dev, struct device_attribute *attr,
+				     const char *buf, size_t count)
+{
+	struct cs35l56_hda *cs35l56 = dev_get_drvdata(dev);
+	ssize_t ret;
+
+	ret = pm_runtime_resume_and_get(cs35l56->base.dev);
+	if (ret)
+		return ret;
+
+	ret = cs35l56_cal_ambient_sysfs_store(&cs35l56->base, buf, count);
+	pm_runtime_autosuspend(cs35l56->base.dev);
+
+	return ret;
+}
+
+static ssize_t cal_data_read(struct file *filp, struct kobject *kobj,
+			     const struct bin_attribute *battr, char *buf, loff_t pos,
+			     size_t count)
+{
+	struct cs35l56_hda *cs35l56 = dev_get_drvdata(kobj_to_dev(kobj));
+	ssize_t ret;
+
+	ret = pm_runtime_resume_and_get(cs35l56->base.dev);
+	if (ret)
+		return ret;
+
+	ret = cs35l56_cal_data_sysfs_read(&cs35l56->base, buf, pos, count);
+	pm_runtime_autosuspend(cs35l56->base.dev);
+
+	return ret;
+}
+
+static ssize_t cal_data_write(struct file *filp, struct kobject *kobj,
+			      const struct bin_attribute *battr, char *buf, loff_t pos,
+			      size_t count)
+{
+	struct cs35l56_hda *cs35l56 = dev_get_drvdata(kobj_to_dev(kobj));
+	ssize_t ret;
+
+	ret = cs35l56_cal_data_sysfs_write(&cs35l56->base, buf, pos, count);
+	if (ret == -ENODATA)
+		return count;	/* Ignore writes of empty cal blobs */
+
+	if (ret < 0)
+		return ret;
+
+	ret = pm_runtime_resume_and_get(cs35l56->base.dev);
+	if (ret)
+		return ret;
+
+	ret = cs35l56_hda_apply_calibration(cs35l56);
+	if (ret == 0)
+		cs35l56_mbox_send(&cs35l56->base, CS35L56_MBOX_CMD_AUDIO_REINIT);
+	else
+		count = -EIO;
+
+	pm_runtime_autosuspend(cs35l56->base.dev);
+
+	return count;
+}
+
+static const DEVICE_ATTR_WO(calibrate);
+static const DEVICE_ATTR_WO(cal_temperature);
+static const BIN_ATTR_RW(cal_data, sizeof_field(struct cs35l56_base, cal_data));
+
+static const struct attribute *cs35l56_hda_cal_attributes[] = {
+	&dev_attr_calibrate.attr,
+	&dev_attr_cal_temperature.attr,
+	NULL
+};
+
+static void cs35l56_hda_create_calibration_sysfs(struct cs35l56_hda *cs35l56)
+{
+	struct device *dev = cs35l56->base.dev;
+	int ret;
+
+	if (!IS_ENABLED(CONFIG_SND_HDA_SCODEC_CS35L56_CAL_SYSFS))
+		return;
+
+	ret = sysfs_create_files(&dev->kobj, cs35l56_hda_cal_attributes);
+	if (ret)
+		goto err;
+
+	ret = sysfs_create_bin_file(&dev->kobj, &bin_attr_cal_data);
+	if (ret)
+		goto err;
+
+	return;
+err:
+	dev_err_probe(dev, ret, "Failed creating calibration sysfs\n");
+}
+
+static void cs35l56_hda_remove_calibration_sysfs(struct cs35l56_hda *cs35l56)
+{
+	struct device *dev = cs35l56->base.dev;
+
+	if (!IS_ENABLED(CONFIG_SND_HDA_SCODEC_CS35L56_CAL_SYSFS))
+		return;
+
+	sysfs_remove_files(&dev->kobj, cs35l56_hda_cal_attributes);
+	sysfs_remove_bin_file(&dev->kobj, &bin_attr_cal_data);
+}
+
 static int cs35l56_hda_bind(struct device *dev, struct device *master, void *master_data)
 {
 	struct cs35l56_hda *cs35l56 = dev_get_drvdata(dev);
@@ -722,6 +848,8 @@ static int cs35l56_hda_bind(struct device *dev, struct device *master, void *mas
 	cs_dsp_init_debugfs(&cs35l56->cs_dsp, cs35l56->debugfs_root);
 #endif
 
+	cs35l56_hda_create_calibration_sysfs(cs35l56);
+
 	dev_dbg(cs35l56->base.dev, "Bound\n");
 
 	return 0;
@@ -736,6 +864,7 @@ static void cs35l56_hda_unbind(struct device *dev, struct device *master, void *
 	cancel_work_sync(&cs35l56->dsp_work);
 
 	cs35l56_hda_remove_controls(cs35l56);
+	cs35l56_hda_remove_calibration_sysfs(cs35l56);
 
 #if IS_ENABLED(CONFIG_SND_DEBUG)
 	cs_dsp_cleanup_debugfs(&cs35l56->cs_dsp);
Signature · 1 line
2.47.3
maintainer
#7 lore raw

Re: [PATCH 05/11] ALSA: hda/cs35l56: Create sysfs files for factory calibration

Quoted 7 lines · Takashi Iwai
Quoted 1 line · Richard Fitzgerald

Create sysfs files that can be used to perform factory calibration.

What kind of data format should be written to calibrate sysfs entry? Since those are no trivial files, we may need to document the formats.

This feels like it might be a better fit for debugfs or possibly configfs? It's not really within the sysfs rules, and especially debugfs is a lot more relaxed about everything.

Quoted 2 lines

Also, the scenario isn't clear -- who should write this sysfs at which moment? e.g. is this supposed to be set up at each boot?

AIUI it's some tooling that gets run in the factory only.

author maintainer
#8 lore raw

Re: [PATCH 05/11] ALSA: hda/cs35l56: Create sysfs files for factory calibration

Quoted 5 lines · Mark Brown
Quoted 3 lines · Takashi Iwai
Quoted 1 line · Richard Fitzgerald

Create sysfs files that can be used to perform factory calibration.

Quoted 8 lines
Quoted 3 lines

What kind of data format should be written to calibrate sysfs entry? Since those are no trivial files, we may need to document the formats.

This feels like it might be a better fit for debugfs or possibly configfs? It's not really within the sysfs rules, and especially debugfs is a lot more relaxed about everything.

debugfs is an easy change in the driver but more complex for the tooling. Unlike sysfs there's no standard layout or naming convention for the ASoC debugfs tree, so it's more troublesome to locate the amp entries.

ASoC creates a debugfs root by default if DEBUGFS is enabled. But HDA doesn't have its own debugfs. There is an ALSA debugfs enabled by CONFIG_SND_DEBUG, which is normally disabled. But enabling CONFIG_SND_DEBUG has other side-effects, it enables more than debugfs.

Or we could create a new debugfs node specifically for Cirrus Logic directly in /sys/kernel/debug.

I'll have a look at configfs. Although it works backwards (userside must create the directory in which attributes will appear) it might have some benefits.

maintainer
#9 lore raw

Re: [PATCH 05/11] ALSA: hda/cs35l56: Create sysfs files for factory calibration

Quoted 11 lines · Richard Fitzgerald
Quoted 3 lines · Mark Brown

This feels like it might be a better fit for debugfs or possibly configfs? It's not really within the sysfs rules, and especially debugfs is a lot more relaxed about everything.

debugfs is an easy change in the driver but more complex for the tooling. Unlike sysfs there's no standard layout or naming convention for the ASoC debugfs tree, so it's more troublesome to locate the amp entries.

Quoted 7 lines

ASoC creates a debugfs root by default if DEBUGFS is enabled. But HDA doesn't have its own debugfs. There is an ALSA debugfs enabled by CONFIG_SND_DEBUG, which is normally disabled. But enabling CONFIG_SND_DEBUG has other side-effects, it enables more than debugfs.

Or we could create a new debugfs node specifically for Cirrus Logic directly in /sys/kernel/debug.

Dunno about Takashi but for this application I'd be happy for you to just put something in the root of debugfs.

#10 lore raw

Re: [PATCH 05/11] ALSA: hda/cs35l56: Create sysfs files for factory calibration

Quoted 18 lines · Mark Brown
Quoted 15 lines · Richard Fitzgerald
Quoted 3 lines · Mark Brown

This feels like it might be a better fit for debugfs or possibly configfs? It's not really within the sysfs rules, and especially debugfs is a lot more relaxed about everything.

debugfs is an easy change in the driver but more complex for the tooling. Unlike sysfs there's no standard layout or naming convention for the ASoC debugfs tree, so it's more troublesome to locate the amp entries.

ASoC creates a debugfs root by default if DEBUGFS is enabled. But HDA doesn't have its own debugfs. There is an ALSA debugfs enabled by CONFIG_SND_DEBUG, which is normally disabled. But enabling CONFIG_SND_DEBUG has other side-effects, it enables more than debugfs.

Quoted 5 lines
Quoted 2 lines

Or we could create a new debugfs node specifically for Cirrus Logic directly in /sys/kernel/debug.

Dunno about Takashi but for this application I'd be happy for you to just put something in the root of debugfs.

I'm fine with debugfs root. The current approach with sysfs looks too generic for the need of this access, so I find debugfs would be a better fit, too.

thanks,

Takashi

author maintainer
#11 lore raw

PATCH 6/11 ASoC: cs-amp-lib-test: Add cases for factory calibration helpers

In reply to Richard Fitzgerald

Add test cases for the cs_amp_read_cal_coeffs() and cs_amp_write_ambient_temp() functions.

In both cases the test is simply to confirm that the correct data value(s) get passed back to the caller.

---
 include/sound/cs-amp-lib.h         |  5 +-
 sound/soc/codecs/cs-amp-lib-test.c | 75 +++++++++++++++++++++++++++++-
 sound/soc/codecs/cs-amp-lib.c      |  1 +
 3 files changed, 79 insertions(+), 2 deletions(-)
include/sound/cs-amp-lib.h +4 -1
index e4df0736039a..485daadd13a1 100644
@@ -71,8 +71,11 @@ struct cs_amp_test_hooks {
 	int (*write_cal_coeff)(struct cs_dsp *dsp,
 			       const struct cirrus_amp_cal_controls *controls,
 			       const char *ctl_name, u32 val);
-};
 
+	int (*read_cal_coeff)(struct cs_dsp *dsp,
+			      const struct cirrus_amp_cal_controls *controls,
+			      const char *ctl_name, u32 *val);
+};
 extern const struct cs_amp_test_hooks * const cs_amp_test_hooks;
 
 #endif /* CS_AMP_LIB_H */
sound/soc/codecs/cs-amp-lib-test.c +74 -1

88 lines not on this page · raw message

sound/soc/codecs/cs-amp-lib.c +1 -0
index b2509c5c0690..d510e0e065ca 100644
@@ -515,6 +515,7 @@ EXPORT_SYMBOL_NS_GPL(cs_amp_get_vendor_spkid, "SND_SOC_CS_AMP_LIB");
 static const struct cs_amp_test_hooks cs_amp_test_hook_ptrs = {
 	.get_efi_variable = cs_amp_get_efi_variable,
 	.write_cal_coeff = cs_amp_write_cal_coeff,
+	.read_cal_coeff = cs_amp_read_cal_coeff,
 };
 
 const struct cs_amp_test_hooks * const cs_amp_test_hooks =
Signature · 1 line
2.47.3
author maintainer
#12 lore raw

PATCH 7/11 ASoC: cs-amp-lib: Return attributes from cs_amp_get_efi_variable()

In reply to Richard Fitzgerald

Add a pointer argument to cs_amp_get_efi_variable() to optionally return the EFI variable attributes.

Originally this function internally consumed the attributes from efi.get_variable(). The calling code did not use the attributes so this was a small simplification.

However, when writing to a pre-existing variable we would want to pass the existing attributes to efi.set_variable(). This patch deals with the change to return the attribute in preparation for adding code to update the variable.

---
 include/sound/cs-amp-lib.h         |  1 +
 sound/soc/codecs/cs-amp-lib-test.c | 23 +++++++++++++++++++++++
 sound/soc/codecs/cs-amp-lib.c      | 15 ++++++++++-----
 3 files changed, 34 insertions(+), 5 deletions(-)
include/sound/cs-amp-lib.h +1 -0
index 485daadd13a1..09c54b1bbe6c 100644
@@ -65,6 +65,7 @@ static inline u64 cs_amp_cal_target_u64(const struct cirrus_amp_cal_data *data)
 struct cs_amp_test_hooks {
 	efi_status_t (*get_efi_variable)(efi_char16_t *name,
 					 efi_guid_t *guid,
+					 u32 *returned_attr,
 					 unsigned long *size,
 					 void *buf);
 
sound/soc/codecs/cs-amp-lib-test.c +23 -0
index b19aaacd7f2b..d3419f48297e 100644
@@ -90,6 +90,7 @@ static u64 cs_amp_lib_test_get_target_uid(struct kunit *test)
 /* Redirected get_efi_variable to simulate that the file is too short */
 static efi_status_t cs_amp_lib_test_get_efi_variable_nohead(efi_char16_t *name,
 							    efi_guid_t *guid,
+							    u32 *returned_attr,
 							    unsigned long *size,
 							    void *buf)
 {
@@ -122,6 +123,7 @@ static void cs_amp_lib_test_cal_data_too_short_test(struct kunit *test)
 /* Redirected get_efi_variable to simulate that the count is larger than the file */
 static efi_status_t cs_amp_lib_test_get_efi_variable_bad_count(efi_char16_t *name,
 							       efi_guid_t *guid,
+							       u32 *returned_attr,
 							       unsigned long *size,
 							       void *buf)
 {
@@ -165,6 +167,7 @@ static void cs_amp_lib_test_cal_count_too_big_test(struct kunit *test)
 /* Redirected get_efi_variable to simulate that the variable not found */
 static efi_status_t cs_amp_lib_test_get_efi_variable_none(efi_char16_t *name,
 							  efi_guid_t *guid,
+							  u32 *returned_attr,
 							  unsigned long *size,
 							  void *buf)
 {
@@ -192,6 +195,7 @@ static void cs_amp_lib_test_no_cal_data_test(struct kunit *test)
 /* Redirected get_efi_variable to simulate reading a cal data blob */
 static efi_status_t cs_amp_lib_test_get_efi_variable(efi_char16_t *name,
 						     efi_guid_t *guid,
+						     u32 *returned_attr,
 						     unsigned long *size,
 						     void *buf)
 {
@@ -218,11 +222,18 @@ static efi_status_t cs_amp_lib_test_get_efi_variable(efi_char16_t *name,
 
 	memcpy(buf, priv->cal_blob, priv->cal_blob->size);
 
+	if (returned_attr) {
+		*returned_attr = EFI_VARIABLE_NON_VOLATILE |
+				 EFI_VARIABLE_BOOTSERVICE_ACCESS |
+				 EFI_VARIABLE_RUNTIME_ACCESS;
+	}
+
 	return EFI_SUCCESS;
 }
 
 static efi_status_t cs_amp_lib_test_get_hp_cal_efi_variable(efi_char16_t *name,
 							    efi_guid_t *guid,
+							    u32 *returned_attr,
 							    unsigned long *size,
 							    void *buf)
 {
@@ -249,6 +260,12 @@ static efi_status_t cs_amp_lib_test_get_hp_cal_efi_variable(efi_char16_t *name,
 
 	memcpy(buf, priv->cal_blob, priv->cal_blob->size);
 
+	if (returned_attr) {
+		*returned_attr = EFI_VARIABLE_NON_VOLATILE |
+				 EFI_VARIABLE_BOOTSERVICE_ACCESS |
+				 EFI_VARIABLE_RUNTIME_ACCESS;
+	}
+
 	return EFI_SUCCESS;
 }
 
@@ -787,6 +804,7 @@ static void cs_amp_lib_test_spkid_lenovo_not_present(struct kunit *test)
 
 static efi_status_t cs_amp_lib_test_get_efi_variable_lenovo_d0(efi_char16_t *name,
 							       efi_guid_t *guid,
+							       u32 *returned_attr,
 							       unsigned long *size,
 							       void *buf)
 {
@@ -805,6 +823,7 @@ static efi_status_t cs_amp_lib_test_get_efi_variable_lenovo_d0(efi_char16_t *nam
 
 static efi_status_t cs_amp_lib_test_get_efi_variable_lenovo_d1(efi_char16_t *name,
 							       efi_guid_t *guid,
+							       u32 *returned_attr,
 							       unsigned long *size,
 							       void *buf)
 {
@@ -823,6 +842,7 @@ static efi_status_t cs_amp_lib_test_get_efi_variable_lenovo_d1(efi_char16_t *nam
 
 static efi_status_t cs_amp_lib_test_get_efi_variable_lenovo_00(efi_char16_t *name,
 							       efi_guid_t *guid,
+							       u32 *returned_attr,
 							       unsigned long *size,
 							       void *buf)
 {
@@ -874,6 +894,7 @@ static void cs_amp_lib_test_spkid_lenovo_illegal(struct kunit *test)
 
 static efi_status_t cs_amp_lib_test_get_efi_variable_buf_too_small(efi_char16_t *name,
 								   efi_guid_t *guid,
+								   u32 *returned_attr,
 								   unsigned long *size,
 								   void *buf)
 {
@@ -894,6 +915,7 @@ static void cs_amp_lib_test_spkid_lenovo_oversize(struct kunit *test)
 
 static efi_status_t cs_amp_lib_test_get_efi_variable_hp_30(efi_char16_t *name,
 							   efi_guid_t *guid,
+							   u32 *returned_attr,
 							   unsigned long *size,
 							   void *buf)
 {
@@ -912,6 +934,7 @@ static efi_status_t cs_amp_lib_test_get_efi_variable_hp_30(efi_char16_t *name,
 
 static efi_status_t cs_amp_lib_test_get_efi_variable_hp_31(efi_char16_t *name,
 							   efi_guid_t *guid,
+							   u32 *returned_attr,
 							   unsigned long *size,
 							   void *buf)
 {
sound/soc/codecs/cs-amp-lib.c +10 -5
index d510e0e065ca..2630ea6a8f3a 100644
@@ -244,15 +244,20 @@ EXPORT_SYMBOL_NS_GPL(cs_amp_write_ambient_temp, "SND_SOC_CS_AMP_LIB");
 
 static efi_status_t cs_amp_get_efi_variable(efi_char16_t *name,
 					    efi_guid_t *guid,
+					    u32 *returned_attr,
 					    unsigned long *size,
 					    void *buf)
 {
 	u32 attr;
 
-	KUNIT_STATIC_STUB_REDIRECT(cs_amp_get_efi_variable, name, guid, size, buf);
+	if (!returned_attr)
+		returned_attr = &attr;
+
+	KUNIT_STATIC_STUB_REDIRECT(cs_amp_get_efi_variable, name, guid,
+				   returned_attr, size, buf);
 
 	if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE))
-		return efi.get_variable(name, guid, &attr, size, buf);
+		return efi.get_variable(name, guid, returned_attr, size, buf);
 
 	return EFI_NOT_FOUND;
 }
@@ -287,7 +292,7 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_buffer(struct device *dev)
 	for (i = 0; i < ARRAY_SIZE(cs_amp_lib_cal_efivars); i++) {
 		status = cs_amp_get_efi_variable(cs_amp_lib_cal_efivars[i].name,
 						 cs_amp_lib_cal_efivars[i].guid,
-						 &data_size, NULL);
+						 NULL, &data_size, NULL);
 		if (status == EFI_BUFFER_TOO_SMALL)
 			break;
 	}
@@ -307,7 +312,7 @@ static struct cirrus_amp_efi_data *cs_amp_get_cal_efi_buffer(struct device *dev)
 
 	status = cs_amp_get_efi_variable(cs_amp_lib_cal_efivars[i].name,
 					 cs_amp_lib_cal_efivars[i].guid,
-					 &data_size, data);
+					 NULL, &data_size, data);
 	if (status != EFI_SUCCESS) {
 		ret = -EINVAL;
 		goto err;
@@ -451,7 +456,7 @@ static int cs_amp_get_efi_byte_spkid(struct device *dev, const struct cs_amp_spk
 	int i, ret;
 
 	size = sizeof(spkid);
-	status = cs_amp_get_efi_variable(info->name, info->guid, &size, &spkid);
+	status = cs_amp_get_efi_variable(info->name, info->guid, NULL, &size, &spkid);
 	ret = cs_amp_convert_efi_status(status);
 	if (ret < 0)
 		return ret;
Signature · 1 line
2.47.3
author maintainer
#13 lore raw

PATCH 8/11 ASoC: cs-amp-lib: Add function to write calibration to EFI

In reply to Richard Fitzgerald

Add cs_amp_set_efi_calibration_data() to write an amp calibration blob to EFI calibration variable.

The EFI variable will be updated or created as necessary.

- If a Vendor-specific variable exists it will be updated, else if the Cirrus variable exists it will be update else the Cirrus variable will be created.

Some collateral changes are required:

- cs_amp_convert_efi_status() now specifically handles EFI_WRITE_PROTECTED error.

- cs_amp_get_cal_efi_buffer() can optionally return the name, guid and attr of the variable it found.

- cs_amp_get_cal_efi_buffer() will update the 'size' field of the returned data blob if it is zero. The BIOS could have pre-allocated the EFI variable as zero-filled

---
 include/sound/cs-amp-lib.h    |   2 +
 sound/soc/codecs/cs-amp-lib.c | 190 +++++++++++++++++++++++++++++++++-
 2 files changed, 188 insertions(+), 4 deletions(-)
include/sound/cs-amp-lib.h +2 -0
index 09c54b1bbe6c..4c8b84ee087e 100644
@@ -55,6 +55,8 @@ int cs_amp_write_ambient_temp(struct cs_dsp *dsp,
 			      u32 temp);
 int cs_amp_get_efi_calibration_data(struct device *dev, u64 target_uid, int amp_index,
 				    struct cirrus_amp_cal_data *out_data);
+int cs_amp_set_efi_calibration_data(struct device *dev, int amp_index, int num_amps,
+				    const struct cirrus_amp_cal_data *in_data);
 int cs_amp_get_vendor_spkid(struct device *dev);
 
 static inline u64 cs_amp_cal_target_u64(const struct cirrus_amp_cal_data *data)
sound/soc/codecs/cs-amp-lib.c +186 -4

271 lines not on this page · raw message

Signature · 1 line
2.47.3
author maintainer
#14 lore raw

PATCH 9/11 ASoC: cs35l56: Add calibration command to store into UEFI

In reply to Richard Fitzgerald

Add a new command 'store_uefi' to the calibrate sysfs file. Writing this command will call cs_amp_set_efi_calibration_data() to save the new data into an EFI variable. This is intended to be used after a successful factory calibration to save the data into EFI.

On systems without EFI it will return an error.

---
 include/sound/cs35l56.h           |  1 +
 sound/soc/codecs/cs35l56-shared.c | 19 +++++++++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)
include/sound/cs35l56.h +1 -0
index 4ed738615021..b3770285261c 100644
@@ -314,6 +314,7 @@ struct cs35l56_base {
 	bool can_hibernate;
 	bool cal_data_valid;
 	s8 cal_index;
+	u8 num_amps;
 	struct cirrus_amp_cal_data cal_data;
 	struct gpio_desc *reset_gpio;
 	struct cs35l56_spi_payload *spi_payload_buf;
sound/soc/codecs/cs35l56-shared.c +17 -2
index dc6e49e3421a..27fb2f9b83c5 100644
@@ -1101,8 +1101,8 @@ static int cs35l56_perform_calibration(struct cs35l56_base *cs35l56_base)
 ssize_t cs35l56_calibrate_sysfs_store(struct cs35l56_base *cs35l56_base,
 				      const char *buf, size_t count)
 {
-	static const char * const options[] = { "factory" };
-	int ret;
+	static const char * const options[] = { "factory", "store_uefi" };
+	int num_amps, ret;
 
 	if (!IS_ENABLED(CONFIG_SND_SOC_CS35L56_CAL_SYSFS_COMMON))
 		return -ENXIO;
@@ -1113,6 +1113,21 @@ ssize_t cs35l56_calibrate_sysfs_store(struct cs35l56_base *cs35l56_base,
 		if (ret < 0)
 			return ret;
 		break;
+	case 1:
+		if (!cs35l56_base->cal_data_valid)
+			return -ENODATA;
+
+		num_amps = cs35l56_base->num_amps;
+		if (num_amps == 0)
+			num_amps = -1;
+
+		ret = cs_amp_set_efi_calibration_data(cs35l56_base->dev,
+						      cs35l56_base->cal_index,
+						      num_amps,
+						      &cs35l56_base->cal_data);
+		if (ret < 0)
+			return ret;
+		break;
 	default:
 		return -ENXIO;
 	}
Signature · 1 line
2.47.3
author maintainer
#15 lore raw

PATCH 10/11 ALSA: hda/cs35l56: Set cal_index to the amp index

In reply to Richard Fitzgerald

Set cs35l56_base->cal_index to the (zero-based) amp index derived from cirrus,dev-index property.

This is so that factory calibration data will be written to the EFI array in the slot equal to the amp index, for compatibility with the Windows driver.

---
 sound/hda/codecs/side-codecs/cs35l56_hda.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/hda/codecs/side-codecs/cs35l56_hda.c +1 -1
index 4a1bd934887a..19baa8be310d 100644
@@ -1179,7 +1179,7 @@ int cs35l56_hda_common_probe(struct cs35l56_hda *cs35l56, int hid, int id)
 	}
 
 	cs35l56->base.type = hid & 0xff;
-	cs35l56->base.cal_index = -1;
+	cs35l56->base.cal_index = cs35l56->index;
 
 	cs35l56_init_cs_dsp(&cs35l56->base, &cs35l56->cs_dsp);
 	cs35l56->cs_dsp.client_ops = &cs35l56_hda_client_ops;
Signature · 1 line
2.47.3
author maintainer
#16 lore raw

PATCH 11/11 ASoC: cs-amp-lib-test: Add test cases for cs_amp_set_efi_calibration_data()

In reply to Richard Fitzgerald

Add a set of test cases for cs_amp_set_efi_calibration_data().

Broadly there are two type of behavior being tested:

How the EFI is updated:
- Create a new EFI
- Overwrite part of existing content
- Overwrite part of zero-filled preallocated content
- Grow the file to append new content

And how the location within the content is chosen:
- Overwrite a specific array entry
- Overwrite an entry with the same calTarget (silicon ID)
- Overwrite a free entry
- Append after existing data

Plus some cases for error conditions.

---
 include/sound/cs-amp-lib.h         |    5 +
 sound/soc/codecs/cs-amp-lib-test.c | 1399 +++++++++++++++++++++++++++-
 sound/soc/codecs/cs-amp-lib.c      |    1 +
 3 files changed, 1397 insertions(+), 8 deletions(-)
include/sound/cs-amp-lib.h +5 -0
index 4c8b84ee087e..8eee4ce9eefe 100644
@@ -70,6 +70,11 @@ struct cs_amp_test_hooks {
 					 u32 *returned_attr,
 					 unsigned long *size,
 					 void *buf);
+	efi_status_t (*set_efi_variable)(efi_char16_t *name,
+					 efi_guid_t *guid,
+					 u32 attr,
+					 unsigned long size,
+					 void *buf);
 
 	int (*write_cal_coeff)(struct cs_dsp *dsp,
 			       const struct cirrus_amp_cal_controls *controls,
sound/soc/codecs/cs-amp-lib-test.c +1391 -8

1,454 lines not on this page · raw message

sound/soc/codecs/cs-amp-lib.c +1 -0
index 3f352ecad3e0..1c53328d7165 100644
@@ -701,6 +701,7 @@ EXPORT_SYMBOL_NS_GPL(cs_amp_get_vendor_spkid, "SND_SOC_CS_AMP_LIB");
 
 static const struct cs_amp_test_hooks cs_amp_test_hook_ptrs = {
 	.get_efi_variable = cs_amp_get_efi_variable,
+	.set_efi_variable = cs_amp_set_efi_variable,
 	.write_cal_coeff = cs_amp_write_cal_coeff,
 	.read_cal_coeff = cs_amp_read_cal_coeff,
 };
Signature · 1 line
2.47.3