linux-stable/sound/soc/tegra
Sheetal 6dfe70be0b
ASoC: tegra: Fix ADX byte map
Byte mask for channel-1 of stream-1 is not getting enabled and this
causes failures during ADX use cases. This happens because the byte
map value 0 matches the byte map array and put() callback returns
without enabling the corresponding bits in the byte mask.

ADX supports 4 output streams and each stream can have a maximum of
16 channels. Each byte in the input frame is uniquely mapped to a
byte in one of these 4 outputs. This mapping is done with the help of
byte map array via user space control setting. The byte map array
size in the driver is 16 and each array element is of size 4 bytes.
This corresponds to 64 byte map values.

Each byte in the byte map array can have any value between 0 to 255
to enable the corresponding bits in the byte mask. The value 256 is
used as a way to disable the byte map. However the byte map array
element cannot store this value. The put() callback disables the byte
mask for 256 value and byte map value is reset to 0 for this case.
This causes problems during subsequent runs since put() callback,
for value of 0, just returns without enabling the byte mask. In short,
the problem is coming because 0 and 256 control values are stored as
0 in the byte map array.

Right now fix the put() callback by actually looking at the byte mask
array state to identify if any change is needed and update the fields
accordingly. The get() callback needs an update as well to return the
correct control value that user has set before. Note that when user
set 256, the value is stored as 0 and byte mask is disabled. So byte
mask state is used to either return 256 or the value from byte map
array.

Given above, this looks bit complicated and all this happens because
the byte map array is tightly packed and cannot actually store the 256
value. Right now the priority is to fix the existing failure and a TODO
item is put to improve this logic.

