Skip to content

ASoC: cs35l56: Support for factory calibration through ALSA controls

Richard Fitzgerald linux-sound lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 3 repliesIn review
  2. v11 patch 3 repliesSuperseded

Changes in v2 from the cover letter

- Rename "Calibrate" control to "Calibrate Switch" to conform to naming convention for boolean controls.
- Mark "Calibrate Switch" control volatile.
- Cache the value written to the "CAL_AMBIENT" control so that a read will return the last set value.
- Return 1 from writing "CAL_AMBIENT" if the value was changed.
- Return 1 from writing the "Calibrate Switch" control to true because that always causes some activity in the amp.
- Replace use of the confusing in_range() with normal comparisons against limits and make the limits the same as the control definition.
- Simplify the code in cs35l56_calibrate_ctl_set(). It's a boolean so the value written to it is either false or true.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ASoC: soc.h: Add SOC_SINGLE_BOOL_EXT_ACC() to allow setting access flagsinclude/sound/soc.h+6 -00 replies
2/2ASoC: cs35l56: Allow factory calibration through ALSA controlsinclude/sound/cs35l56.h sound/soc/codecs/Kconfig sound/soc/codecs/cs35l56-shared.c +2 more+121 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] ASoC: cs35l56: Support for factory calibration through ALSA controls

Factory calibration is normally done through debugfs files. Google have requested that factory calibration can be performed by repair shops. These repair shops only have access to the standard "user" kernel, which does not include debugfs.

Patch #1 adds a new control definition macro to create a boolean control
with specified access permissions. (new in V2)

Patch #2 is the implementation in the cs35l56 driver.

Changes in V2:
- Rename "Calibrate" control to "Calibrate Switch" to conform to naming convention for boolean controls.
- Mark "Calibrate Switch" control volatile.
- Cache the value written to the "CAL_AMBIENT" control so that a read will return the last set value.
- Return 1 from writing "CAL_AMBIENT" if the value was changed.
- Return 1 from writing the "Calibrate Switch" control to true because that always causes some activity in the amp.
- Replace use of the confusing in_range() with normal comparisons against limits and make the limits the same as the control definition.
- Simplify the code in cs35l56_calibrate_ctl_set(). It's a boolean so the value written to it is either false or true.

Richard Fitzgerald (2):
ASoC: soc.h: Add SOC_SINGLE_BOOL_EXT_ACC() to allow setting access
flags
ASoC: cs35l56: Allow factory calibration through ALSA controls

 include/sound/cs35l56.h           |  1 +
 include/sound/soc.h               |  6 ++
 sound/soc/codecs/Kconfig          | 13 +++++
 sound/soc/codecs/cs35l56-shared.c |  9 +++
 sound/soc/codecs/cs35l56.c        | 96 +++++++++++++++++++++++++++++++
 sound/soc/codecs/cs35l56.h        |  2 +
 6 files changed, 127 insertions(+)
Signature · 1 line
2.47.3