diff options
| author | Bard Liao <yung-chuan.liao@linux.intel.com> | 2025-10-21 17:43:52 +0800 |
|---|---|---|
| committer | Vinod Koul <vkoul@kernel.org> | 2025-12-08 12:37:27 +0530 |
| commit | fdfa1960eee7591995cf877e9caf9cf5794ab91f (patch) | |
| tree | 6db0d8df235730614195297bec02d19321ea0162 /drivers/soundwire/debugfs.c | |
| parent | 8931f5bce4f159a0dd438c093255d88cb8e00516 (diff) | |
| download | linux-next-fdfa1960eee7591995cf877e9caf9cf5794ab91f.tar.gz linux-next-fdfa1960eee7591995cf877e9caf9cf5794ab91f.zip | |
soundwire: introduce BPT section
Currently we send a BRA message with a start address with continuous
registers in a BPT stream. However, a codec may need to write different
register sections shortly. Introduce a register section in struct
sdw_btp_msg which contain register start address, length, and buffer.
This commit uses only 1 section for each BPT message. And we need to add
up all BPT section length and check if it reach maximum BPT bytes.
No function changes.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Tested-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/20251021094355.132943-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire/debugfs.c')
| -rw-r--r-- | drivers/soundwire/debugfs.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/soundwire/debugfs.c b/drivers/soundwire/debugfs.c index 1e0f9318b616..6068011dd0d9 100644 --- a/drivers/soundwire/debugfs.c +++ b/drivers/soundwire/debugfs.c @@ -222,15 +222,23 @@ DEFINE_DEBUGFS_ATTRIBUTE(set_num_bytes_fops, NULL, static int do_bpt_sequence(struct sdw_slave *slave, bool write, u8 *buffer) { struct sdw_bpt_msg msg = {0}; + struct sdw_bpt_section *sec; - msg.addr = start_addr; - msg.len = num_bytes; + sec = kcalloc(1, sizeof(*sec), GFP_KERNEL); + if (!sec) + return -ENOMEM; + msg.sections = 1; + + sec[0].addr = start_addr; + sec[0].len = num_bytes; + + msg.sec = sec; msg.dev_num = slave->dev_num; if (write) msg.flags = SDW_MSG_FLAG_WRITE; else msg.flags = SDW_MSG_FLAG_READ; - msg.buf = buffer; + sec[0].buf = buffer; return sdw_bpt_send_sync(slave->bus, slave, &msg); } |
