Skip to content

Commit

Permalink
ASoC: SOF: ipc4-control: Use SOF_CTRL_CMD_BINARY as numid in bytes_ex…
Browse files Browse the repository at this point in the history
…t_get

The header.numid is not used by IPC4 in the data exchanged with user space.
The bytes_ext_get sets it to something close enough to the field's name:
to scontrol->comp_id, but existing user space tooling expects it to be
a constant value of SOF_CTRL_CMD_BINARY, which is the IPC command value in
IPC3 to handle bytes_ext.
The header is not sent to the firmware in case of IPC4, so it is only used
between user space and the kernel, unlike in IPC3 where the header is sent
to the firmware.

Reported-by: Seppo Ingalsuo <[email protected]>
Fixes: a062c88 ("ASoC: SOF: ipc4-control: Add support for bytes control get and put")
Link: thesofproject/sof@f1ccd88#r1900822375
Cc: [email protected]
Signed-off-by: Peter Ujfalusi <[email protected]>
  • Loading branch information
ujfalusi committed Jan 2, 2025
1 parent b6d3bb5 commit 6f82180
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sound/soc/sof/ipc4-control.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,11 @@ static int _sof_ipc4_bytes_ext_get(struct snd_sof_control *scontrol,
if (data_size > size)
return -ENOSPC;

header.numid = scontrol->comp_id;
/*
* Existing user space expects SOF_CTRL_CMD_BINARY as numid in case of
* bytes_ext control.
*/
header.numid = SOF_CTRL_CMD_BINARY;
header.length = data_size;

if (copy_to_user(tlvd, &header, sizeof(struct snd_ctl_tlv)))
Expand Down

0 comments on commit 6f82180

Please sign in to comment.