diff options
| author | Richard Fitzgerald <rf@opensource.cirrus.com> | 2025-11-10 14:43:27 +0300 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-11-10 15:26:32 +0300 |
| commit | 772ada50282b0c80343c8989147db816961f571d (patch) | |
| tree | f440b620e1d8f1ebb2a2ae21c990a21c637fe12f /include | |
| parent | 4acbfcf11cbe6c46c42091b49875c7002b0bff3d (diff) | |
| download | linux-772ada50282b0c80343c8989147db816961f571d.tar.xz | |
ASoC: cs35l56: Alter error codes for calibration routine
Adjust the error codes returned by the calibration debugfs files
to provide a wider range of errors and make them more consistent.
There is a limited number of standard errors and it's not always
easy to find an error code that accurately describes what happened.
Additionally, user code often uses strerror() or something similar
to report a generic error description. The original calibration
code used a limited set of errors to attempt to avoid user error
strings that would be confusing or unclear on a file read/write.
However, this restricts the ability to provide informative errors.
This limited error range didn't help very much with debugging so
it has been expanded, rather than worrying about what strerror()
would return.
The errors are now more consistent:
ENXIO Calibration is not supported by the driver.
EOPNOTSUPP The given calibration command is not supported.
EBUSY Cannot calibrate because the amp is playing audio.
ERANGE Calibration result was out-of-range.
ETIMEDOUT Calibration did not complete.
EMSGSIZE Blob written to cal_data is the wrong size.
ENODATA No calibration data available to read from cal_data,
or
Blob written to cal_data does not contain calibration,
or
No calibration data available to save to UEFI.
EIO General failure to communicate with the firmware, mainly
indicating that firmware controls are missing.
EINVAL Has its normal meaning that an invalid argument was passed.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20251110114327.84370-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sound/cs35l56.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/sound/cs35l56.h b/include/sound/cs35l56.h index 82559be0f249..0a740a99ad31 100644 --- a/include/sound/cs35l56.h +++ b/include/sound/cs35l56.h @@ -265,6 +265,9 @@ #define CS35L56_PS3_POLL_US 500 #define CS35L56_PS3_TIMEOUT_US 300000 +#define CS35L56_CAL_STATUS_SUCCESS 1 +#define CS35L56_CAL_STATUS_OUT_OF_RANGE 3 + #define CS35L56_CONTROL_PORT_READY_US 2200 #define CS35L56_HALO_STATE_POLL_US 1000 #define CS35L56_HALO_STATE_TIMEOUT_US 250000 |
