]> Gentwo Git Trees - linux/.git/commit
firmware: cs_dsp: Factor out common debugfs string read
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Thu, 20 Nov 2025 13:06:39 +0000 (13:06 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 20 Nov 2025 13:12:17 +0000 (13:12 +0000)
commit78cfd833bc04c0398ca4cfc64704350aebe4d4c2
treede59556f0331da0994d69e9f2f182bbb043ded60
parentbe2b723d94f2fa3f8ca028a55d313ba0b3007d44
firmware: cs_dsp: Factor out common debugfs string read

cs_dsp_debugfs_wmfw_read() and cs_dsp_debugfs_bin_read() were identical
except for which struct member they printed. Move all this duplicated
code into a common function cs_dsp_debugfs_string_read().

The check for dsp->booted has been removed because this is redundant.
The two strings are set when the DSP is booted and cleared when the
DSP is powered-down.

Access to the string char * must be protected by the pwr_lock mutex. The
string is passed into cs_dsp_debugfs_string_read() as a pointer to the
char * so that the mutex lock can also be factored out into
cs_dsp_debugfs_string_read().

wmfw_file_name and bin_file_name members of struct cs_dsp have been
changed to const char *. It makes for a better API to pass a const
pointer into cs_dsp_debugfs_string_read().

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20251120130640.1169780-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/firmware/cirrus/cs_dsp.c
include/linux/firmware/cirrus/cs_dsp.h