summaryrefslogtreecommitdiff
path: root/drivers/soundwire
diff options
context:
space:
mode:
authorBard Liao <yung-chuan.liao@linux.intel.com>2024-12-18 16:01:51 +0800
committerVinod Koul <vkoul@kernel.org>2024-12-23 12:00:33 +0530
commit4a7927d54d2c819029e70f6efa768085b90bfc34 (patch)
treed1c72e19546f61f323fa444c09a896ace920d844 /drivers/soundwire
parentcf44ae3d3282572480d760199cc8d6c7c61006cf (diff)
soundwire: generic_bandwidth_allocation: check required freq accurately
Currently, we check curr_dr_freq roughly by "if (curr_dr_freq <= bus->params.bandwidth)" in sdw_compute_bus_params() and check it accurately in sdw_select_row_col(). It works if we only support one freq. But, we need to check it accurately in sdw_select_row_col() to give it a chance to use a higher freq or use multi-lane. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20241218080155.102405-11-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire')
-rw-r--r--drivers/soundwire/generic_bandwidth_allocation.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/soundwire/generic_bandwidth_allocation.c b/drivers/soundwire/generic_bandwidth_allocation.c
index 5c4dac36ad1a..d2632af9c8af 100644
--- a/drivers/soundwire/generic_bandwidth_allocation.c
+++ b/drivers/soundwire/generic_bandwidth_allocation.c
@@ -373,7 +373,8 @@ static int sdw_compute_bus_params(struct sdw_bus *bus)
(bus->params.max_dr_freq >> clk_buf[i]) :
clk_buf[i] * SDW_DOUBLE_RATE_FACTOR;
- if (curr_dr_freq <= bus->params.bandwidth)
+ if (curr_dr_freq * (mstr_prop->default_col - 1) <
+ bus->params.bandwidth * mstr_prop->default_col)
continue;
break;