Skip to content

Commit

Permalink
case-lib: is_ipc4: use new debugfs file instead of kernel parameter
Browse files Browse the repository at this point in the history
First step to remove use of kernel parameters

Link: thesofproject/linux#4902
Link: thesofproject#1166

Signed-off-by: Pierre-Louis Bossart <[email protected]>
  • Loading branch information
plbossart committed Apr 3, 2024
1 parent a2062a3 commit ba2c568
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions case-lib/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -810,9 +810,31 @@ is_firmware_file_zephyr()
test "$znum" -gt 10
}

is_ipc4_debugfs()
{
local ipc_type

ipc_file=/sys/kernel/debug/sof/ipc_type
ipc_type=$(cat $ipc_file) || {
return 1
}

if [ "$ipc_type" -eq 1 ]; then
return 0
fi
return 1
}

is_ipc4()
{
local ipc_type

# First try with debugfs
if is_ipc4_debugfs; then
return 0
fi

# backwards-compatible fallback with ipc_type kernel parameter
ipc_file=/sys/module/snd_sof_pci/parameters/ipc_type

# If /sys/module/snd_sof_pci/parameters/ipc_type does not exist
Expand Down

0 comments on commit ba2c568

Please sign in to comment.