soundwire: Add generic bandwidth allocation algorithm
authorBard Liao <yung-chuan.liao@linux.intel.com>
Tue, 8 Sep 2020 13:15:20 +0000 (21:15 +0800)
committerVinod Koul <vkoul@kernel.org>
Fri, 18 Sep 2020 12:18:51 +0000 (17:48 +0530)
commit9026118f20e28f202dab34f219bbb831ffb8c4dc
tree1ee57a6ac5368a66aad6feed6ac8074a15fdf05b
parent32d2a8935bf8faf201ff1a859eeb43ef6e5e438d
soundwire: Add generic bandwidth allocation algorithm

This algorithm computes bus parameters like clock frequency, frame
shape and port transport parameters based on active stream(s) running
on the bus.

Developers can also implement their own .compute_params() callback for
specific resource management algorithm, and set if before calling
sdw_add_bus_master()

Credits: this patch is based on an earlier internal contribution by
Vinod Koul, Sanyog Kale, Shreyas Nc and Hardik Shah. All hard-coded
values were removed from the initial contribution to use BIOS
information instead.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Acked-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20200908131520.5712-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/Kconfig
drivers/soundwire/Makefile
drivers/soundwire/bus.c
drivers/soundwire/bus.h
drivers/soundwire/generic_bandwidth_allocation.c [new file with mode: 0644]
drivers/soundwire/intel.c
drivers/soundwire/stream.c
include/linux/soundwire/sdw.h