diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2024-06-03 14:58:40 +0800 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2024-06-03 17:40:23 +0530 |
commit | fe46d2a4301de1299fb32c0317ec316706ceaad6 (patch) | |
tree | 920cffabf6cca1f2099d219bf36065bf6cf9f306 /include/linux/soundwire | |
parent | 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 (diff) | |
download | linux-fe46d2a4301de1299fb32c0317ec316706ceaad6.tar.gz linux-fe46d2a4301de1299fb32c0317ec316706ceaad6.tar.bz2 linux-fe46d2a4301de1299fb32c0317ec316706ceaad6.zip |
soundwire: debugfs: add interface to read/write commands
We have an existing debugfs files to read standard registers
(DP0/SCP/DPn).
This patch provides a more generic interface to ANY set of read/write
contiguous registers in a peripheral device. In follow-up patches,
this interface will be extended to use BRA transfers.
The sequence is to use the following files added under the existing
debugsfs directory for each peripheral device:
command (write 0, read 1)
num_bytes
start_address
firmware_file (only for writes)
read_buffer (only for reads)
Example for a read command - this checks the 6 bytes used for
enumeration.
cd /sys/kernel/debug/soundwire/master-0-0/sdw\:0\:025d\:0711\:01/
echo 1 > command
echo 6 > num_bytes
echo 0x50 > start_address
echo 1 > go
cat read_buffer
address 0x50 val 0x30
address 0x51 val 0x02
address 0x52 val 0x5d
address 0x53 val 0x07
address 0x54 val 0x11
address 0x55 val 0x01
Example with a 2-byte firmware file written in DP0 address 0x22
od -x /lib/firmware/test_firmware
0000000 0a37
0000002
cd /sys/kernel/debug/soundwire/master-0-0/sdw\:0\:025d\:0711\:01/
echo 0 > command
echo 2 > num_bytes
echo 0x22 > start_address
echo "test_firmware" > firmware_file
echo 1 > go
cd /sys/kernel/debug/soundwire/master-0-0/sdw\:0\:025d\:0711\:01/
echo 1 > command
echo 2 > num_bytes
echo 0x22 > start_address
echo 1 > go
cat read_buffer
address 0x22 val 0x37
address 0x23 val 0x0a
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20240603065841.4860-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'include/linux/soundwire')
0 files changed, 0 insertions, 0 deletions