Fixes: 3c97881b8c ("ASoC: tegra: Fix kcontrol put callback in ADX")
Cc: stable@vger.kernel.org
Signed-off-by: Sheetal <sheetal@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/1688015537-31682-3-git-send-email-spujar@nvidia.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2023-06-29 11:40:27 +01:00
..
Kconfig ASoC: tegra: Support MAX9808x by machine driver 2023-03-20 13:06:41 +00:00
Makefile ASoC: tegra: Add Tegra210 based OPE driver 2022-06-06 12:33:07 +01:00
tegra20_ac97.c ASoC: do not include pm_runtime.h if not used 2023-05-23 13:55:55 +01:00
tegra20_ac97.h ASoC: tegra20: ac97: Add reset control 2021-03-18 13:49:30 +00:00
tegra20_das.c ASoC: tegra: tegra20_das: Drop write-only driver data member 2022-07-05 19:54:00 +01:00
tegra20_i2s.c ASoC: tegra: Simplify code around clk_get_rate() handling 2023-06-08 11:36:27 +01:00
tegra20_i2s.h ASoC: tegra20: i2s: Add reset control 2021-03-18 13:49:31 +00:00
tegra20_spdif.c ASoC: tegra: Simplify code around clk_get_rate() handling 2023-06-08 11:36:27 +01:00
tegra20_spdif.h ASoC: tegra20: spdif: Reset hardware 2021-12-17 11:13:57 +00:00
tegra30_ahub.c ASoC: tegra: tegra30_ahub: Convert to platform remove callback returning void 2023-03-20 13:09:24 +00:00
tegra30_ahub.h ASoC: tegra30: ahub: Switch to use reset-bulk API 2021-03-18 13:49:34 +00:00
tegra30_i2s.c ASoC: tegra: tegra30_i2s: Convert to platform remove callback returning void 2023-03-20 13:09:25 +00:00
tegra30_i2s.h
tegra186_asrc.c ASoC: tegra: Use normal system sleep for ASRC 2023-06-22 18:02:04 +01:00
tegra186_asrc.h ASoC: tegra: Add Tegra186 based ASRC driver 2022-04-04 08:39:14 +01:00
tegra186_dspk.c ASoC: tegra: tegra186_dspk: Convert to platform remove callback returning void 2023-03-20 13:09:12 +00:00
tegra186_dspk.h ASoC: tegra: Add Tegra186 based DSPK driver 2020-07-20 15:10:24 +01:00
tegra210_admaif.c ASoC: tegra: tegra210_admaif: Convert to platform remove callback returning void 2023-03-20 13:09:15 +00:00
tegra210_admaif.h ASoC: tegra: Add Tegra210 based ADMAIF driver 2020-07-21 23:26:14 +01:00
tegra210_adx.c ASoC: tegra: Fix ADX byte map 2023-06-29 11:40:27 +01:00
tegra210_adx.h ASoC: tegra: Add Tegra210 based ADX driver 2021-09-20 13:31:35 +01:00
tegra210_ahub.c ASoC: tegra: Remove stale comments in AHUB 2023-06-22 18:02:05 +01:00
tegra210_ahub.h ASoC: tegra: Update AHUB driver for Tegra234 2022-01-28 13:05:26 +00:00
tegra210_amx.c ASoC: tegra: Fix AMX byte map 2023-06-29 11:40:26 +01:00
tegra210_amx.h ASoC: tegra: Add Tegra210 based AMX driver 2021-09-20 13:31:34 +01:00
tegra210_dmic.c ASoC: tegra: tegra210_dmic: Convert to platform remove callback returning void 2023-03-20 13:09:19 +00:00
tegra210_dmic.h ASoC: tegra: Add Tegra210 based DMIC driver 2020-07-20 15:10:22 +01:00
tegra210_i2s.c ASoC: tegra: tegra210_i2s: Convert to platform remove callback returning void 2023-03-20 13:09:19 +00:00
tegra210_i2s.h ASoC: tegra: Add Tegra210 based I2S driver 2020-07-20 15:10:23 +01:00
tegra210_mbdrc.c ASoC: tegra: Fix spelling mistake "fliter" -> "filter" 2022-11-10 17:52:46 +00:00
tegra210_mbdrc.h ASoC: tegra: Fix spelling mistake "fliter" -> "filter" 2022-11-10 17:52:46 +00:00
tegra210_mixer.c ASoC: tegra: tegra210_mixer: Convert to platform remove callback returning void 2023-03-20 13:09:20 +00:00
tegra210_mixer.h ASoC: tegra: Add Tegra210 based Mixer driver 2021-09-20 13:31:36 +01:00
tegra210_mvc.c ASoC: tegra: tegra210_mvc: Convert to platform remove callback returning void 2023-03-20 13:09:21 +00:00
tegra210_mvc.h ASoC: tegra: Add master volume/mute control support 2021-12-01 14:15:39 +00:00
tegra210_ope.c ASoC: tegra: tegra210_ope: Convert to platform remove callback returning void 2023-03-20 13:09:22 +00:00
tegra210_ope.h ASoC: tegra: Add Tegra210 based OPE driver 2022-06-06 12:33:07 +01:00
tegra210_peq.c ASoC: tegra: Add Tegra210 based OPE driver 2022-06-06 12:33:07 +01:00
tegra210_peq.h ASoC: tegra: Add Tegra210 based OPE driver 2022-06-06 12:33:07 +01:00
tegra210_sfc.c ASoC: tegra: tegra210_sfc: Convert to platform remove callback returning void 2023-03-20 13:09:23 +00:00
tegra210_sfc.h ASoC: tegra: Add Tegra210 based SFC driver 2021-09-20 13:31:33 +01:00
tegra_asoc_machine.c ASoC: tegra: remove unneeded semicolon 2023-03-22 13:17:39 +00:00
tegra_asoc_machine.h ASoC: tegra: Restore headphones jack name on Nyan Big 2021-12-13 19:23:33 +00:00
tegra_audio_graph_card.c ASoC: audio-graph: move audio_graph_remove() to simple-card-utils.c 2021-04-20 17:25:45 +01:00
tegra_cif.h ASoC: tegra: Add support for CIF programming 2020-07-20 15:10:21 +01:00
tegra_pcm.c ASoC: tegra: Fix Master Volume Control 2023-06-13 12:10:56 +01:00
tegra_pcm.h ASoC: tegra20: spdif: Use more resource-managed helpers 2021-12-17 11:13:56 +00:00
tegra_wm8903.c ASoC: soc-card: Create jack kcontrol without pins 2022-04-14 17:37:21 +01:00