linux/include/sound
Charles Keepax 0eba2a7e85
ASoC: ops: Consistently treat platform_max as control value
This reverts commit 9bdd10d57a ("ASoC: ops: Shift tested values in
snd_soc_put_volsw() by +min"), and makes some additional related
updates.

There are two ways the platform_max could be interpreted; the maximum
register value, or the maximum value the control can be set to. The
patch moved from treating the value as a control value to a register
one. When the patch was applied it was technically correct as
snd_soc_limit_volume() also used the register interpretation. However,
even then most of the other usages treated platform_max as a
control value, and snd_soc_limit_volume() has since been updated to
also do so in commit fb9ad24485 ("ASoC: ops: add correct range
check for limiting volume"). That patch however, missed updating
snd_soc_put_volsw() back to the control interpretation, and fixing
snd_soc_info_volsw_range(). The control interpretation makes more
sense as limiting is typically done from the machine driver, so it is
appropriate to use the customer facing representation rather than the
internal codec representation. Update all the code to consistently use
this interpretation of platform_max.

Finally, also add some comments to the soc_mixer_control struct to
hopefully avoid further patches switching between the two approaches.

Fixes: fb9ad24485 ("ASoC: ops: add correct range check for limiting volume")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250228151456.3703342-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2025-03-05 17:25:25 +00:00
..
ac97 driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00
sof ASoC: SOF: ext_manifest: Add missing ext_manifest type for PROBE_INFO 2024-11-07 13:03:22 +00:00
ac97_codec.h ALSA: mark all struct bus_type as const 2023-12-30 10:10:41 +01:00
aci.h ALSA: opti9xx: Use standard print API 2024-08-08 07:49:45 +02:00
acp63_chip_offset_byte.h ASoC: amd: update ps platform acp header file 2023-02-03 12:04:02 +00:00
ad1816a.h
ad1843.h
ak4xxx-adda.h
ak4113.h
ak4114.h
ak4117.h
ak4531_codec.h ALSA: ens137x: Replace with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:24 +01:00
ak4641.h
alc5623.h
asequencer.h ALSA: seq: Add UMP support 2023-05-23 12:11:21 +02:00
asound.h
asoundef.h ALSA: IEC958 definition for consumer status channel update 2024-09-07 10:42:17 +02:00
compress_driver.h ALSA: compress_offload: Add missing descriptions in structs 2024-11-13 13:54:27 +01:00
control.h Merge branch 'topic/control-lookup-rwlock' into for-next 2024-08-09 14:25:24 +02:00
core.h Merge branch 'topic/control-lookup-rwlock' into for-next 2024-08-09 14:25:24 +02:00
cs-amp-lib.h ASoC: cs-amp-lib: Add KUnit test for calibration helpers 2024-03-04 20:27:35 +00:00
cs35l33.h
cs35l34.h
cs35l35.h
cs35l36.h
cs35l41.h ASoC: Constify channel mapping array arguments in set_channel_map() 2024-05-27 01:30:58 +01:00
cs35l56.h ASoC: cs35l56: Prevent races when soft-resetting using SPI control 2025-02-25 15:06:58 +00:00
cs42l42.h ASoC: cs42l42: Remove redundant delays in suspend(). 2024-02-19 17:02:18 +00:00
cs42l43.h ASoC: cs42l43: Add support for the cs42l43 2023-08-18 23:41:54 +01:00
cs42l52.h
cs42l56.h
cs42l73.h
cs4231-regs.h
cs4271.h ASoC: cs4271: Convert to GPIO descriptors 2023-12-01 16:59:21 +00:00
cs8403.h
cs8427.h
da7213.h
da7218.h
da7219-aad.h ASoC: da7219: Add Jack insertion detection polarity 2023-05-23 18:49:36 +01:00
da7219.h
da9055.h
designware_i2s.h ASoC: dwc: i2s: Add StarFive JH7110 SoC support 2023-08-23 13:56:40 +01:00
dmaengine_pcm.h ALSA: dmaengine: Synchronize dma channel after drop() 2024-06-11 17:13:31 +01:00
emu10k1.h Merge branch 'topic/emu10k1-fix' into for-next 2024-04-28 12:00:57 +02:00
emu10k1_synth.h
emu8000.h
emu8000_reg.h
emux_legacy.h
emux_synth.h ALSA: synth: Save a few bytes of memory when registering a 'snd_emux' 2024-01-22 13:04:22 +01:00
es1688.h ALSA: es1688: Use standard print API 2024-08-08 07:47:24 +02:00
graph_card.h ASoC: simple_card_utils.h: convert not to use asoc_xxx() 2023-09-25 14:16:14 +02:00
gus.h
hda-mlink.h ASoC: SOF: Intel: hda-mlink: expose unlocked interrupt enable routine 2024-10-11 12:06:56 +01:00
hda_chmap.h
hda_codec.h ALSA: hda: codec: Reduce CONFIG_PM dependencies 2024-05-08 18:05:08 +02:00
hda_component.h
hda_hwdep.h
hda_i915.h ALSA: hda: i915: Remove extra argument from snd_hdac_i915_init 2023-10-19 14:56:25 +02:00
hda_register.h ALSA: hda: Fix all stream interrupts definition 2024-10-14 12:00:52 +02:00
hda_regmap.h
hda_verbs.h ALSA: cleanup double word in comment 2022-02-11 15:18:56 +01:00
hdaudio.h ALSA: hda: fix trigger_tstamp_latched 2024-10-02 12:50:24 +02:00
hdaudio_ext.h ALSA: hda: Fix compilation of snd_hdac_adsp_xxx() helpers 2025-01-10 17:46:09 +01:00
hdmi-codec.h ASoC: hdmi-codec: move no_capture_mute to struct hdmi_codec_pdata 2025-01-04 08:47:10 +02:00
hwdep.h ALSA: hwdep: Don't embed device 2023-08-17 09:24:01 +02:00
i2c.h
info.h ALSA: info: Remove unused function declarations 2023-08-08 14:45:45 +02:00
initval.h
intel-dsp-config.h ASoC: Intel: avs: PCI driver implementation 2022-05-17 11:58:04 +01:00
intel-nhlt.h ALSA: hda: intel-nhlt: add intel_nhlt_ssp_device_type() function 2024-03-22 12:40:46 +01:00
jack.h ALSA: jack: Access input_dev under mutex 2022-04-12 12:19:05 +02:00
madera-pdata.h ASoC: madera: Replace kernel.h with the necessary inclusions 2022-07-05 13:00:49 +01:00
max9768.h ASoC: max9768: Convert to use GPIO descriptors 2023-09-11 12:50:05 +01:00
max98088.h
max98090.h
max98095.h
memalloc.h ALSA: memalloc: Let IOMMU handle S/G primarily 2024-08-01 12:45:49 +02:00
minors.h
mixer_oss.h
mpu401.h
omap-hdmi-audio.h
opl3.h ALSA: opl3: Replace with __packed attribute 2023-10-26 09:43:15 +02:00
opl4.h
pcm-indirect.h ALSA: pcm: Improved XRUN handling for indirect PCM helpers 2023-03-24 14:52:58 +01:00
pcm.h ALSA: Align the syntax of iov_iter helpers with standard ones 2024-12-30 12:50:04 +01:00
pcm_drm_eld.h
pcm_iec958.h
pcm_oss.h
pcm_params.h ALSA: hda: Upgrade stream-format infrastructure 2023-11-27 17:27:41 +01:00
pt2258.h
pxa2xx-lib.h Input: touchscreen: use wrapper for pxa2xx ac97 registers 2022-05-07 22:55:48 +02:00
rawmidi.h ALSA: rawmidi: Make tied_device=0 as default / unknown 2025-01-14 16:52:07 +01:00
rt286.h
rt298.h
rt1015.h
rt1318.h ASoC: rt1318: Add RT1318 audio amplifier driver 2024-06-19 14:50:34 +01:00
rt5514.h
rt5659.h
rt5660.h
rt5663.h
rt5665.h ASoC: rt5665: Convert to use GPIO descriptors 2023-08-17 15:10:11 +01:00
rt5668.h ASoC: rt5668: Convert to use GPIO descriptors 2023-08-17 15:10:12 +01:00
rt5682.h ASoC: rt5682: Convert to use GPIO descriptors 2023-08-17 15:10:13 +01:00
rt5682s.h ASoC: rt5682s: Add LDO output selection for dacref 2023-11-14 17:39:27 +00:00
sb.h ALSA: als4000: Replace with DEFINE_SIMPLE_DEV_PM_OPS() 2024-02-12 11:50:24 +01:00
sb16_csp.h
sdca.h ASoC: SDCA: Add bounds check for function address 2024-12-24 22:44:55 +00:00
sdca_function.h sound updates for 6.14-rc1 2025-01-24 07:54:34 -08:00
sdw.h sound: sdw: Add hw_params to SoundWire config helper function 2022-11-28 13:04:24 +00:00
seq_device.h ALSA: seq: Bind UMP device 2023-05-23 12:11:33 +02:00
seq_kernel.h ALSA: seq: Remove unused declarations 2024-08-17 16:32:31 +02:00
seq_midi_emul.h
seq_midi_event.h
seq_oss.h
seq_oss_legacy.h
seq_virmidi.h
sh_dac_audio.h
sh_fsi.h
simple_card.h ASoC: remove asoc_xxx() compatible macro 2023-09-26 17:18:45 +02:00
simple_card_utils.h ASoC: Updates for v6.14 2025-01-20 16:15:07 +01:00
snd_wavefront.h ALSA: wavefront: Use standard print API 2024-08-08 07:49:46 +02:00
soc-acpi-intel-match.h ASoC: Intel: soc-acpi: add PTL match tables 2024-08-02 14:04:55 +01:00
soc-acpi-intel-ssp-common.h ASoC: Intel: ssp-common: get codec tplg suffix function 2024-03-28 13:58:14 +00:00
soc-acpi.h ASoC: soc-acpi: introduce new 'machine check' callback 2024-10-17 18:42:14 +01:00
soc-card.h ASoC: Drop snd_soc_*_get_kcontrol_locked() 2024-08-09 14:24:55 +02:00
soc-component.h ASoC: Drop snd_soc_*_get_kcontrol_locked() 2024-08-09 14:24:55 +02:00
soc-dai.h ASoC: soc-dai: add snd_soc_dai_prepare() and use it internally 2025-01-15 13:11:18 +00:00
soc-dapm.h ASoC: dapm: Use unsigned for number of widgets in snd_soc_dapm_new_controls() 2024-07-03 21:43:40 +01:00
soc-dpcm.h ASoC: soc-pcm: makes snd_soc_dpcm_can_be_xxx() local function 2024-08-28 13:02:20 +01:00
soc-jack.h ASoC: soc-jack: Get rid of legacy GPIO support 2024-03-26 17:13:45 +00:00
soc-link.h
soc-topology.h ASoC: topology: Constify an argument of snd_soc_tplg_component_load() 2024-05-27 01:31:15 +01:00
soc.h ASoC: ops: Consistently treat platform_max as control value 2025-03-05 17:25:25 +00:00
soc_sdw_utils.h ASoC: sdw_utils: cs_amp: Assign non-overlapping TDM masks for each codec on a bus 2024-12-03 12:36:28 +00:00
sof.h ASoC: SOF: sof-audio: add sof_dai_get_tdm_slots function 2024-05-29 11:10:54 +01:00
soundfont.h ALSA: emux: Use standard print API 2024-08-08 07:49:46 +02:00
spear_dma.h
spear_spdif.h
sta32x.h
sta350.h
tas2552-plat.h
tas2563-tlv.h ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused 2024-08-22 13:34:12 +01:00
tas2781-dsp.h ASoc: tas2781: Enable RCA-based playback without DSP firmware download 2024-06-18 16:45:53 +01:00
tas2781-tlv.h ASoC: tas2781: Fix a compiling warning reported by robot kernel test due to adding tas2563_dvc_table 2024-08-02 14:05:30 +01:00
tas2781.h ALSA: hda/tas2781: Add speaker id check for ASUS projects 2024-11-26 08:54:08 +01:00
tas5086.h
tea6330t.h
timer.h
tlv.h
tlv320aic32x4.h
tlv320dac33-plat.h
tpa6130a2-plat.h
uda1380.h
ump.h ALSA: seq: Notify UMP EP and FB changes 2025-01-12 13:12:21 +01:00
ump_convert.h ALSA: ump: Transmit RPN/NRPN message at each MSB/LSB data reception 2024-07-31 15:08:18 +02:00
ump_msg.h ALSA: ump: Support UMP Endpoint and Function Block parsing 2023-06-12 18:22:26 +02:00
util_mem.h
vx_core.h ALSA: vx_core: Drop unused dev field 2024-08-08 07:47:23 +02:00
wavefront.h ALSA: wavefront: Drop obsoleted comments and definitions 2023-10-26 09:43:24 +02:00
wm0010.h ASoC: wm0010: Convert to GPIO descriptors 2023-12-08 14:31:57 +00:00
wm2000.h
wm2200.h ASoC: wm2200: Convert to GPIO descriptors 2023-12-08 14:31:59 +00:00
wm5100.h ASoC: wm5100: Convert to GPIO descriptors 2023-12-08 14:31:59 +00:00
wm8903.h
wm8904.h
wm8955.h
wm8960.h
wm8962.h
wm8993.h
wm8996.h ASoC: wm8996: Convert to GPIO descriptors 2023-12-08 14:32:00 +00:00
wm9081.h
wm9090.h
wss.h